Skip to Content
0
Mar 14 at 02:12 PM

BAPI_SALESORDER_CHANGE - Extension Not Working - In App Extensibility

434 Views Last edit Mar 16 at 07:37 AM 4 rev

Hi,

I have added a new field using in-app extensibility in VA02, now when I am trying to populate the value using BAPI_SALESORDER_CHANGE(with extension), it's not working.

Sample Code:

DATA: lv_vbeln TYPE bapivbeln-vbeln,
ls_order_in TYPE bapisdh1,
ls_order_inx TYPE bapisdh1x,

lt_return TYPE TABLE OF bapiret2,

ls_order_item_in TYPE bapisditm,
lt_order_item_in TYPE TABLE OF bapisditm,
lt_order_item_inx TYPE TABLE OF bapisditmx,
ls_order_item_inx TYPE bapisditmx,
ls_extensionin TYPE bapiparex,
lt_extensionin TYPE TABLE OF bapiparex,
ls_extensioninx TYPE bapiparex,
lt_extensioninx TYPE TABLE OF bapiparex.

"for bapi extension
DATA : gs_bape_vbap TYPE bape_vbap,
gs_bape_vbapx TYPE bape_vbapx,
lv_prmsorder TYPE char10.

gs_bape_vbap-zz1_prms_order_sdi = lv_prmsorder.
gs_bape_vbap-vbeln = lv_vbeln.
gs_bape_vbap-posnr = '000100'.
ls_extensionin-structure = 'BAPE_VBAP'.
*ls_extensionin-valuepart1 = gs_bape_vbap.
ls_extensionin+30 = gs_bape_vbap.
APPEND ls_extensionin TO lt_extensionin.

gs_bape_vbapx-zz1_prms_order_sdi = 'X'.
gs_bape_vbapx-vbeln = lv_vbeln.
gs_bape_vbapx-posnr = '000100'.
ls_extensioninx-structure = 'BAPE_VBAPX'.
*ls_extensioninx-valuepart1 = gs_bape_vbapx.
ls_extensioninx+30 = gs_bape_vbapx.
APPEND ls_extensioninx TO lt_extensioninx.

ls_order_item_in-itm_number = '000100'.
*ls_order_item_in-item_categ = '***'.
*ls_order_item_in-plant = '***'.
ls_order_item_inx-itm_number = '000100'.
ls_order_item_inx-updateflag = 'U'.


APPEND ls_order_item_in TO lt_order_item_in.
APPEND ls_order_item_inx TO lt_order_item_inx.

ls_order_inx-updateflag = 'U'.

CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = lv_vbeln
* order_header_in = ls_order_in
order_header_inx = ls_order_inx
TABLES
return = lt_return
order_item_in = lt_order_item_in
order_item_inx = lt_order_item_inx
extensionin = lt_extensionin
extensionex = lt_extensioninx.

IF sy-subrc IS INITIAL.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.


ENDIF.

any leads will be appreciated.

Thank you.

Edit: Return table contains success messages, but not updating in the standard table(vbap).