代码:
DATA: l_vbeln TYPE vbeln, ls_headerx TYPE bapisdh1x, ls_logic TYPE bapisdls, lt_return TYPE TABLE OF bapiret2, lt_item TYPE TABLE OF bapisditm, ls_item TYPE bapisditm, lt_itemx TYPE TABLE OF bapisditmx, ls_itemx TYPE bapisditmx. l_vbeln = '2100000792'. ls_headerx-updateflag = 'U'. ls_logic-pricing = 'B'. ls_logic-cond_handl = 'X'. ls_item-itm_number = ls_itemx-itm_number = '000190'. ls_itemx-updateflag = 'U'. APPEND ls_item TO lt_item. APPEND ls_itemx TO lt_itemx. CALL FUNCTION 'BAPI_SALESORDER_CHANGE' EXPORTING salesdocument = l_vbeln order_header_inx = ls_headerx logic_switch = ls_logic TABLES return = lt_return order_item_in = lt_item order_item_inx = lt_itemx. READ TABLE lt_return WITH KEY type = 'E' TRANSPORTING NO FIELDS. IF sy-subrc = 0. ROLLBACK WORK. ELSE. COMMIT WORK AND WAIT. ENDIF. cl_demo_output=>write( lt_return ). cl_demo_output=>display( ).