Skip to Content
0
Former Member
Mar 27, 2009 at 04:49 AM

Creating Material text in va02 item lines using Bapi

353 Views

Dear all,

I want to add Material Sales Text in Text Tab of Tab Control on VA02 line items.

ie when I open a sales order in va02. And I click on the line item in the sales order, I want to add on Material text in , Text Tab.

I am using BAPI_SALESORDER_CHANGE AND table ORDER_TEXT for updating the text.

I am not sure if order_text is the right table to update the text.

My code is

REPORT zapo_ranjan_test .

DATA:order_header_inx LIKE bapisdh1x.

DATA:return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.

DATA:order_item_in LIKE bapisditm OCCURS 0 WITH HEADER LINE.

DATA:order_item_inx LIKE bapisditmx OCCURS 0 WITH HEADER LINE.

DATA : test1 like BAPISDTEXT occurs 0 with header line.

order_header_inx-updateflag = 'U'.

order_item_in-itm_number = '000003'.

APPEND order_item_in.

order_item_inx-itm_number = '000003'.

order_item_inx-updateflag = 'U'.

append order_item_inx.

test1-doc_number = '2292443'.

test1-itm_number = '000003'.

test1-text_id = '0001'.

test1-text_line = 'Phone Number'.

append test1.

CALL FUNCTION 'BAPI_SALESORDER_CHANGE'

EXPORTING

salesdocument = '0002292443'

  • ORDER_HEADER_IN =

order_header_inx = order_header_inx

  • SIMULATION =

  • BEHAVE_WHEN_ERROR = ' '

  • INT_NUMBER_ASSIGNMENT = ' '

  • LOGIC_SWITCH =

TABLES

return = return

order_item_in = order_item_in

order_item_inx = order_item_inx

  • PARTNERS =

  • PARTNERCHANGES =

  • PARTNERADDRESSES =

  • ORDER_CFGS_REF =

  • ORDER_CFGS_INST =

  • ORDER_CFGS_PART_OF =

  • ORDER_CFGS_VALUE =

  • ORDER_CFGS_BLOB =

  • ORDER_CFGS_VK =

  • ORDER_CFGS_REFINST =

  • SCHEDULE_LINES =

  • SCHEDULE_LINESX =

ORDER_TEXT = test1

  • ORDER_KEYS =

  • CONDITIONS_IN =

  • CONDITIONS_INX =

  • EXTENSIONIN =

.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = 'X'.

COMMIT WORK.

Write : / 'Done.'.

My bapi returns documnet changed successfully.

Look forwad to get any clue or help .

regards,

Ranjan A