Created
February 15, 2023 08:28
-
-
Save larshp/1cb6c2e4864e1b96f21956278974b14f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* create a return order given sales order | |
* and update the return order with order reason | |
DATA lv_vbeln TYPE vbak-vbeln. | |
DATA lt_return TYPE STANDARD TABLE OF bapiret2 WITH EMPTY KEY. | |
DATA ls_header_in TYPE bapisdh1. | |
DATA ls_header_inx TYPE bapisdh1x. | |
CALL FUNCTION 'BAPI_SALESDOCUMENT_COPY' | |
EXPORTING | |
salesdocument = '3000071300' | |
documenttype = 'ABC' | |
IMPORTING | |
salesdocument_ex = lv_vbeln | |
TABLES | |
return = lt_return. | |
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' | |
EXPORTING | |
wait = abap_true. | |
ls_header_in-ord_reason = 'ABC'. | |
ls_header_inx-updateflag = 'U'. | |
ls_header_inx-ord_reason = abap_true. | |
CALL FUNCTION 'BAPI_SALESORDER_CHANGE' | |
EXPORTING | |
salesdocument = lv_vbeln | |
order_header_in = ls_header_in | |
order_header_inx = ls_header_inx | |
TABLES | |
return = lt_return. | |
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' | |
EXPORTING | |
wait = abap_true. | |
BREAK-POINT. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment