Application Development 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: 

BAPI_PO_CREATE1

Former Member
0 Kudos
454

I want to use BAPI_PO_CREATE1 for doc_type NBAR but i didn't succeed getting the right fields from the contract. It has to act like CREATE PURCHASE ORDER with REFERENCE TO CONTRACT. Help me!

1 ACCEPTED SOLUTION

Former Member
0 Kudos
71

In the BAPI the POHEADER and the POHEADERX have to be filled giving appropriate values for COMP_CODE, DOC_TYPE, PURCH_ORG, PUR_GROUP, CURRENCY, DOC_DATE, SUPPL_PLNT..

If any number of items are created then the POITEM and POITEMX data has to be given.

Since it is a contract the schedule data of the items should also be given i.e. the POSCHEDULE and the POSCHEDULEX data in which the PO_ITEM and the DELIVERY_DATE have to be given. And the POACCOUNT and POACCOUNTX have to be filled in with the respective values.

Whatever fields are filled in POHEADER, correspondingly the fields in POHEADERX take the value 'X'.

In POITEM table if there are 4 items then the POITEMX also has 4 items with PO_ITEM taking the same value in both the tables and the rest of the fields depending on the requirement in POITEM and 'X' in POITEMX.

In POACCOUNT and POACCOUNTX the serial no. should be the sequential number of account assignment.

The PO_ITEM field in all the item tables i.e. POITEM,POITEMX,POSCHEDULE,POSCHEDULEX,POACCOUNT,POACCOUNTXis generated programatically.

4 REPLIES 4

Former Member
0 Kudos
71

Addition:

To create a purchase order with REFERENCE TO CONTRACT with order_type NB (Standard PO) gives us also some problems. When you create a PO with ME21 you only have to fill the order_type and PO date. After that fill the agreement and agr.item and you can start creating...

What fields do i need with the BAPI ?

Former Member
0 Kudos
72

In the BAPI the POHEADER and the POHEADERX have to be filled giving appropriate values for COMP_CODE, DOC_TYPE, PURCH_ORG, PUR_GROUP, CURRENCY, DOC_DATE, SUPPL_PLNT..

If any number of items are created then the POITEM and POITEMX data has to be given.

Since it is a contract the schedule data of the items should also be given i.e. the POSCHEDULE and the POSCHEDULEX data in which the PO_ITEM and the DELIVERY_DATE have to be given. And the POACCOUNT and POACCOUNTX have to be filled in with the respective values.

Whatever fields are filled in POHEADER, correspondingly the fields in POHEADERX take the value 'X'.

In POITEM table if there are 4 items then the POITEMX also has 4 items with PO_ITEM taking the same value in both the tables and the rest of the fields depending on the requirement in POITEM and 'X' in POITEMX.

In POACCOUNT and POACCOUNTX the serial no. should be the sequential number of account assignment.

The PO_ITEM field in all the item tables i.e. POITEM,POITEMX,POSCHEDULE,POSCHEDULEX,POACCOUNT,POACCOUNTXis generated programatically.

Former Member
0 Kudos
71

Thanks Radhika,

I used most off the structures but i didn't use POACCOUNT(X). This may be the problem.

Former Member
0 Kudos
71

<b>Problem solved !</b>