Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Bapi_Salesorder_Change update cost center

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

Former Member
Former Member replied

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

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question