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,177

Hi!!

I have a problem when creating a purchase order from bapi_po_create1 because commitment is not created. I mean, a purchase order is generated but when I enter CJI5 to check commitment, It was not updated. If a create a purchase order from ME21N, commitment is created on CJI5 and I need the same behaviour with the bapi...Any orientation about what is happening?

Please, if anybody can help I'd be grateful!

8 REPLIES 8
Read only

Former Member
0 Likes
1,020

Hi

Are you using the COMMIT WORK after the BAPI bapi_po_create1 ??

If not please try by using BAPI_TRANSACTION_COMMIT after the first bapi call.

Regards

HM

Read only

0 Likes
1,020

Yes, I've used commit after bapi but doesn't work

Read only

0 Likes
1,020

Hi,

Hope you are not passing TESTRUN = 'X',it should be SPACE.

WIth BAPI_TRANSCTION_COMMIT it should work.

Regards,

Ankit.

Read only

0 Likes
1,020

The Bapi creates the PO ok (except for de Commitment document), the problem is not commit or test option.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,020

Look at your created PO via ME23n, is the G/L account filled ?

Regards,

Raymond

Read only

0 Likes
1,020

Hi!

G/L Account is filled ok. The unique difference between a po created through ME21N and other created by BAPI is that AC Commitment Documents is not created with Bapi (with ME21N is created). I'm wondering if it'd be a customizing aim...

Read only

Former Member
0 Likes
1,020

see the following Example:


CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
poheader = header
poheaderx = headerx
IMPORTING
exppurchaseorder = p_pono
TABLES
return = return
poitem = it_item
poitemx = it_itemx.



 CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
           EXPORTING
                WAIT   = 'X'
           IMPORTING
                RETURN = BAPIRETURN.


write:/ p_pono.

Read only

0 Likes
1,020

The BAPI CALL and BAPI_TRANSACTION_COMMIT are both defined.That's not the problem. The purchase order is created and I can display it trhough ME23N, the problem comes when I go to Menu Environment/AC commitment document and Nothing appears when select. The commitment document is missing. Otherwise, creating a purchase order from ME21N I get that AC commitment document.

any idea?