cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_SALESORDER_CHANGE

Former Member
0 Kudos

Does anyone know of what data needs to be passed to this BAPI in order to reference the Item to a specific Quantity Contract?

I'm able to reference the Header to a Quantity Contract, but it doesn't work for the Item.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You need to pass the item table with the following fields filled in

ORDER_ITEM_IN-REF_DOC = Reference document number (in your case the Qty contract number)

ORDER_ITEM_IN-REF_DOC_IT = Reference document item number (in your case the Qty contract item number)

ORDER_ITEM_IN-REF_DOC_CA = 'E' (document category for Qty contract)

Also remember to set the corresponding fields with the same name in ORDER_ITEM_INX structure to 'X' so that they are updated for the order item that you are creating

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks for the Replies -

I checked note 370988 and it seems to only apply to when you are creating an Order. I'm only looking at updating an Order that is already created.

I'm passing the following in BAPI_SALESORDER_CHANGE (in SE37 test sequence with BAPI_TRANSACTION_COMMIT) and it is not updating.

SALESDOCUMENT = '0000004473'

ORDER_HEADER_INX - UPDATEFLAG = 'U'

ORDER_ITEM_IN - ITM_NUMBER = '000010'

ORDER_ITEM_IN - REF_DOC = QTY CONTRACT #

ORDER_ITEM_IN - REF_DOC_IT = QTY ITEM #

REF_DOC_CA = 'G'

ORDER_ITEM_INX - ITM_NUMBER = '000010'

ORDER_ITEM_INX - UPDATEFLAG = 'U'

ORDER_ITEM_INX - REF_DOC = 'X'

ORDER_ITEM_INX - REF_DOC_IT = 'X'

ORDER_ITEM_INX - REF_DOC_CA = 'X'

Former Member
0 Kudos

Try using document category 'E' rather than 'G'

Former Member
0 Kudos

REF_DOC_CA (VBTYP_V) should be 'G' according to VBFA.

G = Contract

Also I tried it with E (as well as blank) and neither seems to work to update the Item.

Shiva_Ram
Active Contributor
0 Kudos

Can you check OSS Note 366265 - How should I fill the BAPI parameters? May be you need to fill data at sales order schedule line level too.

Regards,

Former Member
0 Kudos

Thanks for the replies -

I tried adding the schedule lines and it still will not update.

SALESDOCUMENT = '0000004473'

ORDER_HEADER_INX - UPDATEFLAG = 'U'

ORDER_ITEM_IN - ITM_NUMBER = '000010'

ORDER_ITEM_IN - MATERIAL = '599'

ORDER_ITEM_IN - PLANT = 'N024'

ORDER_ITEM_IN - TARGET_QTY = '50.000'

ORDER_ITEM_IN - REF_DOC = QTY CONTRACT #

ORDER_ITEM_IN - REF_DOC_IT = QTY ITEM #

ORDER_ITEM_IN - REF_DOC_CA = 'G'

ORDER_ITEM_INX - ITM_NUMBER = '000010'

ORDER_ITEM_INX - UPDATEFLAG = 'U'

ORDER_ITEM_INX MATERIAL = 'X'

ORDER_ITEM_INX- PLANT = 'X'

ORDER_ITEM_INX - TARGET_QTY = 'X'

ORDER_ITEM_INX - REF_DOC = 'X'

ORDER_ITEM_INX - REF_DOC_IT = 'X'

ORDER_ITEM_INX - REF_DOC_CA = 'X'

SCHEDULE_LINES- ITM_NUMBER = '000010'

SCHEDULE_LINES - SCHED_LINE = '0001'

SCHEDULE_LINES -REQ_DATE = '11/21/2011'

SCHEDULE_LINES - REQ_QTY = '50.000'

SCHEDULE_LINESX - ITM_NUMBER = '000010'

SCHEDULE_LINESX - SCHED_LINE = 0001'

SCHEDULE_LINESX - UPDATEFLAG = 'U'

SCHEDULE_LINESX - REQ_DATE = 'X'

SCHEDULE_LINESX - REQ_QTY = 'X'

Former Member
0 Kudos

I was able to get this working but only by creating a new Line Item (using I instead of U).

Thanks for all of the help -I'm guessing it won't update an existing line item due to the copy rules, but it does work for new items.

Thanks - Tim

Shiva_Ram
Active Contributor
0 Kudos

Will OSS Note 370988 - BAPIs in SD: Creation with reference help your scenario?

Regards,