‎2006 Sep 21 5:38 AM
I am getting a message "no vendor master exists for vendor "
My code is:
REPORT z_h_d_bapi_1 .
DATA : po_header LIKE bapiekkoc,
po_items LIKE bapiekpoc OCCURS 0 WITH HEADER LINE,
po_item_schedules like bapieket occurs 0 with header line,
wa_po_add_header TYPE bapiekkoa,
return LIKE bapireturn OCCURS 0 WITH HEADER LINE.
Data pno like bapiekko-po_number.
*POPULATE ITEM DATA.
CLEAR po_items.
REFRESH po_items.
po_items-po_item = '00010'.
po_items-material = '000000000100IMASMI'.
po_items-plant = '0001'.
*po_items-store_loc = ''.
po_items-ACCTASSCAT = 'X'.
*po_items-quantity = '10'.
po_items-unit = 'EA'.
*po_items-net_price = 'EA'.
*po_items-price_unit = 'EA'.
APPEND po_items.
*POPULATE SCHEDULES DATA
clear po_item_schedules.
refresh po_item_schedules.
po_item_schedules-po_item = '00010'.
po_item_schedules-deliv_date = sy-datum.
po_item_schedules-quantity = '100'.
append po_item_schedules.
po_header-DOC_DATE = SY-DATUM .
po_header-purch_org = '1000' .
po_header-pur_group = '001' .
po_header-vendor = 'VBA-BOM' .
po_header-doc_type = 'NB'.
po_header-co_code = '0001'.
po_header-doc_cat = 'F'.
po_header-created_by = sy-uname.
po_header-langu = 'E'.
po_header-langu_iso = 'EN'.
*po_header-sales_pers = 'Mr. rahul' .
CALL FUNCTION 'BAPI_PO_CREATE'
EXPORTING
po_header = po_header
PO_HEADER_ADD_DATA = wa_po_add_header
HEADER_ADD_DATA_RELEVANT = '1'
PO_ADDRESS =
SKIP_ITEMS_WITH_ERROR = 'X'
ITEM_ADD_DATA_RELEVANT = '1'
HEADER_TECH_FIELDS =
IMPORTING
PURCHASEORDER = pno
tables
po_items = po_items
PO_ITEM_ADD_DATA =
po_item_schedules = po_item_schedules
PO_ITEM_ACCOUNT_ASSIGNMENT =
PO_ITEM_TEXT =
RETURN = return
PO_LIMITS =
PO_CONTRACT_LIMITS = "
PO_SERVICES = ! !
PO_SRV_ACCASS_VALUES =
PO_SERVICES_TEXT =
PO_BUSINESS_PARTNER =
EXTENSIONIN =
POADDRDELIVERY =
.
LOOP AT return.
WRITE:/ pno, 'sdasdas', return-message.
ENDLOOP.
‎2006 Sep 21 7:07 AM
Dear Hiral
Do let us know if your problem is resolved.
Kind Regards
Eswar
‎2006 Sep 21 5:44 AM
first check the Vendor details along with Company code + puchase org in LFA1.
<b>find out , what is the Message number and class ? by using that u can fidn out from there / what system is checking ? so u can debug.</b>Regards
Prabhu
Message was edited by: Prabhu Peram
‎2006 Sep 21 6:04 AM
‎2006 Sep 21 6:13 AM
Check in table LFM1 with vendor number and purchase org.
Also check that the deletion indicator is not set i.e LOEVM should be SPACE.
Kind Regards
Eswar
‎2006 Sep 21 7:07 AM
Dear Hiral
Do let us know if your problem is resolved.
Kind Regards
Eswar
‎2006 Sep 21 8:28 AM
still it gives same message. I guess some problems with validations. How can i get a test data for testing my program??
‎2006 Sep 21 9:46 AM
How about taking a vendor number for the purchase orgranization where loekz eq SPACE from LFM1 and try creating purchase order online through transaction ME21N. When it is successfull, you can popuplate the structures and internal tables for the same set of values for passing to the BAPI and try to create with BAPI.
Kind Regards
Eswar
‎2006 Sep 22 7:31 AM
Facing the same problems using create po transaction me21n. Is there ne way i can get correct ccode, p_org, plant, vendor combination???
‎2006 Sep 22 7:43 AM
Use SE11 to display table LFM1, you will find all the fields in the table. Take a latest entry combination and it should work.
Seems you have difficulty in understanding the above posts, so it is better asking your functional consultant to provide you with test data or even show you creating a PO online via transaction ME21N.
Kind Regards
Eswar
‎2006 Sep 22 7:54 AM
Hi,
Go to Transaction EKKO and select an Purchase Order and Check if there are entries for that in EKPO. Use that and create an PO in ME21 using the same vendor and Purchasing Organisation.
Then use this to get the details using the BAPI.
Hope this might have helped you.
Thanks and Regards,
Prashanth