on 06-09-2009 10:21 AM
HI,
I want to hide check boxes and radio buttons . Option NO-DISPLAY is not allowed for check boxes and radio buttons .
Please tell me how do i achjieve it.
Thanks,
Ahmed.
Hi
PARAMETERS: p_rb RADIOBUTTON GROUP GR,
p_ch AS CHECKBOX.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF SCREEN-NAME = 'p_rb' OR SCREEN-NAME = 'p_ch'.
SCREEN-INVISIBLE = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
To hide a radiobutton or checkbox you need to loop to screen table and when the desired radibutton
name comes you need to make it ACTIVE = 0 and MODIFY SCREEN table.
In your case when the R_CARS radiobutton will be selected then the R_FORD and
R_TOYOTA will be active and the R_VOLVO and R_MERCED will be disabled by looping
and modifying the screen table.
I have modified the previous code what I posted and added the
AT SELECTION-SCREEN OUTPUT event and the corresponding code to
disable and enable the radiobuttons.
Please check the code - -
Radio button Declaration part - -
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(10) FOR FIELD r_cars.
PARAMETERS : r_cars RADIOBUTTON GROUP rgb USER-COMMAND usd .
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 20(10) FOR FIELD r_toyota .
PARAMETERS : r_toyota RADIOBUTTON GROUP rgb1 DEFAULT 'X'.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 20(10) FOR FIELD r_ford .
PARAMETERS : r_ford RADIOBUTTON GROUP rgb1 .
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(10) FOR FIELD r_bus .
PARAMETERS : r_bus RADIOBUTTON GROUP rgb DEFAULT 'X'.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 20(10) FOR FIELD r_volvo .
PARAMETERS : r_volvo RADIOBUTTON GROUP rgb2 .
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 20(10) FOR FIELD r_merced .
PARAMETERS : r_merced RADIOBUTTON GROUP rgb2 DEFAULT 'X'.
SELECTION-SCREEN END OF LINE.
Hiding the radio buttons according to selection - -
AT SELECTION-SCREEN OUTPUT. " AT SELECTION-SCREEN OUTPUT
IF r_cars = 'X'. " If R_CURS radiobutton is selected
LOOP AT SCREEN . " Looping at screen
IF screen-name CS 'R_VOLVO' OR
screen-name CS 'R_MERCED'.
screen-active = 0. " Hiding the R_VOLVO and R_MERCED
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSE.
LOOP AT SCREEN .
IF screen-name CS 'R_TOYOTA' OR
screen-name CS 'R_FORD'.
screen-active = 0.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
The same way you can Hide the checkboxes also .
Regards
Pinaki
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
'AT SELECTION-SCREEN OUTPUT' event can be used.
PARAMETERS : P_rad1 RADIOBUTTON GROUP grp.
AT SELECTION-SCREEN OUTPUT.
Loop at screen.
if screen-name ='P_rad1'
screen-invisible = 1.
modify screen.
endif.
endloop.
Edited by: Gautam Totekar on Jun 9, 2009 5:11 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Ahmed,
I think pavan code needs bit modification.
parameters : p_c as checkbox,
p_matnr TYPE matnr.
at selection-screen output.
loop at screen.
if screen-name = 'P_C'.
screen-input = '0'
screen-INVISIBLE = '1'.
modify screen.
endif.
endloop.
I have just added the code line " screen-input = '0' ".
This will surely solve your problem.
Cheers,
Suvendu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Use the selection screen event 'AT SELECTION-SCREEN OUTPUT' to hide ur screen fields.
Example.
AT SELECTION-SCREEN OUTPUT.
Loop at screen.
if screen-name = 'screen field name should be in upper case.
screen-invisible = 1.
modify screen.
endif.
endloop.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Use At selection-scrren output event to change the screen fields display properties.
You can use SCREEN-INVISIBLE = 1 to hide the field.
Regards,
Rajitha.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Use At selection-screen output event.
eg:
parameters : p_c as checkbox,
p_matnr TYPE matnr.
at selection-screen output.
loop at screen.
if screen-name = 'P_C'.
screen-INVISIBLE = '1'.
modify screen.
endif.
endloop.
Hope it helps!!
Rgds,
Pavan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.