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: 

Issue with Order Qty field while creating Sales Order

Former Member
0 Kudos

Hi All,

I have created Sales Order using BAPI_SALESORDER_CREATEFROMDAT2.

The Sales Order is getting created successfully.

But the order Quantity (VBAP-KWMENG) is getting saved as 0 irrespective of value that has been passed into the BAPI.

While debugging the BAPI, it has been observed that the final internal table has the correct value from flat file (ie 2.000 or 3.000).

But once the BAPI gets executed, the sales order will have the value 0.

How to handle this error?

Regards

Pavan

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Pavan,

Use the table ORDER_SCHEDULES_IN and the field is REQ_QTY

Also set the flag for the same

Regards

Shiva

7 REPLIES 7

GauthamV
Active Contributor
0 Kudos

Check this.

[quantity problem in BAPI_SALESORDER_CREATEFROMDAT2 |https://forums.sdn.sap.com/click.jspa?searchID=21701727&messageID=6685769]

Former Member
0 Kudos

Hi,

You have to fill all the following tables and pass them to the BAPI.


ORDER_ITEMS_IN                = i_item
ORDER_ITEMS_INX               = i_itemx
RDER_SCHEDULES_IN            =i_schd
ORDER_SCHEDULES_INX           =i_schdX

0 Kudos

Hi Sandhya,

Can you tell me what values should be passed into i_itemx table?

I have used item_x-target_qty = 'X' and appended this value in table item_x.

Th e same table has been mentioned in the BAPI too.

Still i am getting the new sales order created with Order Qty as zero.

Please help me out.....

Regards

Pavan

Edited by: Pavan Sanganal on Feb 2, 2009 4:09 PM

0 Kudos

You need to fill schedule line table and its X table too...

For tables:

ORDER_SCHEDULES_IN

ORDER_SCHEDULES_INX

fill the fields

ITM_NUMBER

SCHED_LINE

REQ_DATE

REQ_QTY

Quantities are always taken from schedule lines and summed for each item....

Former Member
0 Kudos

hi

check out the threads

hope this helps

regards

Aakash Banga

Former Member
0 Kudos

Pavan,

Use the table ORDER_SCHEDULES_IN and the field is REQ_QTY

Also set the flag for the same

Regards

Shiva

Former Member
0 Kudos

Hi Pavan,

What Vishnu suggested to you is correct.

Proceed in that way.

Whichever fields you are providing for ITEM table, You have mark 'X' to those fields in ITEMX.

In the same way for SCHEDULE table, You have to mark corresponding fields in SCHEDULEX table.

Schedule lines is the way to schedule the delivery to customers.

So, qty should be filled in this table. i.e, REQ_QTY.


You have to fill the following for ITEM and ITEMX table.
*field name*        *ITEM*      *ITEMX*
ITM_NUMBER     '000010'        'X'
TARGET_QTY      25               'X'

You have to fill the following for SCHEDULE and SCHEDULEX table.
*field name*             *SCHEDULE*     *SCHEDULEX*
ITM_NUMBER           '000010'                  'X'
SCHED_LINE            '0001'                      'X'
REQ_DATE               sy-datum                'X'
REQ_QTY                 25                          'X'

Regards,

Sandhya