on 2009 Jun 12 7:40 AM
Hi all,
I need to create conversion program to upload Open Purchase order data from flat file to System.
I am trying to create po using bapi BAPI_POEC_CREATE. but getting error .
should any one give the details of parameter need to pass the bapi .
Thanks in advance
Sharad
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sharad,
To find out which all parameters have to be passed, please see the documentation of this BAPI which is available in SE37. A very neat explanation has been provided in the BAPI documentation.
Eg:
Required fields
The following fields are absolutely necessary for the system to be able
save the purchase order.
o Transaction type
o Logical FI system
o Company code in FI system
o Organizational data
Thanks,
Pradeep
HI
I am getting error for partner function
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sharad,
Not the very best piece of code, but should be helpful.
REPORT zkb_po_create.
DATA: ls_po_header TYPE bapi_po_header_c.
DATA: ls_e_po_header TYPE bapi_po_header_d.
DATA: ls_po_items TYPE bapi_po_item_c.
DATA: ls_po_accass TYPE bapi_acc_c.
DATA: ls_po_partner TYPE bapi_bup_c.
DATA: ls_po_orgdata TYPE bapi_org_c.
DATA: ls_return TYPE bapiret2.
DATA: lt_po_items TYPE TABLE OF bapi_po_item_c.
DATA: lt_po_accass TYPE TABLE OF bapi_acc_c.
DATA: lt_po_partner TYPE TABLE OF bapi_bup_c.
DATA: lt_po_orgdata TYPE TABLE OF bapi_org_c.
DATA: lt_return TYPE TABLE OF bapiret2.
* Header Details
ls_po_header-businessprocess = 1.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = ls_po_header-businessprocess
IMPORTING
output = ls_po_header-businessprocess.
ls_po_header-process_type = 'EC'.
ls_po_header-doc_date = sy-datum.
ls_po_header-description = 'Test for BAPI_POEC_CREATE'.
ls_po_header-logsys_fi = 'Backend'.
ls_po_header-co_code = '1000'.
ls_po_header-currency = 'GBP'.
* Item Details
ls_po_items-item_guid = 2.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = ls_po_items-item_guid
IMPORTING
output = ls_po_items-item_guid.
ls_po_items-parent = ls_po_header-businessprocess.
ls_po_items-product_guid = '4678E74FFFC380AD000000000A8E035B'.
ls_po_items-product_id = '400030'.
ls_po_items-product_type = '01'.
ls_po_items-category_guid = '4627B461073F40FC000000000A8E035B'.
ls_po_items-category_id = '1.04.0500'.
ls_po_items-quantity = 10.
ls_po_items-deliv_date = sy-datum + 10.
ls_po_items-price = '25'.
APPEND ls_po_items TO lt_po_items.
* Account Assignment
ls_po_accass-guid = 3.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = ls_po_accass-guid
IMPORTING
output = ls_po_accass-guid.
ls_po_accass-parent_guid = ls_po_items-item_guid.
ls_po_accass-distr_perc = 100.
ls_po_accass-g_l_acct = '<gl acc>'.
ls_po_accass-cost_ctr = '<cost centre>'.
ls_po_accass-co_area = '<Ctrl area>'.
APPEND ls_po_accass TO lt_po_accass.
* Partner Functions
ls_po_partner-partner_fct = '00000019'.
ls_po_partner-partner = 'Vendor'.
ls_po_partner-parent_guid = ls_po_items-item_guid.
APPEND ls_po_partner TO lt_po_partner.
ls_po_partner-partner_fct = '00000016'.
ls_po_partner-partner = 'Requester'.
ls_po_partner-parent_guid = ls_po_items-item_guid.
APPEND ls_po_partner TO lt_po_partner.
ls_po_partner-partner_fct = '00000020'.
ls_po_partner-partner = 'Receipient'.
ls_po_partner-parent_guid = ls_po_items-item_guid.
APPEND ls_po_partner TO lt_po_partner.
ls_po_partner-partner_fct = '00000075'.
ls_po_partner-partner = 'Location'.
ls_po_partner-parent_guid = ls_po_items-item_guid.
APPEND ls_po_partner TO lt_po_partner.
ls_po_orgdata-proc_org_ot = 'O'.
ls_po_orgdata-proc_org_id = 'Pur Org'.
ls_po_orgdata-proc_group_ot = 'O'.
ls_po_orgdata-proc_group_id = 'Pur Group'.
ls_po_orgdata-parent_guid = ls_po_items-item_guid.
APPEND ls_po_orgdata TO lt_po_orgdata.
CALL FUNCTION 'BAPI_POEC_CREATE'
EXPORTING
i_po_header = ls_po_header
IMPORTING
e_po_header = ls_e_po_header
TABLES
i_po_items = lt_po_items
i_po_accass = lt_po_accass
i_po_partner = lt_po_partner
i_po_orgdata = lt_po_orgdata
return = lt_return.
READ TABLE lt_return INTO ls_return WITH KEY type = 'E'.
IF sy-subrc NE 0.
COMMIT WORK AND WAIT.
WRITE:/ ls_e_po_header-doc_number, ': created successfully'.
ELSE.
WRITE:/ 'The below errors occurs during PO creation.'.
LOOP AT lt_return INTO ls_return.
WRITE:/ ls_return-message.
ENDLOOP.
ENDIF.
Regards, Kathirvel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI gurus
I am getting this error while creationg PO using the bapi
Enter exactly one partner of type Supplier
First maintain the purchasing data for the vendor
Supplier 0020000000 not intended for purch. org.
Partner of type Supplier is not authorized for this document; check entry,
But when i Try to create direct PO form Web its working for same vendor.
Plz reply Regard
sharad
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.