Hi Guys,
I have added a checkbox "zzpump_reqd" in the Sales Order screen at item-level. When I try to update this field using BAPI_SALESORDER_CHANGE it is not getting updated. The custom field is getting updated without any issues when I try to create a sales order using BAPI_SALESORDER_CREATEFROMDAT2.
I have updated the following tables / structures with the custom field.
VBAP
VBAPKOZ
VBAPKOZX
BAPE_VBAP
BAPE_VBAPX
VBAPKOM
VBAPKOMX
The BAPI in the below program returns the below successful messages.
ORDER_HEADER_IN has been processed successfully
ITEM_IN has been processed successfully
Order XXXXXX has been saved
Could you please let me know why my code is not working.
PARAMETERS: p_vbeln TYPE vbak-vbeln.
DATA: t_line LIKE bapisditm OCCURS 0 WITH HEADER LINE.
DATA: t_linex LIKE bapisditmx OCCURS 0 WITH HEADER LINE.
DATA: t_exten LIKE bapiparex OCCURS 0 WITH HEADER LINE.
DATA: t_return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
DATA: bape_vbap LIKE bape_vbap.
DATA: bape_vbapx LIKE bape_vbapx.
DATA: order_headerx LIKE bapisdh1x.
order_headerx-updateflag = 'U'.
t_line-itm_number = '000010'.
APPEND t_line.
t_linex-itm_number = '000010'.
t_linex-updateflag = 'U'.
APPEND t_linex.
bape_vbap-vbeln = p_vbeln.
bape_vbap-posnr = '000010'.
bape_vbap-zzpump_reqd = 'X'.
t_exten-structure = 'BAPE_VBAP'.
t_exten+30 = bape_vbap.
APPEND t_exten.
bape_vbapx-vbeln = p_vbeln.
bape_vbapx-posnr = '000010'.
bape_vbapx-zzpump_reqd = 'X'.
t_exten-structure = 'BAPE_VBAPX'.
t_exten+30 = bape_vbapx.
APPEND t_exten.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = p_vbeln
order_header_inx = order_headerx
TABLES
return = t_return
order_item_in = t_line
order_item_inx = t_linex
extensionin = t_exten.
LOOP AT t_return.
WRITE: / t_return-message.
ENDLOOP.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.