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: 

Bapi_Salesorder_Change update cost center

Former Member
0 Kudos

Hi Guys,

Can anyone help me how to update cost center in sales order using Bapi_Salesorder_Change ?

what are the different parameters need to pass in the bapi.

Thanks in advance.

aVaDuDz

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

PARAMETERS: p_vbeln TYPE vbap-vbeln OBLIGATORY, "SO No

p_cost TYPE bapisdh1-costcenter OBLIGATORY. "Cost Center

DATA: i_hdr TYPE bapisdh1,

i_hdrx TYPE bapisdh1x.

i_hdrx-updateflag = 'U'.

i_hdr-costcenter = p_cost.

i_hdrx-costcenter = 'X'.

CALL FUNCTION 'BAPI_SALESORDER_CHANGE'

EXPORTING

salesdocument = p_vbeln

order_header_in = i_hdr

order_header_inx = i_hdrx

TABLES

return = i_ret.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

LOOP AT i_ret.

WRITE / i_ret-message.

ENDLOOP.

Thanks,

Durai.V

1 REPLY 1

Former Member
0 Kudos

Hi,

PARAMETERS: p_vbeln TYPE vbap-vbeln OBLIGATORY, "SO No

p_cost TYPE bapisdh1-costcenter OBLIGATORY. "Cost Center

DATA: i_hdr TYPE bapisdh1,

i_hdrx TYPE bapisdh1x.

i_hdrx-updateflag = 'U'.

i_hdr-costcenter = p_cost.

i_hdrx-costcenter = 'X'.

CALL FUNCTION 'BAPI_SALESORDER_CHANGE'

EXPORTING

salesdocument = p_vbeln

order_header_in = i_hdr

order_header_inx = i_hdrx

TABLES

return = i_ret.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

LOOP AT i_ret.

WRITE / i_ret-message.

ENDLOOP.

Thanks,

Durai.V