‎2008 May 05 6:18 AM
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 ?
‎2008 May 05 6:27 AM
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
‎2008 May 05 7:51 AM
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.
‎2008 May 05 6:28 AM
Hi,
Please read the documentation for the BAPI. Specifically for tables parameter SCHEDULE_LINES and SCHEDULE_LINESX.
Thank you.
Reward pioints if found useful