Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Sales order change using BAPI_SALESORDER_CHANGE Extension for custom fields

Former Member
0 Kudos
3,439

Hi,

If anyone have had worked on VBAP/VBAK extension with more than one custom fields and have used BAPI_SALES ORDER_CHANGE to update the Sales order, please help with a sample code how to implement it..

Thanks in adv,

Shiv

1 ACCEPTED SOLUTION

Former Member
0 Kudos
632

Hi,

To use user defined field that is extension you need to populate extension structure as well as communication structures.

If you are adding to the header level then add fields to below structure

BAPE_VBAK

BAPE_VBAKX

If you are adding to the header level then add fields to below structure

BAPE_VBAP

BAPE_VBAPX.

4 REPLIES 4

Former Member
0 Kudos
633

Hi,

To use user defined field that is extension you need to populate extension structure as well as communication structures.

If you are adding to the header level then add fields to below structure

BAPE_VBAK

BAPE_VBAKX

If you are adding to the header level then add fields to below structure

BAPE_VBAP

BAPE_VBAPX.

0 Kudos
632

Hi Rohit,

Thanks for your inputs. I have maintained the below structures with the new custom fields.

VBAPKOZ, VBAPKOZX

BAPE_VBAP, BAPE_VBAPX

I am updating at the item level.

I just wanted to have idea on the coding part. Could anyone send me some sample code which updates more than 1 custom fields through BAPI...?

Thanks in adv,

Shiv

Former Member
0 Kudos
632

Hi,

Suppose i want to add 2 fields in extnesion.

w_pricing

w_shipping

Then,

data: ls_ext_head TYPE bape_vbak,

ls_ext_headx TYPE bape_vbakx,

MOVE w_pricing TO ls_ext_head-zzmatm.

MOVE w_shipping TO ls_ext_head-zzmatmshp.

MOVE: 'BAPE_VBAK' TO ls_bapiparex-structure,

ls_ext_head TO ls_bapiparex+30(960).

APPEND ls_bapiparex TO lt_bapiparex.

CLEAR : ls_ext_head,

ls_bapiparex.

MOVE U TO ls_ext_headx-zzmatm.

MOVE U TO ls_ext_headx-zzmatmshp.

MOVE: 'BAPE_VBAKX' TO ls_bapiparex-structure,

ls_ext_headx TO ls_bapiparex+30(960).

APPEND ls_bapiparex TO lt_bapiparex.

Send lt_bapiparex to BAPI.

Please rewards if it helps you to do further design.

Former Member
0 Kudos
632

Thanks for all your support