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

STO using BAPI_PO_CREATE1

Former Member
0 Likes
2,378

Hi All,

I want to create a STO using BAPI_PO_CREATE1.

I use document type UB and also enter the issuing plant.

I get the following error.

1.No instance of object type PurchaseOrder has been created. External reference: ( E BAPI 001)

2.Purchase order item 00010 still contains faulty schedule lines ( E MEPO 001 )

3.Source not included in list despite source list requirement ( E 06 722)

CODE :

Header :

  it_header-comp_code = zhhio_1570-bukrs.

  it_header-doc_type = 'UB'.

  it_header-suppl_plnt = zhhio_1570-reswk.

  it_header-purch_org = zhhio_1570-ekorg.

  it_header-pur_group = zhhio_1570-ekgrp.

  it_header-creat_date = sy-datum.

  it_header-langu = sy-langu.


  lv_header-comp_code = c_x.

  lv_header-doc_type = c_x.

  lv_header-suppl_plnt = c_x.

  lv_header-purch_org = c_x.

  lv_header-pur_group = c_x.

  lv_header-creat_date = c_x.

  lv_header-langu = c_x.

ITEM :

LOOP AT it_po_create INTO wa_po_create.

    lv_item_no = lv_item_no + 10.

    wa_item_po-po_item = lv_item_no.

    wa_item_po-material = wa_po_create-matnr.

    wa_item_po-plant = zhhio_1570-werks.

    wa_item_po-stge_loc = zhhio_1570-lgort.

    wa_item_po-quantity = wa_po_create-scqty.

    wa_item_po-po_unit = wa_po_create-scuom.


    APPEND wa_item_po TO it_item_po.



    CLEAR : wa_po_create,wa_item_po.



    wa_item_x-po_item = lv_item_no.

    wa_item_x-po_itemx = c_x.

    wa_item_x-material = c_x.

    wa_item_x-plant = c_x.

    wa_item_x-stge_loc = c_x.

    wa_item_x-quantity = c_x.

    wa_item_x-po_unit = c_x.


    APPEND wa_item_x TO it_item_x.



    CLEAR : wa_item_x,wa_item_po,wa_ekpo.



    wa_sched-po_item = lv_item_no.

    wa_sched-sched_line = lv_item_no.

    wa_sched-del_datcat_ext = 'D'.

    wa_sched-delivery_date = '06.11.2012'.

    wa_sched-quantity = wa_po_create-scqty.



    APPEND wa_sched to it_sched.

    clear : wa_sched.





    wa_sched_x-po_item = lv_item_no.

    wa_sched_x-sched_line = lv_item_no.

    wa_sched_x-po_itemx = c_x.

    wa_sched_x-sched_linex = c_x.

    wa_sched_x-del_datcat_ext = c_x.

    wa_sched_x-delivery_date = c_x.

    wa_sched_x-quantity = c_x.



    APPEND wa_sched_x to it_sched_x.

    CLEAR wa_sched_x.



  ENDLOOP.

2 REPLIES 2
Read only

andrewdiaz2000
Active Participant
0 Likes
1,518

Hi Subha Shree,

to optimize the business flow there are some condiations for creating purchase order. so sit with your functunal consultant . discuss the error since its a functional accept and they would help you.

Regards,

Andrew

Read only

Former Member
0 Likes
1,518

This looks like a data issue.

Please check Tcode ME01 and check if source list is maintained for the Vendor, Material and the Plant.

You would need to enter the source list or uncheck the source list indicator in MM02.

Jurgen explains the same here.

http://scn.sap.com/thread/1485100

Cheers,

Shambu