Application Development and Automation 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: 
Read only

BAPI_SALESDOCU_CREATEFROMDATA1 quantity zero

Former Member
0 Likes
1,050

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

4 REPLIES 4
Read only

Former Member
0 Likes
783

Hi,

Pass I to update flag of SALES_SCHEDULES_INX structure.

lw_shedules_inx-updateflag = 'I' .

Regards

Vinod

Read only

Former Member
0 Likes
783

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

Read only

0 Likes
783

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

Read only

Former Member
0 Likes
783

Thank Vinod,

If i don't use the tables

sales_schedules_in

sales_schedules_inx

the sales order is created with quantity correctly