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: 

Mutilple updations and insertions by BAPI_SALESORDER_CHANGE at one time

Former Member
0 Kudos
353

Hi ,

I just want to know whether it is possible to insert and update multiple line items in a sales order through the BAPI BAPI_SALESORDER_CHANGE .

we tried doin it for single record ( update and insert ) , it is working fine . but when we try for mutiple items , it gives a system dump.

could you plz help out , how to pass the parameters for mutiple updation and insertions at a time?

4 REPLIES 4

former_member181962
Active Contributor
0 Kudos
79

Yes, this BAPI can be used to update multiple line items also.

Can you tell us what dump did you get?

Regards,

Ravi Kanth Talagana

0 Kudos
79

See the below DUMP analysis

When changing or deleting one or more lines of the internal table

"\FUNCTION-POOL=V03V\DATA=MVERF_POS-EINTEIL" or when inserting in the table

"\FUNCTION-POOL=V03V\DATA=MVERF_POS-EINTEIL", 0 was used as

the line index. An index less than or equal to zero is not

allowed.

The error can occur when using the following options:

1. "INDEX idx" for specifying the line number in the table

"\FUNCTION-POOL=V03V\DATA=MVERF_POS-EINTEIL"

where you want to change, insert or delete.

2. "FROM idx" for specifying the start index when deleting a line

area from or inserting a line area into the table

"\FUNCTION-POOL=V03V\DATA=MVERF_POS-EINTEIL".

3. "TO idx" for specifying the end index when deleting a line

area from or inserting a line area into the table

"\FUNCTION-POOL=V03V\DATA=MVERF_POS-EINTEIL".

When the program terminated, the table had 3 lines.

the above dump occurs when we were doing multiple updation and insertions of line items at a time

0 Kudos
79

HI ALL,

I THINK IF WE MAKE THE SCHEDULE LINE ITEM NO. TO BE UNIQUE FOR EACH LINE ITEM IT GETS UPLOADED PROPERLY. THE VBEP-ETENR IS 001 ONLY. PEOPLE WITH ALTERNAT ANSWERS PLZ. CORRECT.

SEE CODES BELOW.

***********************************************************************

**This creates additional line no. in the sales order.

**Material no is hard coded, you need to change the materisl no in

**available in ur system.

************************************************************************

*

T_ITEM-itm_number = ''.

T_ITEM-material = 'AGA350'.

T_ITEM-target_qty = '2'.

APPEND T_ITEM.

T_ITEMx-itm_number = ''.

T_ITEMX-UPDATEFLAG = 'I'.

T_ITEMX-target_qty = 'X'.

T_ITEMX-material = 'X'.

APPEND T_ITEMX.

T_SCHE-SCHED_LINE = '1'.

T_SCHE-REQ_QTY = 2.

t_sche-req_date = '20080204'.

APPEND T_SCHE.

T_SCHEX-updateflag = c_insertflag.

t_schex-req_date = 'X'.

T_SCHEX-SCHED_LINE = '1'.

t_schex-req_qty = 'X'.

APPEND T_SCHEX.

***********************************************************************

**This also creates additional line no. in the sales order.

**Material no is hard coded, you need to change the materisl no in

**available in ur system.

***********************************************************************

*T_ITEM-itm_number = ''.

T_ITEM-material = 'AGA350'.

T_ITEM-target_qty = '1'.

APPEND T_ITEM.

*T_ITEMx-itm_number = ''.

T_ITEMX-UPDATEFLAG = 'I'.

T_ITEMX-target_qty = 'X'.

T_ITEMX-material = 'X'.

APPEND T_ITEMX.

T_SCHE-SCHED_LINE = '4'.

t_sche-req_date = '20080202'.

T_SCHE-REQ_QTY = 1.

APPEND T_SCHE.

T_SCHEX-updateflag = c_insertflag.

t_schex-req_date = 'X'.

T_SCHEX-ITM_NUMBER = 'X'.

T_SCHEX-SCHED_LINE = '4'.

T_SCHEX-REQ_QTY = 'X'.

APPEND T_SCHEX.

**********************************

***********************************************************************

**This also creates additional line no. in the sales order.

**Material no is hard coded, you need to change the materisl no in

**available in ur system.

***********************************************************************

*

*

*T_ITEM-itm_number = ''.

T_ITEM-material = 'AGA350'.

T_ITEM-target_qty = '1'.

APPEND T_ITEM.

*T_ITEMx-itm_number = ''.

T_ITEMX-UPDATEFLAG = 'I'.

T_ITEMX-target_qty = 'X'.

T_ITEMX-material = 'X'.

APPEND T_ITEMX.

T_SCHE-SCHED_LINE = '5'.

t_sche-req_date = '20080202'.

T_SCHE-REQ_QTY = 1.

APPEND T_SCHE.

T_SCHEX-updateflag = c_insertflag.

t_schex-req_date = 'X'.

T_SCHEX-ITM_NUMBER = 'X'.

T_SCHEX-SCHED_LINE = '5'.

T_SCHEX-REQ_QTY = 'X'.

APPEND T_SCHEX.

**********************************

***********************************************************************

**This also creates additional line no. in the sales order.

**Material no is hard coded, you need to change the materisl no in

**available in ur system.

***********************************************************************

*

*T_ITEM-itm_number = ''.

T_ITEM-material = 'AGA350'.

T_ITEM-target_qty = '1'.

APPEND T_ITEM.

*T_ITEMx-itm_number = ''.

T_ITEMX-UPDATEFLAG = 'I'.

T_ITEMX-target_qty = 'X'.

T_ITEMX-material = 'X'.

APPEND T_ITEMX.

T_SCHE-SCHED_LINE = '6'.

t_sche-req_date = '20080202'.

T_SCHE-REQ_QTY = 1.

APPEND T_SCHE.

T_SCHEX-updateflag = c_insertflag.

t_schex-req_date = 'X'.

T_SCHEX-ITM_NUMBER = 'X'.

T_SCHEX-SCHED_LINE = '6'.

T_SCHEX-REQ_QTY = 'X'.

APPEND T_SCHEX.

*********************************

*i_order_header_in-sd_doc_cat

Former Member
0 Kudos
79

Hi ,

I am able to update and insert multiple items now.

i am closing the thread .

Rishabh