Application Development and Automation 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: 
Read only

REGARDING BAPI

Former Member
0 Likes
451

Hello Everyone,

I want to update Quantity field of sales order using BAPI_salesorder_change.

At the time of calling the BAPI what parameters should be passed ?

3 REPLIES 3
Read only

Former Member
0 Likes
432

Hi Vishal,

First, You have a look that u are not going to change any sales order header data.Then if only u want to change Item detail (Order quan) then u will pass item number, sales order no, and order quan and fill the flag for these fileds in itemx table also pass the update fleg 'U' both in headerX and itemX tables.

Then get the schedule line no from VBEP table against Order no and pass it in ORDER ScHEDULE table and pass the flag for filled values in SCHEDULEX table.

Thanks

Sanket

Read only

0 Likes
432

Hi Vishal,

U want to change the quantity field of a salesorder,First u fill the updateflag as'U'

and REQ_QTY as 'X' in SCHDL_LINESX table and pass these in the "BAPI_SALESORDER_CHANGE".

  • For Schedule line number use the table VBEP.

DATA : SCHDL_LINES LIKE BAPISCHDL OCCURS 0 WITH HEADER LINE,

SCHDL_LINESX LIKE BAPISCHDLX OCCURS 0 WITH HEADER LINE.

SCHDL_LINES-REQ_QTY = T_VBEP-LMENG.

Append SCHDL_LINES.

SCHDL_LINESX-REQ_QTY = 'X'.

SCHDL_LINESX-UPDATEFLAG = 'U'

Append SCHDL_LINESX.

Pass these table in Bapi "BAPI_SALESORDER_CHANGE".

CALL FUNCTION 'BAPI_SALESORDER_CHANGE'

EXPORTING

SALESDOCUMENT = T_VBEP-VBELN

ORDER_HEADER_IN = T_HDR

ORDER_HEADER_INX = T_HDRX

TABLES

RETURN = T_RET

SCHEDULE_LINES = SCHDL_LINES

SCHEDULE_LINESX = SCHDL_LINESX.

Read only

Former Member
0 Likes
432

Hi,

Please read the documentation for the BAPI. Specifically for tables parameter SCHEDULE_LINES and SCHEDULE_LINESX.

Thank you.

Reward pioints if found useful