Sie sind auf Seite 1von 10

Creating a Lock Object For WRITE Mode :-

Custom Table By using SE11

Its Data

Go to SE11> Select Radio Button Lock Object > Provide Lock Object Name (Starting Letter Should Start with E only) > Create..

Click on Lock Parameter Tab

It will come Automatically

After activating the Lock Object Automatically Two Function Modules will Generate.. One for Lock an object Another for Unlock an object Those will show below

We can see by.. GOTO > Lock Modules in the Lock Object Screen

.Upto now just we Created Lock Object for Kunnr Field in ZLCK Table

Now we are going to use this lock object in a Custom Program

Custom Report By Using SE38

*&---------------------------------------------------------------------* *& Report ZAN_L_REPORT *& *&---------------------------------------------------------------------* *& *& *&---------------------------------------------------------------------* REPORT ZAN_L_REPORT.

TABLES ZLCK. parameters P_KUNNR type KUNNR. start-of-selection. call screen 100. *&---------------------------------------------------------------------* *& Module STATUS_0100 OUTPUT *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* MODULE STATUS_0100 OUTPUT. SET PF-STATUS 'BACK'. * SET TITLEBAR 'xxx'. SELECT SINGLE * FROM ZLCK INTO ZLCK WHERE KUNNR = P_KUNNR.

CALL FUNCTION 'ENQUEUE_EZCUST_INFO' EXPORTING MODE_ZLCK = 'X' MANDT = SY-MANDT KUNNR = P_KUNNR X_KUNNR = '' _SCOPE = '2' _WAIT = ' ' _COLLECT = ' ' EXCEPTIONS FOREIGN_LOCK = 1 SYSTEM_FAILURE = 2 OTHERS = 3 . ** IF SY-SUBRC <> 0. IF sy-subrc = 1.

data lv_msg type string.

CONCATENATE 'This Record is Currently Using by another User' sy-uname into lv_msg separated by space. MESSAGE : ENDIF. * lv_msg type 'S' display like 'E'.

ENDMODULE. " STATUS_0100 OUTPUT *&---------------------------------------------------------------------* *& Module USER_COMMAND_0100 INPUT *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* MODULE USER_COMMAND_0100 INPUT. case sy-ucomm. when 'BACK'. leave to screen 0. endcase. CALL FUNCTION 'DEQUEUE_EZCUST_INFO' EXPORTING MODE_ZLCK = 'E' MANDT = SY-MANDT KUNNR = p_kunnr X_KUNNR = ' ' _SCOPE = '3' _SYNCHRON = ' ' _COLLECT = ' ' . ENDMODULE. " USER_COMMAND_0100 INPUT

Flow Logic of Screen 100 GUI BACK PROCESS BEFORE OUTPUT. MODULE STATUS_0100. *

PROCESS AFTER INPUT. MODULE USER_COMMAND_0100.

Output : If we want to check any lock object we have to execute the same program two times at once.. So here first I am executing first time First Time Output :

This above screen is Selection Screen

This below screen will come after executing the above screen

Keep this window in open.. And execute This same Program in second time(Without Closing the above window) U will Get this below one..

Enjoy Folks BY

Anil

anil.neegineni@gmail.com

Das könnte Ihnen auch gefallen