DATA ls_edi_ds TYPE edi_ds.
CLEAR es_edidc.
CALL FUNCTION 'EDI_DOCUMENT_OPEN_FOR_PROCESS'
EXPORTING
document_number = iv_docnum
IMPORTING
idoc_control = es_edidc
EXCEPTIONS
document_foreign_lock = 1
document_not_exist = 2
document_number_invalid = 3
document_is_already_open = 4
OTHERS = 5.
IF sy-subrc <> 0.
CLEAR es_edidc.
RETURN.
ENDIF.
ls_edi_ds = VALUE #(
docnum = iv_docnum
status = iv_status
uname = sy-uname
logdat = sy-datum
logtim = sy-uzeit
).
CALL FUNCTION 'EDI_DOCUMENT_STATUS_SET'
EXPORTING
document_number = iv_docnum
idoc_status = ls_edi_ds
IMPORTING
idoc_control = es_edidc
EXCEPTIONS
document_number_invalid = 1
other_fields_invalid = 2
status_invalid = 3
OTHERS = 4.
IF sy-subrc <> 0.
CLEAR es_edidc.
RETURN.
ENDIF.
CALL FUNCTION 'EDI_DOCUMENT_CLOSE_PROCESS'
EXPORTING
document_number = iv_docnum
IMPORTING
idoc_control = es_edidc
EXCEPTIONS
document_not_open = 1
failure_in_db_write = 2
parameter_error = 3
status_set_missing = 4
OTHERS = 5.
IF sy-subrc <> 0.
CLEAR es_edidc.
RETURN.
ENDIF.
Tuesday, May 9, 2017
Subscribe to:
Post Comments (Atom)
SAP ABAP: Determine Timezone for Plant
DATA: lt_tzone TYPE STANDARD TABLE OF tznzone WITH DEFAULT KEY, l_tzone TYPE tznzone. " get time zone for plant ...
-
Sometimes the backend doesn't return the selected rows of an SALV. For my case get_metadata( ) was the solution: go_salv-> get_met...
-
GUIDs or UUIDs can be created with the class cl_system_uuid . try . data (lv_uuid) = cl_system_uuid => if_system_uuid_static...
-
AA PR-AUF(E) Prozessauftrag (eröffnet) AB PR-AUF(F) Prozessauftrag (freigegeben) AC FE...
No comments:
Post a Comment