‎2006 Mar 04 5:39 AM - edited ‎2024 Feb 04 3:27 AM
I use BAPI_SALESORDER_CREATEFROMDAT2 to create a sales order. From the documentation, all the sales order item data should be put in the table ORDER_ITEMS_IN.
I have filled the following fields:
- ITM_NUMBER
- MATERIAL
- TARGET_QTY
- TARGET_QU
- SALES_UNIT
However, the sales order is created containing item without quanity.
Which fields I must fill in so that to have quantity included in the sales item?
Thanks!
‎2006 Mar 04 6:16 AM
HI
U have to populate the quantity in schedule line, in the bapi and not as in orders_items_in. insert equavilent lines in the schedule line with line numbers 10, 20, 30 and corresponding QTY
regards
kishore
reward if helpful
‎2006 Mar 04 6:16 AM
HI
U have to populate the quantity in schedule line, in the bapi and not as in orders_items_in. insert equavilent lines in the schedule line with line numbers 10, 20, 30 and corresponding QTY
regards
kishore
reward if helpful
‎2006 Mar 04 6:35 AM
Hi
try this code
*----
Build order item(s)
*----
l_order_items_in-itm_number = '000001'.
l_order_items_inx-itm_number = '000001'.
*PLANT
l_order_items_in-PLANT = '0180' .
l_order_items_inx-PLANT = 'X'.
***************************************************************
l_order_items_in-material = '0001303043'.
l_order_items_inx-material = 'X'.
l_order_items_in-comp_quant = '100.000'.
l_order_items_inx-comp_quant = 'X'.
APPEND l_order_items_in TO li_order_items_in.
l_order_items_inx-updateflag = 'I'.
APPEND l_order_items_inx TO li_order_items_inx.
*----
CALL Bapi
*----
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
EXPORTING
order_header_in = l_order_header_in
order_header_inx = l_order_header_inx
testrun = 'X'
IMPORTING
salesdocument = l_vbeln
TABLES
return = li_return
order_items_in = li_order_items_in
order_items_inx = li_order_items_inx
order_partners = li_order_partners.
regards
kishore
‎2006 Mar 04 7:33 AM
Hi,
You need to pass the same into schedule lines. Please refer the code below :
*----
Populate schedule Line
*----
CLEAR wa_sch_in.
wa_sch_in-itm_number = l_item_number.
wa_sch_in-sched_line = l_item_number.
wa_sch_in-req_qty = wa_items_in-target_qty.
APPEND wa_sch_in TO i_sch_in.
CLEAR wa_sch_inx.
wa_sch_inx-itm_number = l_item_number.
wa_sch_inx-sched_line = lc_active.
wa_sch_inx-req_qty = lc_active.
wa_sch_inx-req_date = lc_active.
APPEND wa_sch_inx TO i_sch_inx.
Best regards,
Prashant