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: 

Need a Bapi to Create a purchase order

Former Member
0 Kudos

Hi experts,

Is there a Bapi, to create a 'Purchase Order' from an existing Purchasing document no. marked for deletion.

Thanks in advance ,

Hrashit Rungta

17 REPLIES 17

Former Member
0 Kudos

Function module BAPI_PO_CREATE1 enables you to create purchase orders. The BAPI uses the technology behind the Enjoy purchase order transaction ( ME21N).

Former Member
0 Kudos

Hi Harshit,

Use BAPI_PO_CREATE1.

Please see the link for sample code [WIKI|http://wiki.sdn.sap.com/wiki/display/ABAP/FunctionModuletocreatePOusingBAPI]

Regards,

Vimal.

Former Member
0 Kudos

Use: 'BAPI_PO_CREATE1'.

Check:

Edited by: jaya rangwani on Aug 10, 2009 12:04 PM

kesavadas_thekkillath
Active Contributor
0 Kudos

Search in SCN

Former Member
0 Kudos

hi

Use this BAPI BAPI_PO_CREATE1.

Check this post, you have program aswell

https://forums.sdn.sap.com/click.jspa?searchID=7294168&messageID=1172796

Former Member
0 Kudos

Hi

go through the fallowing link

http://apolemia.blogspot.com/2005/06/create-purchase-order-with.html

Regards,

Vijay

Former Member
0 Kudos

Thankyou experts for your valuable inputs.

But my requirement is ,

I want to create a new purchase order , item which should be the copy of an existing purcase order number and item number.

So i jus want to supplt the inputs as the purchase order no. and the item number.

Is there a bapi for the same?

Thanks and regards,

Harshit Rungta

Former Member
0 Kudos

Hi ,

there are two FM to create purchase order.

BAPI_PO_CREATE

BAPI_PO_CREATE1.

i think BAPI_PO_CREATE1 is more suitable, but you need to check this.

after using fm , don't forget to use BAPI_TRANSACTION_COMMIT for commit work, to update po in database.

Regards,

Tutun

Former Member
0 Kudos

Hi,

You can use bapi

BAPI_PO_CREATE1

In this bapi u have to populate in tables POITEM u have to populate this field REF_DOC with yur purchase order that has to be copied also u can populate REF_ITEM if u want to copy specific item of the purchase order (which u have to copy.)

Hope it helps.

Regards

Hiren K.Chitalia

Former Member
0 Kudos

.

Edited by: krupa jani on Aug 11, 2009 1:11 PM

Former Member
0 Kudos

Thanks everyone for your valuable inputs.

As suggested by Hiren,

To create a Purchase order with reference to an existing purchase order,

I need to populate the fields doc_ref and doc_item of the bapi 'BAPI_PO_CREATE1'.

I have done that ..but still i need to populate some more fields to get it done.

Can someone suggest which are the fields which needs to be populated.

Also it would be great if i can get the steps to create a PO from an existing PO,

using the transaction ME21N.

I want to know what are the inputs we actually need to provide,

Thanks and regards,

Harshit Rungta

0 Kudos

Hi,

Please check this link.

http://allinsap.wordpress.com/2008/02/29/create-purchase-order-me21n/

Also check this link which gives example for REF_DOC

http://www.sapfans.com/forums/viewtopic.php?f=13&t=40035&start=0&st=0&sk=t&sd=a

http://it.dir.groups.yahoo.com/group/club_abap4/message/16035

Regards

Hiren K.Chitalia

Edited by: Hiren Chitalia on Aug 19, 2009 10:38 AM

Former Member
0 Kudos

Thanks so much for your help Hiren

I have successfully executed the bapi 'BAPI_PO_CREATE1' and i have got the EXPPURCHASEORDER no.

But it is not getting reflected in the database.

I have executed the bapi BAPI_TRANSACTION_COMMIT too.

Can you Please suggest a solution.

Thanks and Regards,

Harshit Rungta

0 Kudos

Hi,

Sure will check for the same.

Regards

Hiren K.Chitalia

Edited by: Hiren Chitalia on Aug 19, 2009 2:17 PM

Former Member
0 Kudos

Hi Experts,

I have used BAPI_PO_CREATE1 to create a purchase order .

I have successfully created a purchase order when i use this BAPI directly through SE37 ,

supplying the required inputs.

But now i am calling this BAPI inside a program,

Supplying the same inputs as earlier.

Buit i am not able to generate a PO.

I am getting the messages in the Return Table as :|Please enter items first

No instance of object type PurchaseOrder has been created. External referen

Document contains no items

Can someone suggest What input am i missing ?

Thanks in advance,

Harshit Rungta

Former Member
0 Kudos

Hi Experts,

i am able to create a purchase order now using BAPI_PO_CREATE1 using a REF_DOC in the table poitem.

Here i am taking the details of the Refereed Po using the bapi 'BAPI_PO_GETDETAIL' and then passing on the data to the bapi

BAPI_PO_CREATE1 to create a new PO.

But for some of the PO i am getting the error as 'Quantity conversion error in net price calculation'.

Any suggestions?

Thanks in advance

Harshit Rungta