In the Extended Classic Scenario of the SAP Supplier Relation Management module, we know that the Purchase Orders are created in the SRM system and is then replicated or copied back to the ECC system. In other words, in an extended classic scenario, the procurement process takes place in the SAP SRM system. The purchase order is created in the SAP SRM system and a read-only copy of the purchase order is replicated to the backend system.
Now suppose that the client’s SRM consultants want to have a custom program to update the Purchase Order(s) in the SAP SRM system in MASS, where one would pass the excel file as input to the program with the details like PO Number, line item number and the columns/fields which they intend to change through the program.
This program will then try to update the Purchase Order in the SAP SRM system, and then the changes shall be reflected back in the SAP ECC system as these systems are fully integrated with each other.
Now here we will discuss the flow of the program or in other words, I will share the sequence of standard function module calls to achieve the requirement.
GET DETAIL: At first, we shall try to get the details of the purchase order we intend to modify or update. The same can be retrieved by the use of the standard Function Module “BBP_PD_PO_GETDETAIL“.
With the use of this FM, we will get the details like HEADER, ITEM, ACCOUNT, PARTNER, STATUS information of the purchase order.
MODIFY DATA: Now suppose (just as an example, make sure you know what you are doing and what impact it will have substantially), you intend to modify the Cost Center, Fund Center, or WBS Element of a line item of the purchase order(these details can be found in the Accounting details for each line item of the purchase order), so you update the Cost Center, Fund Center or WBS Element of a line item of the purchase order in the Accounting details internal table.
Then, we wish to update the Purchase Order, after implementing all the checks and validations in your program.
You can check the basic errors in the purchase order using the FM: “BBP_PD_PO_CHECK“
Accounting INFO Check: Now, in between, if you would like to make a check, if there is enough budget available to complete the change, then you can use the FM: “B700_ACC_PURCHASE_ORDER_CHECK” before you update the information.
UPDATE PO: Now, we can try to update the modified information using the FM: “BBP_PD_PO_UPDATE”
If you think this is enough, to update the PO in SRM, then you are mistaken 🙂
This FM just acts like an EDIT Button on the screen.
Till now, you have just pressed the EDIT button and made the changes, generating a new Change Version. Next, we will save the Change Version of the Purchase Order.
SAVE the PO: Now, we will save the changes using the FM: “BBP_PD_PO_SAVE”
ORDER the PO: Now, we will order the changes using the FM: “BBP_PD_PO_STATUS_CHANGE”
RELEASE the PO: Ideally, whenever we make a change to the PO in the SAP SRM system, one workflow gets triggered. The work item reaches the inbox of the concerned stakeholder or approver for approval. But, in this case, we would require an automatic approval process, provided the user executing the program has the required authorization.The FM which is used here is “BBP_PD_PO_STATUS_CHANGE_WF” as follows:
COMMIT and RESET: If everything goes well and you did not receive any error, then you can COMMIT the WORK and reset the buffer using the FMs “BAPI_TRANSACTION_COMMIT” and “BBP_PD_PO_RESET_BUFFER” respectively.
Some settings are configured in ECC, therefore in case you pass wrong values, you will be in a dilemma when the values will not get updated in ECC.
For example, if Funds Management is applied in the ECC system, then there is a possibility that the Fund Center will be getting derived either of the below combinations:
1. Cost Center to Fund Center derivation. OR
2. GL Account to Commitment Line item to Fund Center derivation.