Enterprise Resource Planning Blog Posts by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
rohithkumar15
Explorer
1,639

Introduction:

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.

 

Understanding Parked and Hold Documents in SAP:

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.

 

Activating Hold and Park options:

To activate the PARK and HOLD options in transactions ME51N, ME52N, and ME53N, follow these two steps:

  1. Activate Business Functionality
    • Go to T-Code SPRO.
    • Click on Activate Business FunctionsActivate Business Functionality.jpg

       

    • Expand the folder Enterprise_Business_Functions and activate the functionality LOG_MM_CI_3.Park & Hold - Business Functionality .jpg

       

     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. 

Activate Park & Hold option in Purchasing Documents.jpg

 By completing these steps, you will enable the PARK and HOLD functionalities for purchasing documents in your SAP system.

 

Changing PR document status from HOLD or PARKED to SAVED using BAPI:

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.

 

 

 

 

Release Strategy:

The release strategy in SAP defines the approval process for purchase requisitions:

  • Purpose: Ensures PRs are reviewed and approved before conversion to purchase orders.
  • Release Codes: Each strategy can have up to eight release codes, indicating who must approve the requisition.
  • Approval Sequence: Specifies the order in which approvals must be obtained.
  • Assignment: Release strategies are assigned based on release conditions like document type and value.

 

Release Code:

A release code is a two-character ID that authorizes a person to approve or release a purchase requisition or external purchasing document.

  • Purpose: It serves as an electronic signature, replacing traditional handwritten approvals. This digitization streamlines the approval process and enhances efficiency.
  • Assignment: Release codes are assigned to employees based on their roles and authorization levels within the organization. For example, a clerk might have a release code for initial approvals, while a manager has a higher-level code.
  • Configuration:
      • You can define up to eight release codes within a release strategy.
      • Each code is linked to specific approval levels, ensuring that the correct personnel review PRs based on their value or other criteria.
  • Approval Process: The release strategy specifies which release codes must be used and the sequence of approvals required.

 

Releasing PR documents using BAPI:

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.

 

 

 

 

Finding Release Codes:

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:

  • EBAN: To get the release group and release strategy for the PR number.
  • T16FS: To get release codes for a particular release group & strategy.
  • T16FW: To get approver names/IDs for a release code.

 

Conclusion:

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!