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_PO_CREATE1

Former Member
0 Likes
1,057

I'm using BAPI_PO_CREATE1 for making P.O. in my program .

it is showing that standard po created under no. 450067456

but when i check ekko for the same it is not getting created there.

lemme tell u that i have used transaction commit FM also.

plz guide what to do?

10 REPLIES 10
Read only

Former Member
0 Likes
1,026

Hi

In BAPI_TRANSACTION_COMMIT, you will have to pass 'X' to the wait parameter as follows:


    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      EXPORTING
        wait = 'X'.

Thanks

Vijay

<REMOVED BY MODERATOR>

Edited by: Alvaro Tejada Galindo on Feb 25, 2008 5:37 PM

Read only

0 Likes
1,026

i have done that too but not working

Read only

Former Member
0 Likes
1,026

Hi

Do not check in EKKO immediately after execution. Wait for bout 2 mts as lot of tables has to be updated. If this still does not work, try creating the PO manually using ME21N. If this gives an error, then there must be some problem.

Thanks

Vijay

<REMOVED BY MODERATOR>

Edited by: Alvaro Tejada Galindo on Feb 25, 2008 5:38 PM

Read only

0 Likes
1,026

but return table is showing no errors how come this is possible.

and i have waited long more then 2 minutes for that po to be created

Read only

0 Likes
1,026

Can u show the code u have written (BAPI call) to create the PO?

Read only

0 Likes
1,026

here is ma peice of code

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

INPUT = d_lifnr

IMPORTING

OUTPUT = wa_po_header-VENDOR .

PERFORM ZF_VENDOR_DETAIL CHANGING WA_VENDOR.

wa_po_vendor-NAME = WA_VENDOR-NAME.

wa_po_vendor-NAME_2 = WA_VENDOR-NAME_2.

wa_po_vendor-CITY = WA_VENDOR-CITY.

wa_po_vendor-POSTL_COD1 = WA_VENDOR-POSTL_CODE.

wa_po_vendor-POSTL_COD2 = WA_VENDOR-POBX_PCD.

wa_po_vendor-PO_BOX = WA_VENDOR-PO_BOX.

wa_po_vendor-REGION = WA_VENDOR-REGION.

wa_po_vendor-COUNTRY = WA_VENDOR-COUNTRY.

wa_po_header-comp_code = d_bukrs.

wa_po_header-doc_type = d_Bsart.

wa_po_header-pur_group = D_EKGRP.

wa_po_header-PURCH_ORG = D_EKORG.

wa_po_header-CURRENCY = D_WAERS.

wa_po_header-creat_date = SY-DATUM.

wa_po_header-created_by = SY-UNAME.

wa_po_header-DOC_DATE = SY-DATUM.

wa_po_header-LANGU_ISO = 'EN'.

wa_po_headerX-comp_code = 'X'.

wa_po_headerX-doc_type = 'X'.

wa_po_headerX-VENDOR = 'X'.

wa_po_headerX-CURRENCY = 'X'.

wa_po_headerX-PURCH_ORG = 'X'.

wa_po_headerX-pur_group = 'X'.

wa_po_headerX-creat_date = 'X'.

wa_po_headerX-created_by = 'X'.

wa_po_headerX-DOC_DATE = 'X'.

wa_po_headerX-LANGU_ISO = 'X'.

CLEAR D_BUKRS.

CLEAR D_BSART.

CLEAR D_lifnr.

CLEAR D_EKGRP.

CLEAR D_EKORG.

CLEAR D_WAERS.

call function 'BAPI_PO_CREATE1'

exporting

poheader = wa_po_header

poheaderx = wa_po_headerX

POADDRVENDOR = wa_po_vendor

  • TESTRUN =

  • MEMORY_UNCOMPLETE =

  • MEMORY_COMPLETE =

  • POEXPIMPHEADER =

  • POEXPIMPHEADERX =

  • VERSIONS =

  • NO_MESSAGING =

  • NO_MESSAGE_REQ =

  • NO_AUTHORITY =

  • NO_PRICE_FROM_PO =

IMPORTING

EXPPURCHASEORDER = wa_ebeln

EXPHEADER = wa_poheader

  • EXPPOEXPIMPHEADER =

tables

return = it_return

poitem = IT_PO_ITEM

poitemx = IT_PO_ITEMX

POADDRDELIVERY = IT_PO_ADDR.

  • 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.

&----


*Confirm the document creation by calling database COMMIT

&----


call function 'BAPI_TRANSACTION_COMMIT'.

exporting

wait = 'X'.

    • IMPORTING

    • RETURN =

CLEAR WA_PO_HEADERX.

CLEAR WA_VENDOR.

refresh it_return.

REFRESH IT_PO_ITEMX.

MESSAGE I011.

ENDIF.

CALL SCREEN 1001.

ENDCASE.

plz help if u could

Read only

0 Likes
1,026

Hi Vivek,

I guess you have not populated the tables IT_PO_ITEM

and IT_PO_ITEMX, which you have passed in the BAPI.

Thanks

Vijay

Read only

0 Likes
1,026

my friend if i would not have done that then it_return will give error message.

i have p[assed them in correct manner thats why there are no error in it_return

Read only

Former Member
0 Likes
1,026

Hai ,

In BAPI_TRANSACTION_COMMIT, you will have to pass 'X' to the wait parameter as follows:

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = 'X'.

Read only

Former Member
0 Likes
1,026

thanx for your suggestions