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)
Working with the session Id // ID für den Modus
Sometimes it can be helpful to know the id of the current session CALL FUNCTION 'TH_GET_CONTEXT_ID' IMPORTING cont...
-
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...
-
SAP's standard class cl_http_utility provides methods to encode and decode base64, i.e. encode_base64 and decode_base64 . l_r...
No comments:
Post a Comment