‎2010 May 27 11:38 AM
Hello,
After i look at the forum, i need your help with follow:
I'm using the bapi BAPI_SALESDOCU_CREATEFROMDATA1 for creating sales order
The sales order is created with quantity zero, i don't know why...
The information of i passing to bapi to position level is:
loop at li_tab assigning -menge.
lw_shedules_inx-itm_number = lw_itemin_it-itm_number.
lw_shedules_inx-sched_line = lv_reparto.
lw_shedules_inx-req_qty = c_x.
lw_shedules_inx-updateflag = c_x.
insert lw_itemin_it into table po_t_itemin_it.
insert lw_iteminx_it into table po_t_iteminx_it.
insert lw_shedules_in into table po_t_shedules_in.
insert lw_shedules_inx into table po_t_shedules_inx.
clear: lw_itemin_it, lw_iteminx_it, lw_shedules_in, lw_shedules_inx.
endloop.
i don't know what happens
thanks very much
‎2010 May 27 11:44 AM
Hi,
Pass I to update flag of SALES_SCHEDULES_INX structure.
lw_shedules_inx-updateflag = 'I' .
Regards
Vinod
‎2010 May 27 11:50 AM
Thanks Vinod,
i've test passing I to update flag of SALES_SCHEDULES_INX structure.
lw_shedules_inx-updateflag = 'I' .
however the quantity continue = zero, the problem persist
some other idea?
Regards
‎2010 May 27 12:21 PM
Hi,
You can refer to the sample code below, which is tested and working properly
itemx-updateflag = 'I'.
item-itm_number = '000010'.
itemx-itm_number = 'X'.
item-material = p_matnr.
itemx-material = 'X'.
item-plant = p_plant.
itemx-plant = 'X'.
item-target_qty = p_menge.
itemx-target_qty = 'X'.
append item.
append itemx.
lt_schedules_in-itm_number = '000010'.
lt_schedules_in-sched_line = '0001'.
lt_schedules_in-req_qty = p_menge.
append lt_schedules_in.
lt_schedules_inx-itm_number = '000010'.
lt_schedules_inx-sched_line = '0001'.
lt_schedules_inx-updateflag = 'I'.
lt_schedules_inx-req_qty = 'X'.
append lt_schedules_inx.
call function 'BAPI_SALESDOCU_CREATEFROMDATA1'
exporting
salesdocument = sd_doc
sales_header_in = header
sales_header_inx = headerx
importing
salesdocument_ex = v_vbeln
tables
return = return
sales_items_in = item
sales_items_inx = itemx
sales_schedules_in = lt_schedules_in
sales_schedules_inx = lt_schedules_inx
sales_partners = partner.Rgards
Vinod
‎2010 May 27 2:51 PM
Thank Vinod,
If i don't use the tables
sales_schedules_in
sales_schedules_inx
the sales order is created with quantity correctly