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

BAPI errors in Purchase Order

Former Member
0 Likes
570

i'm getting following errors plz help to eradicate then

|No instance of object type PurchaseOrder <

PO header data still faulty <

Document number 1000222 not within define<

Please only use plants with local currenc<

|Can delivery date be met?

my peice of code is


loop at it_final into wa_final.

IT_PO_ITEM-PO_ITEM    = WA_FINAL-POSNR.
IT_PO_ITEM-MATERIAL   = WA_FINAL-idnrk.
IT_PO_ITEM-PLANT      = WA_FINAL-WERKS.
IT_PO_ITEM-QUANTITY   = WA_FINAL-menge.
IT_PO_ITEM-stge_loc   = WA_FINAL-LGORT.
IT_PO_ITEM-PO_UNIT    = WA_FINAL-meINS.
IT_PO_ITEM-NET_PRICE  = WA_FINAL-PREIS * IT_PO_ITEM-QUANTITY.
IT_PO_ITEM-PRICE_UNIT = WA_FINAL-PEINH.

APPEND IT_PO_ITEM.

IT_PO_ITEMX-PO_ITEM    = WA_FINAL-POSNR.
IT_PO_ITEMX-MATERIAL   = 'X'.
IT_PO_ITEMX-PLANT      = 'X'.
IT_PO_ITEMX-QUANTITY   = 'X'.
IT_PO_ITEM-stge_loc    = 'X'.
IT_PO_ITEMX-PO_UNIT    = 'X'.
IT_PO_ITEMX-NET_PRICE  = 'X'.
IT_PO_ITEMX-PRICE_UNIT = 'X'.


APPEND IT_PO_ITEMX.


endloop.

    wa_po_header-po_number  = d_ebeln.
      wa_po_header-comp_code  = d_bukrs.
      wa_po_header-doc_type   = d_esart.
      wa_po_header-VENDOR     = d_lifnr.
      wa_po_header-pur_group  = '001'.
      wa_po_header-creat_date = SY-DATUM.
      wa_po_header-created_by = 'VIVEK'.

      wa_po_headerX-po_number  = 'X'.
      wa_po_headerX-comp_code  = 'X'.
      wa_po_headerX-doc_type   = 'X'.
      wa_po_headerX-VENDOR     = 'X'.
      wa_po_header-pur_group   = 'X'.
      wa_po_header-creat_date  = 'X'.
      wa_po_header-created_by  = 'X'.
      CLEAR D_BUKRS.
      CLEAR D_ESART.
      CLEAR D_EBELN.
      CLEAR D_lifnr.

call function 'BAPI_PO_CREATE1'
  exporting
    poheader                     = wa_po_header
    poheaderx                    = wa_po_headerX
*   POADDRVENDOR                 =
*   TESTRUN                      =
*   MEMORY_UNCOMPLETE            =
*   MEMORY_COMPLETE              =
*   POEXPIMPHEADER               =
*   POEXPIMPHEADERX              =
*   VERSIONS                     =
*   NO_MESSAGING                 =
*   NO_MESSAGE_REQ               =
*   NO_AUTHORITY                 =
*   NO_PRICE_FROM_PO             =
 IMPORTING
   EXPPURCHASEORDER             =   wa_ebeln
*   EXPHEADER                    =
*   EXPPOEXPIMPHEADER            =
 tables
   return                       =  it_return
   poitem                       =  IT_PO_ITEM
   poitemx                      =  IT_PO_ITEMX.
*   POADDRDELIVERY               =
*   POSCHEDULE                   =
*   POSCHEDULEX                  =
*   POACCOUNT                    =
*   POACCOUNTPROFITSEGMENT       =
*   POACCOUNTX                   =
*   POCONDHEADER                 =
*   POCONDHEADERX                =
*   POCOND                       =
*   POCONDX                      =
*   POLIMITS                     =
*   POCONTRACTLIMITS             =
*   POSERVICES                   =
*   POSRVACCESSVALUES            =
*   POSERVICESTEXT               =
*   EXTENSIONIN                  =
*   EXTENSIONOUT                 =
*   POEXPIMPITEM                 =
*   POEXPIMPITEMX                =
*   POTEXTHEADER                 =
*   POTEXTITEM                   =
*   ALLVERSIONS                  =
*   POPARTNER                    =

 if sy-subrc          = 0.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
MESSAGE I001 WITH 'Purchase Order ' wa_ebeln ' Created'.
 ENDIF.
  CALL SCREEN 1001.
  ENDCASE.

plz help if u can can.

<REMOVED BY MODERATOR>

Edited by: Alvaro Tejada Galindo on Feb 19, 2008 12:29 PM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
535

Hi Vivek,

Looks like BAPI requires some more fields to be populated. All the mandatory parameters do not have data.

Y dont you do a test to the BAPI in SE37 by giving some sample data and execute it. When it's processed with out any error then you can consider that all those parameters you populated in SE37 should be populated in your program too.

That way you wont any errors.

Plz get back for any further clarification.

I hope it helps.

thanks.

2 REPLIES 2
Read only

Former Member
0 Likes
536

Hi Vivek,

Looks like BAPI requires some more fields to be populated. All the mandatory parameters do not have data.

Y dont you do a test to the BAPI in SE37 by giving some sample data and execute it. When it's processed with out any error then you can consider that all those parameters you populated in SE37 should be populated in your program too.

That way you wont any errors.

Plz get back for any further clarification.

I hope it helps.

thanks.

Read only

Former Member
0 Likes
535

resolved