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

PO Creation using BAPI_PO_CREATE

Former Member
0 Likes
606

Hello friends ,

I have a weird thing going on . I used BAPI_PO_CREATE .

When I look a the return table it displays message . Standard PO created .

I then using BAPI_TRANSACTION_COMMIT to commit it to the database .

After running the above Z program .

When I go and alook for that po number in me23 or me23n or in table EKPO it says no document found .

But if i check it after 2 - 3 minutes it shows the records in the database .

Is this usual to not be able to see the document saveed immediately after its creation ?

When I create a PO manually using me21 it save immediately .

Please advise .

Thanks,

Teresa

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
566

Are you passing the wait parameter to the commit function?

3 REPLIES 3
Read only

Former Member
0 Likes
567

Are you passing the wait parameter to the commit function?

Read only

0 Likes
566

Yes . I am passing the wait parameter . One more thing the BASIS Team applied some oracle patches recently .

Here is a snap shot of my code .

CALL FUNCTION 'BAPI_PO_CREATE'

EXPORTING

PO_HEADER = LS_PO_HEADER

PO_HEADER_ADD_DATA = LS_PO_HEADER_ADD

IMPORTING

PURCHASEORDER = L_PURCHASEORDER

TABLES

PO_ITEMS = LT_PO_ITEMS

PO_ITEM_ADD_DATA = LT_PO_ITEMS_ADD

PO_ITEM_SCHEDULES = LT_PO_ITEMS_SCHED

RETURN = LT_RETURN.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = 'X'.

Thnx

Read only

0 Likes
566

Hello Teresa,

as far as I remember, you don't have to use the "BAPI_TRANSACTION_COMMIT" after using the "BAPI_PO_CREATE", as the "BAPI_PO_CREATE" performs the "Commit", when no errors occur (there's also an OSS note about this, as it's not "BAPI-Standard").

I would try w/o using "BAPI_TRANSACTION_COMMIT".

Best regards

Stephan