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: 

Questions about BAPI_PR_CREATE and BAPI_PR_CHANGE

mh97
Contributor
0 Kudos

Good afternoon SAP experts,

I have been working with purchase requisition BAPIs and encountered some questions:

1) I can create a requisition with service items using the "old" bapi, BAPI_REQUISITION_CREATE; but I cannot see how to do that with the "new" bapi, BAPI_PR_CREATE.

Is it possible to create the service items on a requisition with BAPI_PR_CREATE?

If so how should I set up the data?

2) I want to add header text to an existing requisition.

I tried to use BAPI_PR_CHANGE but cannot get the changes to save, even though the return is

 
S 06                    403 Purchase requisition 1000004492 changed   
S BAPI                  002 Instance 1000004492 of object type PurchaseRequisition has been changed.  

I also tried changing an item quantity, and had the same result (success message but requisition was not really changed).

I have "Test Run" empty!

Can anyone provide some clues as to what I might be doing wrong with this bapi?

For BAPI_PR_CHANGE, do I need to load all of the existing data of the requisition into the tables, or just have data in the fields that are being changed?

Thanks for any assistance you can provide on these questions!

Margaret

Edited by: Margaret Hilsbos on Sep 26, 2008 4:12 PM - to (hopefully) fix the margin breakage.

Edited by: Margaret Hilsbos on Sep 26, 2008 4:14 PM

1 REPLY 1

mh97
Contributor
0 Kudos

I have found the answer to question #2 in this wiki:

https://www.sdn.sap.com/irj/sdn/wiki?path=/display/abap/function%2bmodule%2btest%2bsequence

The gist is to set up a test sequence in SE37 (Function Module->Test->Test Sequences ) with the two bapi's, e.g.

1. BAPI_PR_CHANGE (To change purchase requisition)

2. BAPI_TRANSACTION_COMMIT (To Commit Work)

Then you must also pay attention that the input structures are populated correctly.

For question #1 I am convinced there is no ability in BAPI_PR_CREATE to create service items, so it looks like I have to call the old bapi for that case.