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_CREATE

Former Member
0 Likes
891

Hi,

I'm using BAPI_PO_CREATE1 to create PO. I want to deduct the Qty in the PR(purchase requistion) by the amount for which PO is created.

Can anyone pls help to how to achive this in the BAPI BAPI_PO_CREATE1.

Pls help

Thanks

Ram

6 REPLIES 6
Read only

Former Member
0 Likes
782

HI Prabha

Can you be more clear on the requirement...

1. Do you need to create a PO w.r.t PR the same quantity as in PR???

2. Do you need to change PR after creating PO to make the quantity same as in PO???

Kind Regards

Eswar

Read only

0 Likes
782

Hi Eswat,

Tahnks for reply,

Yes i need to update PR Qty by the amount for which PO was created.

Say i need to create PO for Qty 10.

and PR has Qty 100. I need to update the PR qty to 90

Read only

0 Likes
782

Hi Prabha

That araises one more doubt, howz the PO created

1. Is it via through a Program using BAPI or some mechanism using PR

2. Is it Online w.r.t PR

In both cases, you can consider using FM: BAPI_PR_CHANGE for changing the PR.

Ofcourse the process seems to be weird to me considering below example:

Suppose the PR Initially holds 100 qty

PO is created for 80 qty

Next changed the PR qty to 20.

Now the scenario will be in PR -

<b>PR Quantity - 20(MENGE)

and Ordered Quantity - 80(BSMNG).</b>

Hope you understand what i mean...

Kind Regards

Eswar

Read only

Former Member
0 Likes
782

Hello Prabha,

What is the reason for reducing the PR by the QTY of PO. If you are worried that somebody may just create a PO more than the PR QTY then I think this will not happen. As soon as u exhaust the PR qty by creating the PO u will not be able to create new PO.

Now if you are trying to create the PO independant of PR then what I would suggest is u can use the exits available in the BAPI and validate the PR qty and accordingly raise the error.

EXIT_SAPL2012_001 (at start of BAPI)

EXIT_SAPL2012_003 (at end of BAPI)

Read only

Former Member
0 Likes
782

Hi,

U cant achieve this thru Only BAPI_PO_CREATE. What u can do is, after creating PO u can use the BAPI_PR_CHANGE to update the qty in PR

Sreedhar

Read only

Former Member
0 Likes
782

as abijit told u can achiveve in the exits...

i have already worked on this use the exit use the Exit EXIT_SAPL2012_001.. it will be triggred before the PO gets updated on the DB

Regars

Naresh Reddy..