SAP OCS_SET_BATCH_SEMAPHORE_STATUS Function Module for









OCS_SET_BATCH_SEMAPHORE_STATUS is a standard ocs set batch semaphore status SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, 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 ocs set batch semaphore status FM, simply by entering the name OCS_SET_BATCH_SEMAPHORE_STATUS into the relevant SAP transaction such as SE37 or SE38.

Function Group: OCS_BATCH
Program Name: SAPLOCS_BATCH
Main Program: SAPLOCS_BATCH
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function OCS_SET_BATCH_SEMAPHORE_STATUS 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 'OCS_SET_BATCH_SEMAPHORE_STATUS'"
EXPORTING
IV_TOOL = "
IV_STATUS = "Status of Batch Operation in OCS Transactions

IMPORTING
ES_OCS_SEMA = "OCS Semaphore
ES_BATCH_SEMA = "OCS Semaphore Extension for Batch Operation

EXCEPTIONS
FOREIGN_LOCK = 1 NO_OCS_SEMAPHORE = 2 NO_BATCH_SEMAPHORE = 3 SEMAPHORES_DIFFER = 4 INTERNAL_ERROR = 5
.



IMPORTING Parameters details for OCS_SET_BATCH_SEMAPHORE_STATUS

IV_TOOL -

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

IV_STATUS - Status of Batch Operation in OCS Transactions

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

EXPORTING Parameters details for OCS_SET_BATCH_SEMAPHORE_STATUS

ES_OCS_SEMA - OCS Semaphore

Data type: PAT10
Optional: No
Call by Reference: Yes

ES_BATCH_SEMA - OCS Semaphore Extension for Batch Operation

Data type: PAT10B
Optional: No
Call by Reference: Yes

EXCEPTIONS details

FOREIGN_LOCK -

Data type:
Optional: No
Call by Reference: Yes

NO_OCS_SEMAPHORE -

Data type:
Optional: No
Call by Reference: Yes

NO_BATCH_SEMAPHORE -

Data type:
Optional: No
Call by Reference: Yes

SEMAPHORES_DIFFER -

Data type:
Optional: No
Call by Reference: Yes

INTERNAL_ERROR - Internal Error

Data type:
Optional: No
Call by Reference: Yes

Copy and paste ABAP code example for OCS_SET_BATCH_SEMAPHORE_STATUS 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:
lv_iv_tool  TYPE SY-TCODE, "   
lv_es_ocs_sema  TYPE PAT10, "   
lv_foreign_lock  TYPE PAT10, "   
lv_iv_status  TYPE PAT10B-STATUS, "   
lv_es_batch_sema  TYPE PAT10B, "   
lv_no_ocs_semaphore  TYPE PAT10B, "   
lv_no_batch_semaphore  TYPE PAT10B, "   
lv_semaphores_differ  TYPE PAT10B, "   
lv_internal_error  TYPE PAT10B. "   

  CALL FUNCTION 'OCS_SET_BATCH_SEMAPHORE_STATUS'  "
    EXPORTING
         IV_TOOL = lv_iv_tool
         IV_STATUS = lv_iv_status
    IMPORTING
         ES_OCS_SEMA = lv_es_ocs_sema
         ES_BATCH_SEMA = lv_es_batch_sema
    EXCEPTIONS
        FOREIGN_LOCK = 1
        NO_OCS_SEMAPHORE = 2
        NO_BATCH_SEMAPHORE = 3
        SEMAPHORES_DIFFER = 4
        INTERNAL_ERROR = 5
. " OCS_SET_BATCH_SEMAPHORE_STATUS




ABAP code using 7.40 inline data declarations to call FM OCS_SET_BATCH_SEMAPHORE_STATUS

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 TCODE FROM SY INTO @DATA(ld_iv_tool).
 
 
 
"SELECT single STATUS FROM PAT10B INTO @DATA(ld_iv_status).
 
 
 
 
 
 


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!