SAP Function Modules

BAPI_PO_RELEASE SAP Function module - Release Purchase Orders

BAPI_PO_RELEASE is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name BAPI_PO_RELEASE into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: MEWF
Released Date: 31.10.1997
Processing type: Remote-Enabled
remote enabled module settings


CALL FUNCTION 'BAPI_PO_RELEASE' "Release Purchase Orders
    purchaseorder =             " bapimmpara-po_number  Purchase Order Number
    po_rel_code =               " bapimmpara-po_rel_cod  Release Code
*   use_exceptions = 'X'        " bapimmpara-selection  Set Exceptions and Issue Error Messages
*   no_commit = ' '             " bapimmpara-selection  Commit Work Yes/No
    rel_status_new =            " bapimmpara-rel_status  New Release Status
    rel_indicator_new =         " bapimmpara-po_rel_ind  New Release Indicator
    ret_code =                  " sy-subrc      Return Value, Return Value After ABAP Statements
*   return =                    " bapireturn    Return Messages
    AUTHORITY_CHECK_FAIL = 1    "               No Authorization to Release
    DOCUMENT_NOT_FOUND = 2      "               Purchase order does not exist
    ENQUEUE_FAIL = 3            "               Purchase Order Blocked
    PREREQUISITE_FAIL = 4       "               Release Prerequisite Not Satisfied
    RELEASE_ALREADY_POSTED = 5  "               Release Already Effected
    RESPONSIBILITY_FAIL = 6     "               Responsibility for Release Missing

ABAP code example for Function Module BAPI_PO_RELEASE

The ABAP code below is a full code listing to execute function module BAPI_PO_RELEASE including all data declarations. The code uses 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 original method of declaring data variables up front. 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).

ld_rel_status_new  TYPE BAPIMMPARA-REL_STATUS ,
ld_rel_indicator_new  TYPE BAPIMMPARA-PO_REL_IND ,
ld_ret_code  TYPE SY-SUBRC ,
wa_return  LIKE LINE OF it_return .

DATA(ld_purchaseorder) = some text here

DATA(ld_po_rel_code) = some text here

DATA(ld_use_exceptions) = some text here

DATA(ld_no_commit) = some text here

"populate fields of struture and append to itab
append wa_return to it_return. . CALL FUNCTION 'BAPI_PO_RELEASE' EXPORTING purchaseorder = ld_purchaseorder po_rel_code = ld_po_rel_code * use_exceptions = ld_use_exceptions * no_commit = ld_no_commit IMPORTING rel_status_new = ld_rel_status_new rel_indicator_new = ld_rel_indicator_new ret_code = ld_ret_code * TABLES * return = it_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
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 5. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 6. "Exception "Add code for exception here ENDIF.

ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

ld_rel_status_new  TYPE BAPIMMPARA-REL_STATUS ,
ld_purchaseorder  TYPE BAPIMMPARA-PO_NUMBER ,
wa_return  LIKE LINE OF it_return,
ld_rel_indicator_new  TYPE BAPIMMPARA-PO_REL_IND ,
ld_po_rel_code  TYPE BAPIMMPARA-PO_REL_COD ,
ld_ret_code  TYPE SY-SUBRC ,
ld_use_exceptions  TYPE BAPIMMPARA-SELECTION ,

ld_purchaseorder = some text here

"populate fields of struture and append to itab
append wa_return to it_return.

ld_po_rel_code = some text here

ld_use_exceptions = some text here

ld_no_commit = some text here

SAP Documentation for FM BAPI_PO_RELEASE

You can use this method to release (approve) purchase orders. The PO number and the release code must be passed on. The new release status ...See here for full SAP fm documentation

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name BAPI_PO_RELEASE or its description.