Creating Purchase Requisition by Functional module. Stock transfer requisition. Functional module, BAPI. BAPI_REQUISITION_CREATE.
Example of part of SAP program.
Hello, consider the creation of requisitions through the function module. To do this, it is
necessary to start transaction SE37 and next to fill the name of relevant FM
BAPI_REQUISITION_CREATE, which applies to create Purchase requisitions, or stock transfer
requisitions in this case. Click the Execute button. Next, you need to fill in the fields in some
tables. In this case, this is REQUISITION_ITEMS. In this example, the requisition will have two
items. Test data will be like that.
Field Names - Descriptions - Examples of values (Item1 - item2)
DOC_TYPE - Requisition type - ZUB - ZUB
PUR_GROUP - Purchasing group - 900 - 900
PREQ_DATE - Requisition date - 28.04.2019 - 28.04.2019
MATERIAL - Material - 1026552 - 106530747
PLANT - Receiving plant (Distribution center) - 1020 - 1020
STORE_LOC - Receiving storage loc (at Dist. Cent.) - 0005 - 0005
SUPPL_PLNT - Supplying plant - 2059 - 2059
QUANTITY - Quantity in item - 10 - 20
DELIV_DATE - Delivery date - 01.05.2019 - 01.05.2019
ITEM_CAT - Item category - 7 - 7
PURCH_ORG - Purchasing organization - 1000 - 1000
Now we will fill in these fields with this data. For convenience, you can click the button “Single Entry” (Shift + F7). In this case, the fields will be arranged vertically and so they are more
convenient to see.
So this is the DOC_TYPE, the Purchasing Group, the purchasing date, PREQ_DATE, the materials
will be in different items. Now fill the value for the first item. This case will be as stock transfer
requisition. In this reason there are two plants: the receiving PLANT = 1020 and a supplying
plant SUPPL_PLNT = 2059. The quantity for first item will be 10. Delivery date DELIV_DATE will
be fifth may of 2019
The item category will be 'Stock transfer', that is, code 7, this is the same as type U in the
interface. Purchasing organization PURCH_ORG = 1000
So we filled the line for one item and closed the window by the green button. Since the second
item of the creating requisition will be very similar, it is more convenient to create it with the
“Double line” button. In this case, the system creates the exact same line. The second item is
different in material and quantity. Therefore, we replace these values directly in this interface,
where all lines are presented. After that we will leave by a green arrow.
You can save this option so that if we forget something or fill it up incorrectly, you would not
have to fill the entire interface completely first. Click Safe button to create a new line in the
"Test data directory' Let name it PR_CREATE_001
Use the Execute button (F8 ) to start the execution of the function module with the entered
parameters and see the result. As the result, you can see the export parameter NUMBER with
number of created requisition. In addition, in the table RETURN you can see detailed text:
Purchase requisition with some number was created. We can see created PR in the relevant transaction ME53N. These very two items that were in FM, they appeared in the created requisition. Here are the same materials, quantity, plants and dates.