‎2006 Aug 29 5:41 AM
Hi all,
while creating sales order i am pasing the below fields to the structures of bapi BAPI_SALESORDER_CREATEFROMDAT2.
1)for structure BAPISDHD1, i am passing below fields
move p_auart to wa_header-doc_type.
move p_vkorg to wa_header-sales_org.
move p_vtweg to wa_header-distr_chan.
move p_spart to wa_header-division.
move p_vkgrp to wa_header-sales_grp.
move p_vkbur to wa_header-sales_off.
Read table i_upload into wa_upload index 1.
move wa_upload-ebeln to wa_header-purch_no_c.
move wa_upload-aedat to wa_header-purch_date.
move wa_upload-bsart to wa_header-po_method.
move wa_upload-vdatu to wa_header-req_date_h.
move wa_upload-bstkd_e to wa_header-purch_no_s.
*move wa_upload-route to wa_header-route.
move wa_upload-vsbed to wa_header-ship_cond.
move wa_upload-empst to wa_header-rec_point.
move wa_upload-shtyp to wa_header-ship_type.
move wa_upload-zterm to wa_header-pmnttrms.
move wa_upload-inco1 to wa_header-incoterms1.
move wa_upload-inco2 to wa_header-incoterms2.
2) for BAPIPARNR structure, i am passing
move 'AG' to i_partner-partn_role.
move wa_upload-kunnr to i_partner-partn_numb.
move wa_upload-land1_s to i_partner-country.
move wa_upload-name1_s to i_partner-name.
move wa_upload-name2_s to i_partner-name_2.
move wa_upload-ort01_s to i_partner-city.
move wa_upload-regio_s to i_partner-region.
move wa_upload-pstlz_s to i_partner-postl_code.
move wa_upload-adrnr_s to i_partner-address.
append i_partner.
move 'WE' to i_partner-partn_role.
move wa_upload-kunag to i_partner-partn_numb.
move wa_upload-land1_c to i_partner-country.
move wa_upload-name1_c to i_partner-name.
move wa_upload-name2_c to i_partner-name_2.
move wa_upload-ort01_c to i_partner-city.
move wa_upload-regio_c to i_partner-region.
move wa_upload-pstlz_c to i_partner-postl_code.
move wa_upload-adrnr_c to i_partner-address.
append i_partner.
3)for BAPISDITM structure, i am passing below fields
move wa_upload-posnr to i_item-itm_number.
move wa_upload-pstyv to i_item-item_categ.
move wa_upload-matnr to i_item-material.
move wa_upload-zmeng to i_item-target_qty.
move wa_upload-meins to i_item-target_qu.
move wa_upload-werks to i_item-plant.
*move wa_upload-meins to wa_vbap-meins.
*move wa_upload-posnr_tot to wa_vbap-posnr_tot.
move wa_upload-posex to i_item-po_itm_no.
move wa_upload-kdmat to i_item-cust_mat22.
move wa_upload-inco1 to i_item-incoterms1.
move wa_upload-inco2 to i_item-incoterms2.
move wa_upload-zterm to i_item-pmnttrms.
move wa_upload-empst to i_item-rec_point.
move wa_upload-shtyp to i_item-ship_type.
move wa_upload-route to i_item-route.
4) for BAPISCHDL structure,
move wa_upload-matnr to i_schedule-itm_number.
move sy-datum to i_schedule-req_date.
move wa_upload-zmeng to i_schedule-req_qty.
append i_schedule.
5)for BAPICOND structure, i am passing
move wa_upload-matnr to i_cond-itm_number.
move sy-datum to i_cond-conpricdat.
append i_cond.
<u><b>RESULT</b></u>
1) i am not getting any sales order getting created.
2) i am not getting any return message by BAPIRET2 also.
3)i am not finding the error by debugging also.
4)those fields what i passed to BAPI is sufficient to create a SO or not?
5)plz suggest wheather i need some more fields to pass to BAPI i.e i mean ,if i will miss some important fields then this may be the cause of not creating SO.
or i am passing more fields so that it will cause problem.
plz suggest where i am doing mistake.it is urgent.
Thanks & Regards
‎2006 Aug 29 5:43 AM
If BAPI return is EMPTY then i think u are not calling COMMIT WORK , just check that one.
u have to call COMMIT work after the BAPI.
Regards
Prabhu
‎2006 Aug 29 5:43 AM
If BAPI return is EMPTY then i think u are not calling COMMIT WORK , just check that one.
u have to call COMMIT work after the BAPI.
Regards
Prabhu
‎2006 Aug 29 7:21 AM
Hi
Use the statement COMMIT WORK AND WAIT or Call FM BAPI_TRANSACTION_COMMIT after the BAPI call
Regards
Beena