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: 

update sales order item texts using BAPI_SALESORDER_CHANGE

Former Member
0 Kudos

Dear Friends,

I am facing the problem in using bapi_salesorder_change to update the item texts.

I used the below logic.

ta_text-doc_number = ps_output-order1.

ta_text-itm_number = tp_item + 10.

ta_text-text_id = 'YATP'.

ta_text-langu = 'EN'.

ta_text-text_line = ps_output-atp_date.

APPEND ta_text.

CALL FUNCTION 'BAPI_SALESORDER_CHANGE'

EXPORTING

SALESDOCUMENT = tp_vbeln

ORDER_HEADER_IN = ts_order_header

ORDER_HEADER_INX = ts_order_headerx

TABLES

RETURN = ta_return

ORDER_ITEM_IN = ta_item

ORDER_ITEM_INX = ta_itemx

SCHEDULE_LINES = ta_sch_line

SCHEDULE_LINESX = ta_sch

ORDER_TEXT = ta_text.

Anybody have any idea, please suggest.

thanks

Jagadish

5 REPLIES 5

mvoros
Active Contributor
0 Kudos

Hi,

please red documentation for this BAPI in SE37. There are three required conditions for minimum entry. One of them is

You must always specify the update indicator in the ORDER_HEADER_INX

I don't see in your code that you set it. You can also simply debug this BAPI to see what problem you have with your input values.

Cheers

Former Member
0 Kudos

thanks for your quick reply,

I have used the update flag as below.

ts_order_headerx-updateflag = 'U'.

actually everything is working fine except item texts.

Please advice.

Thanks & Regards

Jagadish Banala

Former Member
0 Kudos

Hi,

Try below code, which is the part of code written by you with some changes.

data : tdline type tdline.
move ps_output-atp_date to tdline.
ta_text-itm_number = '000010'.  "replaced tp_item+10 - check value of tp_item+10"
ta_text-text_id = 'YATP'.
ta_text-langu = 'EN'.
ta_text-text_line = tdline.
append ta_text.

Regards

Vinod

jan_ladwig
Explorer

For anyone, who still faces this error, please read SAP hint 426980

https://launchpad.support.sap.com/#/notes/426980

The header updateflag in ORDER_HEADER_INX must have the value 'U' PLUS the table ORDER_ITEM_IN needs to get passed with at least the position number filled.

Only if both conditions are fulfilled the position texts will get updated.

Best regards

Jan

varyzhou
Newcomer
0 Kudos

except header-updateflag = U , and ORDER_TEXT

you also need input

ORDER_ITEM_IN(ITM_NUMBER)

ORDER_ITEM_INX(ITM_NUMBER/UPDATEFLAG)