Hi,...
I use BAPI_SALESORDER_CREATEFROMDAT2 and got this error message "Not possible to carry out conversion"
I have tried to fill trg_qty_no and/or trgqty_den and/or salqtynum (based on help description that u must fill the conversion factor), but still have no luck.
And if I try it in se37 it returns successfully.
Can anyone help? below is my code:
it_so_hdr-doc_type = 'S22'.
it_so_hdr-sales_org = '1000'.
it_so_hdr-distr_chan = '01'.
it_so_hdr-division = '10'.
it_so_hdr-dlv_block = '06'.
get data from file content
it_so_hdr-req_date_h = '20051111'.
it_so_hdr-date_type = 'D'.
it_so_hdr-purch_date = '20051108'.
it_so_hdr-purch_no_c = 'YBG013'.
APPEND it_so_hdr.
set it_so_hdrx
it_so_hdrx-updateflag = 'I'.
it_so_hdrx-dlv_block = 'X'.
it_so_hdrx-doc_type = 'X'.
it_so_hdrx-sales_org = 'X'.
it_so_hdrx-distr_chan = 'X'.
it_so_hdrx-division = 'X'.
get data from file content
it_so_hdrx-req_date_h = 'X'.
it_so_hdrx-date_type = 'X'.
it_so_hdrx-purch_date = 'X'.
it_so_hdrx-purch_no_c = 'X'.
APPEND it_so_hdrx.
set it_so_pnr
it_so_pnr-partn_role = 'AG'.
it_so_pnr-partn_numb = '0000200064'.
APPEND it_so_pnr.
it_so_pnr-partn_role = 'WE'.
it_so_pnr-partn_numb = '0000200064'.
APPEND it_so_pnr.
set it_so_items
it_so_items-itm_number = 10.
it_so_items-material = '000000000000100300'.
it_so_items-trg_qty_no = 1.
it_so_items-trgqty_den = 1.
it_so_items-salqtynum = 1.
it_so_items-cust_mat35 = ''.
it_so_items-target_qty = 2.
it_so_items-target_qu = 'KAR'.
it_so_items-sales_unit = 'KAR'.
APPEND it_so_items.
set it_so_itemsx
it_so_itemsx-updateflag = 'I'.
it_so_itemsx-itm_number = 'X'.
it_so_itemsx-material = 'X'.
it_so_itemsx-trg_qty_no = 'X'.
it_so_itemsx-trgqty_den = 'X'.
it_so_itemsx-salqtynum = 'X'.
it_so_itemsx-cust_mat35 = 'X'.
it_so_itemsx-target_qty = 'X'.
it_so_itemsx-target_qu = 'X'.
it_so_itemsx-sales_unit = 'X'.
APPEND it_so_itemsx.
set it_so_schdl
it_so_schdl-itm_number = 10.
it_so_schdl-req_qty = 2.
APPEND it_so_schdl.
set it_so_schdlx
it_so_schdlx-updateflag = 'I'.
it_so_schdlx-itm_number = 'X'.
it_so_schdlx-req_qty = 'X'.
APPEND it_so_schdlx.
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
EXPORTING
order_header_in = it_so_hdr
order_header_inx = it_so_hdrx
TABLES
return = it_ret
order_items_in = it_so_items
order_items_inx = it_so_itemsx
order_partners = it_so_pnr
order_schedules_in = it_so_schdl
order_schedules_inx = it_so_schdlx.