06-24-2020 3:30 AM
Hi all,
i need your advice,
i have screen and i create lock object,
i need when user1 open no.bill ex : 1-10 and change it, screen will input = 1.
and then when user 2 open no.bill ex : 8 - 12 , screen output no.bill 8-10 equal = 0 because user 1 opened it and no.bill 11-12 screen output = 1.
how can lock object inside loop ?
this is my code.
PROCESS BEFORE OUTPUT.
MODULE status_0100.
MODULE init.
LOOP AT it_show WITH CONTROL tc_0001
CURSOR tc_0001-current_line.
MODULE icon_status.
MODULE lock_object.
MODULE screen_control.
MODULE moveback_to_screen.
ENDLOOP.
"------------------
MODULE lock_object.
DATA : lv_uname TYPE sy-msgv1,
lv_msg TYPE c LENGTH 40.
CALL FUNCTION 'ENQUEUE_EZLOSD_TRIP_BBO2'
EXPORTING
mode_zsdtb_trip_bbo2 = 'E'
mandt = sy-mandt
no_bill = it_show-no_bill
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc <> 0.
* lv_uname = sy-msgv1.
* CONCATENATE 'Data has been locked by :' lv_uname INTO lv_msg
* SEPARATED BY space.
* MESSAGE i000(zmm) WITH lv_msg DISPLAY LIKE 'E'.
gv_error2 = 'X'.
ENDIF.
ENDMODULE.
Thank You
06-24-2020 6:53 AM
Hi
You can make it disable as below
CALL FUNCTION 'ENQUEUE_EZLOSD_TRIP_BBO2'
EXPORTING
mode_zsdtb_trip_bbo2 = 'E'
mandt = sy-mandt
no_bill = it_show-no_bill
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc <> 0.
LOOP AT screen. "<===== screen loop
SCREEN-INPUT = 0. " Disable for input
MODIFY SCREEN.
ENDLOOP. "<=== screen loop
gv_error2 = 'X'.
ENDIF.
06-24-2020 7:09 AM
so after get data from table and before display it on screen, you should check if record is locked then set input = 0.
06-24-2020 9:57 AM
Your question is unclear as you mix normal language and ABAP elements. Try to spend more time on describing clearly in full English.
Decoding and rephrasing your question:
Requirement:
Question:
06-24-2020 10:01 AM
Not related to your question, but please don't lock during the PBO because you shouldn't lock at each input of the user, or at each scroll of the screen.
Instead, I propose that you lock before displaying the screen, store the lock status in an intermediate field of the internal table IT_SHOW, don't display that field, and in PBO test this field to make fields input-capable or output-only.
06-25-2020 5:32 AM
Hi sandra.rossi ,
Thank you for correcting me .
yeah, i mean like that.
Thank you so much.