Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Lock Object in Module Pool

Former Member
0 Likes
1,812

Hi Experts,

I have created two screens 100 and 200.

In 100,i have button 'CHANGE'.When  i click on change button  called 200 screen.

My question is ,when multiple user using same Z-Transaction ,first user doing changes in 200 screen so second user need to call 200 screen in display mode when first user making changes.

How to do this?

i had created lock object and called FM in my program but i am not getting it.

Please give me any solution.

Thanks and Regards,

Ravi Teja

1 ACCEPTED SOLUTION
Read only

rosenberg_eitan
Active Contributor
0 Likes
1,387

Hi,

Please search for "record level record lock in sap abap"

Based on the result of calling the generated Enqueue function you can set the screen in PBO .

2014/07/07 : Please look at DEMO_TRANSACTION_ENQUEUE

Regards.

9 REPLIES 9
Read only

rosenberg_eitan
Active Contributor
0 Likes
1,388

Hi,

Please search for "record level record lock in sap abap"

Based on the result of calling the generated Enqueue function you can set the screen in PBO .

2014/07/07 : Please look at DEMO_TRANSACTION_ENQUEUE

Regards.

Read only

0 Likes
1,387

Hi Eitan,

In demo program DEMO_TRANSACTION_ENQUEUE they given that

CALL TRANSACTION 'TCODE NAME'  AND SKIP FIRST SCREEN.

Same syntax i written in my module pool program ,it is not working but

if i give CALL SCREEN 'screen number'  it is working .

Any reason.

Thanks and regrads,

Ravi.

Read only

0 Likes
1,387

Hi,


This is the code of DEMO_TRANSACTION_ENQUEUE here:

I do not see "CALL TRANSACTION 'TCODE NAME'  AND SKIP FIRST SCREEN."


Regards.

  1. REPORT  demo_transaction_enqueue MESSAGE-ID sabapdocu.
  2. TABLES  sflight.
  3. DATA  text(8) TYPE c.
  4. DATA  ok_code TYPE sy-ucomm.
  5. CALL SCREEN 100.
  6. MODULE init OUTPUT.
  7.   SET PF-STATUS 'BASIC'.
  8.   sflight-carrid = 'LH'. sflight-connid = '400'.
  9. ENDMODULE.
  10. MODULE exit INPUT.
  11.   LEAVE PROGRAM.
  12. ENDMODULE.
  13. MODULE enqueue INPUT.
  14.   CASE ok_code.
  15.     WHEN 'ENQUEUE'.
  16.       CALL FUNCTION 'ENQUEUE_EDEMOFLHT'
  17.            EXPORTING
  18.                 mode_sflight   = 'X'
  19.                 carrid         = sflight-carrid
  20.                 connid         = sflight-connid
  21.                 fldate         = sflight-fldate
  22.            EXCEPTIONS
  23.                 foreign_lock   = 1
  24.                 system_failure = 2
  25.                 OTHERS         = 3.
  26.       CASE sy-subrc.
  27.         WHEN 0.
  28.           MESSAGE i888 WITH 'Enqueue successful'(001).
  29.         WHEN 1.
  30.           text = sy-msgv1.
  31.           MESSAGE e888 WITH 'Record already'(002) 'locked by'(003)
  32.                                                    text.
  33.           CALL TRANSACTION 'SM12'.
  34.         WHEN 2 OR 3.
  35.           MESSAGE e888 WITH 'Error in enqueue!'(004)
  36.                             'SY-SUBRC:' sy-subrc.
  37.       ENDCASE.
  38.     WHEN 'DEQUEUE'.
  39.       CALL FUNCTION 'DEQUEUE_EDEMOFLHT'
  40.            EXPORTING
  41.                 mode_sflight = 'X'
  42.                 carrid       = sflight-carrid
  43.                 connid       = sflight-connid
  44.                 fldate       = sflight-fldate
  45.            EXCEPTIONS
  46.                 OTHERS       = 1.
  47.       CASE sy-subrc.
  48.         WHEN 0.
  49.           MESSAGE i888 WITH 'Dequeue successful'(005).
  50.         WHEN 1.
  51.           MESSAGE e888 WITH 'Error in dequeue!'(006).
  52.       ENDCASE.
  53.     WHEN 'SM12'.
  54.       CALL TRANSACTION 'SM12'.
  55.   ENDCASE.
  56. ENDMODULE.
  57. MODULE select INPUT.
  58.   CASE ok_code.
  59.     WHEN 'SELECT'.
  60.       SELECT * FROM sflight WHERE carrid = sflight-carrid
  61.                               AND connid = sflight-connid
  62.                               AND fldate = sflight-fldate.
  63.       ENDSELECT.
  64.       MESSAGE i888 WITH 'SY-SUBRC:' sy-subrc.
  65.   ENDCASE.
  66. ENDMODULE.
Read only

0 Likes
1,387

Hi,

sorry,it is CALL TRANSACTION 'SM12' AT 43 line and i need to use

CALL TRANSACTION 'TCODE NAME' AND SKIP FIRST SCREEN and i need to display data in display

mode.

Read only

0 Likes
1,387

Hi,

If you want just to display data why lock it ?

For example use MM03 and not MM02 .

In your original question you were talking about screen 100 and 200 in the same program ?

regards.

Read only

0 Likes
1,387

Hi,

DEMO_TRANSACTION_ENQUEUE is used to demonstrate record level locking and only that

Regards.


Read only

0 Likes
1,387

we have only one tcode for all display ,change and create,so if one user change data and another

user trying to change same record ,need get message RECORD  and data  should be display

in display mode for same record.

i have done it by using call screen screen number but

call transaction tcode name and skip first screen is not working in module pool?

can you give any information for above one .

Read only

0 Likes
1,387

Hi,

K fine,

then what is the solution for above reply

Read only

0 Likes
1,387

Hi,

If the called program is a Z* program I suggest that you add to it "record level locking" .

Also add to the called program "Display" mode using a different transaction code like many SAP program do (I did mention MM02 and MM03 )

Regards.