‎2006 Sep 28 7:39 AM
Dear friends
I want screen fields to be disable when I click on display button and it become enabled when I click on it again.
For example in any transaction we have options display and change when we click on display next screen shows records in a display mode we cant make changes in that , I also want same thing , is there is any Function Module for the Same.
Its very urgent .
Regards
Vinod.
‎2006 Sep 28 7:47 AM
Welcome to SDN.
Here is what you can do to make all your fields display-only:
Assign all the fields to a group (say ABC), using the screen-painter (You will find this in the properties of each field). Then, use the following code in your PBO to set the fields to display only:
LOOP AT SCREEN.
IF screen-group1 = 'ABC'.
screen-input = 0.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
Hope this helps.
Sudha
‎2006 Sep 28 10:18 AM
Hi Sudha
Thanks for reply.
I Tried this but its not working.is there any other option or any function module. i tried one function module RS_TOOLS_ACCESS it is somewhat Ok but Still having problem.
waiting for reply.
regards
Vinod.
‎2006 Sep 28 10:20 AM
Please post your code. As far as I know, the screen-input method works really well.
Sudha
Message was edited by: Sudha Mohan
‎2006 Sep 28 10:20 AM
Hi friends
Thanks for reply.
I Tried this but its not working.is there any other option or any function module. i tried one function module RS_TOOLS_ACCESS it is somewhat Ok but Still having problem.
waiting for reply.
regards
Vinod.
‎2006 Sep 28 10:23 AM
Hi Vinod,
Did u tried this code??
This will work for sure infact its wrkin 4 me u need to assign the screen fields with a group like G1 and have 2 create a module in the PBO of the screen
case sy-ucomm.
When 'DISPLAY'.
LOOP AT SCREEN.
IF screen-group1 = 'G1'.
screen-active = 1.
screen-input = 0.
screen-output = 1.
screen-invisible = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
endcase.
Hope this helps u.
Regards,
Seema.
‎2006 Sep 28 11:26 AM
program given below is test program plz go thrugh it & plz make correction where required
PROGRAM ZTEMP .
&----
*& Module STATUS_0001 OUTPUT
&----
text
----
MODULE STATUS_0001 OUTPUT.
SET PF-STATUS 'T1'.
SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0001 OUTPUT
&----
*& Module USER_COMMAND_0001 INPUT
&----
text
----
MODULE USER_COMMAND_0001 INPUT.
CASE SY-UCOMM.
WHEN 'SHOW'.
LOOP AT SCREEN.
IF screen-group1 = 'PC1'.
screen-active = 1.
screen-input = 0.
screen-output = 1.
screen-invisible = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
WHEN 'BACK'.
SET SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0001 INPUT
regds vinod
‎2006 Sep 28 11:47 AM
Vinod,
The code will work perfectly if you put it in the <b>PBO</b>. Remember that this is a screen change and has to be done in the PBO.
Set a flag in the PAI, for the ucomm SHOW. If the flag is X, have the PBO execute the LOOP AT SCREEN call.
Hope this helps.
Sudha
‎2006 Sep 28 12:05 PM
thanks
the code is working properly.
thanks again for replay.
regards,
Vinod
‎2006 Sep 28 7:48 AM
HI,
you can do this by using a LOOP ENDLOOP on screen in PBO module. you can set a flag for the mode to be enable or disable for the button .
Like this.
"if button is clicked do this".
IF mode_flag = 0.
mode_flag = 1.
ELSEIF mode_flag = 1.
mode_flag = 0.
ENDIF.
in PBO do like this. assign all the fields to a field group name like 'GRP' so all will be disabled at once.
IN PBO module
IF mode_flag = 1.
LOOP AT SCREEN.
if screen-group1 = 'GRP'.
screen-input = 1.
modify screen.
endif.
ENDLOOP.
elseif mode_flag = 0.
LOOP AT SCREEN.
if screen-group1 = 'GRP'.
screen-input = 0.
modify screen.
endif.
ENDLOOP.
endif.
REgards,
‎2006 Sep 28 8:16 AM
Hi,
use below logic
clear ok-code.
ok-code = sy-ucomm.
case ok-code
when 'DISPLAY'
loop at screen.
if screen-name = 'P'
screen-input = 0.
modify screen.
endif.
endloop.
else.
loop at screen.
if screen-name = 'P'
screen-input = 1.
modify screen.
endif.
endloop.
Regards
amole
‎2006 Sep 28 8:29 AM
Hi Vinod,
This is how u can achieve the disable mode-
case sy-ucomm.
When 'DISPLAY'.
LOOP AT SCREEN.
IF screen-group1 = 'G1'.
screen-active = 1.
screen-input = 0.
screen-output = 1.
screen-invisible = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
endcase.
Hope this helps u.
Regards,
Seema.