SAP BAPI_PO_RELEASE Function Module for Release Purchase Orders









BAPI_PO_RELEASE is a standard bapi po release SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Release Purchase Orders processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.


See here to view full function module documentation and code listing for bapi po release FM, simply by entering the name BAPI_PO_RELEASE into the relevant SAP transaction such as SE37 or SE38.

Function Group: MEWF
Program Name: SAPLMEWF
Main Program: SAPLMEWF
Appliation area: M
Release date: 31-Oct-1997
Mode(Normal, Remote etc): Remote-Enabled
Update:



Function BAPI_PO_RELEASE pattern details

In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.
CALL FUNCTION 'BAPI_PO_RELEASE'"Release Purchase Orders
EXPORTING
PURCHASEORDER = "Purchase Order Number
PO_REL_CODE = "Release Code
* USE_EXCEPTIONS = 'X' "Set Exceptions and Issue Error Messages
* NO_COMMIT = ' ' "Commit Work Yes/No

IMPORTING
REL_STATUS_NEW = "New Release Status
REL_INDICATOR_NEW = "New Release Indicator
RET_CODE = "Return Value, Return Value After ABAP Statements

TABLES
* RETURN = "Return Messages

EXCEPTIONS
AUTHORITY_CHECK_FAIL = 1 DOCUMENT_NOT_FOUND = 2 ENQUEUE_FAIL = 3 PREREQUISITE_FAIL = 4 RELEASE_ALREADY_POSTED = 5 RESPONSIBILITY_FAIL = 6
.



IMPORTING Parameters details for BAPI_PO_RELEASE

PURCHASEORDER - Purchase Order Number

Data type: BAPIMMPARA-PO_NUMBER
Optional: No
Call by Reference: No ( called with pass by value option)

PO_REL_CODE - Release Code

Data type: BAPIMMPARA-PO_REL_COD
Optional: No
Call by Reference: No ( called with pass by value option)

USE_EXCEPTIONS - Set Exceptions and Issue Error Messages

Data type: BAPIMMPARA-SELECTION
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

NO_COMMIT - Commit Work Yes/No

Data type: BAPIMMPARA-SELECTION
Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for BAPI_PO_RELEASE

REL_STATUS_NEW - New Release Status

Data type: BAPIMMPARA-REL_STATUS
Optional: No
Call by Reference: No ( called with pass by value option)

REL_INDICATOR_NEW - New Release Indicator

Data type: BAPIMMPARA-PO_REL_IND
Optional: No
Call by Reference: No ( called with pass by value option)

RET_CODE - Return Value, Return Value After ABAP Statements

Data type: SY-SUBRC
Optional: No
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for BAPI_PO_RELEASE

RETURN - Return Messages

Data type: BAPIRETURN
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

AUTHORITY_CHECK_FAIL - No Authorization to Release

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

DOCUMENT_NOT_FOUND - Purchase order does not exist

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

ENQUEUE_FAIL - Purchase Order Blocked

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

PREREQUISITE_FAIL - Release Prerequisite Not Satisfied

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

RELEASE_ALREADY_POSTED - Release Already Effected

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

RESPONSIBILITY_FAIL - Responsibility for Release Missing

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for BAPI_PO_RELEASE Function Module

The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.

DATA:
lt_return  TYPE STANDARD TABLE OF BAPIRETURN, "   
lv_purchaseorder  TYPE BAPIMMPARA-PO_NUMBER, "   
lv_rel_status_new  TYPE BAPIMMPARA-REL_STATUS, "   
lv_authority_check_fail  TYPE BAPIMMPARA, "   
lv_po_rel_code  TYPE BAPIMMPARA-PO_REL_COD, "   
lv_rel_indicator_new  TYPE BAPIMMPARA-PO_REL_IND, "   
lv_document_not_found  TYPE BAPIMMPARA, "   
lv_ret_code  TYPE SY-SUBRC, "   
lv_enqueue_fail  TYPE SY, "   
lv_use_exceptions  TYPE BAPIMMPARA-SELECTION, "   'X'
lv_no_commit  TYPE BAPIMMPARA-SELECTION, "   ' '
lv_prerequisite_fail  TYPE BAPIMMPARA, "   
lv_release_already_posted  TYPE BAPIMMPARA, "   
lv_responsibility_fail  TYPE BAPIMMPARA. "   

  CALL FUNCTION 'BAPI_PO_RELEASE'  "Release Purchase Orders
    EXPORTING
         PURCHASEORDER = lv_purchaseorder
         PO_REL_CODE = lv_po_rel_code
         USE_EXCEPTIONS = lv_use_exceptions
         NO_COMMIT = lv_no_commit
    IMPORTING
         REL_STATUS_NEW = lv_rel_status_new
         REL_INDICATOR_NEW = lv_rel_indicator_new
         RET_CODE = lv_ret_code
    TABLES
         RETURN = lt_return
    EXCEPTIONS
        AUTHORITY_CHECK_FAIL = 1
        DOCUMENT_NOT_FOUND = 2
        ENQUEUE_FAIL = 3
        PREREQUISITE_FAIL = 4
        RELEASE_ALREADY_POSTED = 5
        RESPONSIBILITY_FAIL = 6
. " BAPI_PO_RELEASE




ABAP code using 7.40 inline data declarations to call FM BAPI_PO_RELEASE

The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.

 
"SELECT single PO_NUMBER FROM BAPIMMPARA INTO @DATA(ld_purchaseorder).
 
"SELECT single REL_STATUS FROM BAPIMMPARA INTO @DATA(ld_rel_status_new).
 
 
"SELECT single PO_REL_COD FROM BAPIMMPARA INTO @DATA(ld_po_rel_code).
 
"SELECT single PO_REL_IND FROM BAPIMMPARA INTO @DATA(ld_rel_indicator_new).
 
 
"SELECT single SUBRC FROM SY INTO @DATA(ld_ret_code).
 
 
"SELECT single SELECTION FROM BAPIMMPARA INTO @DATA(ld_use_exceptions).
DATA(ld_use_exceptions) = 'X'.
 
"SELECT single SELECTION FROM BAPIMMPARA INTO @DATA(ld_no_commit).
DATA(ld_no_commit) = ' '.
 
 
 
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!