SAP RH_EVENT_LOCK Function Module for Lock / Unlock Business Event









RH_EVENT_LOCK is a standard rh event lock SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Lock / Unlock Business Event 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 rh event lock FM, simply by entering the name RH_EVENT_LOCK into the relevant SAP transaction such as SE37 or SE38.

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



Function RH_EVENT_LOCK 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 'RH_EVENT_LOCK'"Lock / Unlock Business Event
EXPORTING
PLVAR = "Plan version
EV_ID = "Business event (ID)
LOCK = "Edit: lock ('X') / unlock (' ')
* MODE = ' ' "Editing mode

EXCEPTIONS
NO_PLVAR = 1 EVENT_ALREADY_LOCKED = 10 EVENT_ALREADY_UNLOCKED = 11 NO_UPDATE_AUTHORIZATION = 12 ERROR_DURING_UPDATE = 13 NO_INSERT_AUTHORIZATION = 14 ERROR_DURING_INSERT = 15 NO_AUTHORITY = 16 NO_EVENTTYPE_FOUND = 17 NO_EVENT = 2 EVENT_NOT_FOUND = 3 ROOM_RESERVATION = 4 EVENT_HISTO = 5 NO_I1026 = 6 EVENT_CANCELLED = 7 MORE_THAN_ONE_I1026 = 8 EVENT_LOCKED = 9
.



IMPORTING Parameters details for RH_EVENT_LOCK

PLVAR - Plan version

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

EV_ID - Business event (ID)

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

LOCK - Edit: lock ('X') / unlock (' ')

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

MODE - Editing mode

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

EXCEPTIONS details

NO_PLVAR - Plan version has not been set

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

EVENT_ALREADY_LOCKED - Business event is already locked

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

EVENT_ALREADY_UNLOCKED - Business event is already unlocked

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

NO_UPDATE_AUTHORIZATION - You do not have authorization to change

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

ERROR_DURING_UPDATE - Error occurred while changing data

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

NO_INSERT_AUTHORIZATION - You do not have authorization to insert

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

ERROR_DURING_INSERT - Error occurred while inserting data

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

NO_AUTHORITY - No authorization

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

NO_EVENTTYPE_FOUND - The business event has not been assigned a type

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

NO_EVENT - Business event not set

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

EVENT_NOT_FOUND - Business event could not be found

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

ROOM_RESERVATION - Business event belongs to Room Reservations

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

EVENT_HISTO - Business event has historical record

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

NO_I1026 - There is no additional information

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

EVENT_CANCELLED - Business event is canceled

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

MORE_THAN_ONE_I1026 - Infotype 1026 occurs more than once in the period

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

EVENT_LOCKED - Business event locked (lock management)

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

Copy and paste ABAP code example for RH_EVENT_LOCK 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_plvar  TYPE HRVPVF-PLVAR, "   
lv_no_plvar  TYPE HRVPVF, "   
lv_event_already_locked  TYPE HRVPVF, "   
lv_event_already_unlocked  TYPE HRVPVF, "   
lv_no_update_authorization  TYPE HRVPVF, "   
lv_error_during_update  TYPE HRVPVF, "   
lv_no_insert_authorization  TYPE HRVPVF, "   
lv_error_during_insert  TYPE HRVPVF, "   
lv_no_authority  TYPE HRVPVF, "   
lv_no_eventtype_found  TYPE HRVPVF, "   
lv_ev_id  TYPE HRVPVF-EV_ID, "   
lv_no_event  TYPE HRVPVF, "   
lv_lock  TYPE HRVPVF-LOCK, "   
lv_event_not_found  TYPE HRVPVF, "   
lv_mode  TYPE HRVPVF-MODE, "   ' '
lv_room_reservation  TYPE HRVPVF, "   
lv_event_histo  TYPE HRVPVF, "   
lv_no_i1026  TYPE HRVPVF, "   
lv_event_cancelled  TYPE HRVPVF, "   
lv_more_than_one_i1026  TYPE HRVPVF, "   
lv_event_locked  TYPE HRVPVF. "   

  CALL FUNCTION 'RH_EVENT_LOCK'  "Lock / Unlock Business Event
    EXPORTING
         PLVAR = lv_plvar
         EV_ID = lv_ev_id
         LOCK = lv_lock
         MODE = lv_mode
    EXCEPTIONS
        NO_PLVAR = 1
        EVENT_ALREADY_LOCKED = 10
        EVENT_ALREADY_UNLOCKED = 11
        NO_UPDATE_AUTHORIZATION = 12
        ERROR_DURING_UPDATE = 13
        NO_INSERT_AUTHORIZATION = 14
        ERROR_DURING_INSERT = 15
        NO_AUTHORITY = 16
        NO_EVENTTYPE_FOUND = 17
        NO_EVENT = 2
        EVENT_NOT_FOUND = 3
        ROOM_RESERVATION = 4
        EVENT_HISTO = 5
        NO_I1026 = 6
        EVENT_CANCELLED = 7
        MORE_THAN_ONE_I1026 = 8
        EVENT_LOCKED = 9
. " RH_EVENT_LOCK




ABAP code using 7.40 inline data declarations to call FM RH_EVENT_LOCK

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 PLVAR FROM HRVPVF INTO @DATA(ld_plvar).
 
 
 
 
 
 
 
 
 
 
"SELECT single EV_ID FROM HRVPVF INTO @DATA(ld_ev_id).
 
 
"SELECT single LOCK FROM HRVPVF INTO @DATA(ld_lock).
 
 
"SELECT single MODE FROM HRVPVF INTO @DATA(ld_mode).
DATA(ld_mode) = ' '.
 
 
 
 
 
 
 


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!