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

Store a purchase requisition programmatically

Former Member
0 Likes
1,125

Hello,

We have a requierement that provides to store a purchase requisition programmatically, ie, without using any transaction.
It's to launch via an external application.

The solution that we thought about is to insert into EBAN table via a webservice using Java for example.

The problem is that we don't know the origin of each column value. (eg. is banfn incremental? Does it have a specific form?).

For example: Assuming the existance of a purchase requistion having the following infomation below:

  1. Client : 300
  2. materiel number : 0123456
  3. base unit : UN
  4. Plant : 09876
  5. date of delivery : 28/01/2021
1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,023

To create a purchase requisition from an external application, I called the function module BAPI_REQUISTION_CREATE using the interface RFC (Remote Function Call).
I use Java language, so the library that I used is JCo.
Best regards.

4 REPLIES 4
Read only

maheshpalavalli
Active Contributor
1,023

You should never insert data into standard table directly, because it will have dependencies to other tables and so much business logic, validations are doing before creating a purchase requisition.

The only choice you have is to use BAPI

https://answers.sap.com/questions/3931804/how-to-create-pr-using-bapiprcreate.html

Ps: update ur tag to abap, this question is not related to abap restful programming model

Read only

0 Likes
1,023

Thank you very much for yor answer.
Is it possible to use an out of the box API (Restful or SOAP)?

Read only

1,023

Malek Guenichi Current best practice is to create an odata service for it. I doubt if any out of box solution is available for it. Try this, it's a 2006 blog, not sure if it is even possible now:

https://blogs.sap.com/2006/09/12/creating-and-exposing-bapi-as-web-service-and-using-it-in-web-dynpr...

Read only

Former Member
0 Likes
1,024

To create a purchase requisition from an external application, I called the function module BAPI_REQUISTION_CREATE using the interface RFC (Remote Function Call).
I use Java language, so the library that I used is JCo.
Best regards.