A purchase requisition is an internal document used in an organization to request the procurement of goods or services. In SAP, efficient management of purchase requisitions is crucial for smooth procurement operations. This blog will provide a clear guide on releasing PR documents from HOLD or PARK status using BAPIs and releasing the document for further processing.
First, let's understand the PARK and HOLD options in SAP. These functionalities are essential for managing purchasing documents, allowing users to save them temporarily for later processing.
Hold: If the document has incorrect or incomplete data and you want to save it temporarily to process later, use the Hold option.
Park: If the document has complete and correct data but needs further workflow approvals or budget checks, use the Park functionality.
To activate the PARK and HOLD options in transactions ME51N, ME52N, and ME53N, follow these two steps:
2. Enable PARK and HOLD Features In T-Code SPRO, follow this path:
Materials Management --> Purchasing --> Environment Data --> Activate 'Park and Hold' in Purchasing Documents.
By completing these steps, you will enable the PARK and HOLD functionalities for purchasing documents in your SAP system.
To change the status of a purchase requisition document from HOLD or PARKED to SAVED, you can use the BAPI “BAPI_PR_CHANGE.”.
Below is an example of how to implement this in ABAP:
DATA: ls_prheader TYPE bapimereqheader,
ls_prheaderx TYPE bapimereqheaderx,
lt_return TYPE TABLE OF bapiret2.
IF ls_prheader-preq_no IS NOT INITIAL.
ls_prheader = VALUE #( preq_no = |{ ls_prheader-preq_no ALPHA = IN }|
park_complete = abap_false
hold_complete = abap_false
memorytype = abap_false ).
ls_prheaderx = VALUE #( preq_no = abap_true
park_complete = abap_true
hold_complete = abap_true
memorytype = abap_true ).
CALL FUNCTION 'BAPI_PR_CHANGE'
EXPORTING
number = ls_prheader-preq_no “Your PR Number
prheader = ls_prheader
prheaderx = ls_prheaderx
TABLES
return = lt_return.
IF VALUE #( lt_return[ type = 'S' ] OPTIONAL ) IS NOT INITIAL.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = abap_true.
ELSE.
ROLLBACK WORK.
ENDIF.
ENDIF.
The release strategy in SAP defines the approval process for purchase requisitions:
A release code is a two-character ID that authorizes a person to approve or release a purchase requisition or external purchasing document.
To release a PR that needs approval from respective employees/approvers in your organization, you can use the BAPI - “BAPI_REQUISITION_RELEASE_GEN”.
Below is an example implementation:
DATA : lt_return TYPE TABLE OF bapireturn.
CALL FUNCTION 'BAPI_REQUISITION_RELEASE_GEN'
EXPORTING
number = iv_pr_num “Your PR Number
rel_code = iv_release_code “Release code
TABLES
return = lt_return.
IF VALUE #( lt_return[ type = 'S' ] OPTIONAL ) IS NOT INITIAL OR
lt_return IS INITIAL.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = abap_true.
ELSE.
ROLLBACK WORK.
ENDIF.
You can find release codes under the Release Strategy tab in transactions ME51N, ME52N, and ME53N.
The following tables are useful for retrieving relevant information:
This blog emphasized the significance of parked and hold documents, the activation of essential functionalities, and the use of BAPIs to change PR statuses. We also explored the release procedure and strategy, illustrating how structured approvals can enhance efficiency in your procurement processes.
Thank you for reading!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
4 | |
2 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |