2005 Nov 29 6:16 AM
Hi,
I have a screen, where I have two radio buttons and input fields in front of them.
I want to make the input fields of one Radio button invisble when the other is selected.
However, when I select the radio button, I have to press Enter to make the input fields visible again.
I want the fields to be visible when the Radio button is selected.Is it possible to do so.
Please suggest.
Thanks in advance,
Archana
Hi,
I have a screen, where I have two radio buttons and input fields in front of them.
I want to make the input fields of one Radio button invisble when the other is selected.
However, when I select the radio button, I have to press Enter to make the input fields visible again.
I want the fields to be visible when the Radio button is selected.Is it possible to do so.
Please suggest.
Thanks in advance,
Archana
2005 Nov 29 6:23 AM
Hi,
See this code i hope it will help you...
*************
when <radiobutton> = 'X'.
loop at screen.
if screen-name = '<field>'.
screen-invisible = 1 or 0 "check here...
modify screen.
endloop.
I hope this will help you.
Thanks.
If it works award points and close the thread.
2005 Nov 29 6:27 AM
Hi....
This is what I have actually done but to get these fields I have to press Enter.
It does not get selected on the selection of the Radio Button.
is there some other way...
2005 Nov 29 6:30 AM
hi no need of pressing enter .you can directly trigger using user command.
1.PARAMETERS: R_SHIP RADIOBUTTON GROUP G1 DEFAULT 'X' <b>USER-COMMAND ABC</b>,
R_HU RADIOBUTTON GROUP G1 .
2.<b>AT SELECTION-SCREEN OUTPUT</b>.
IF R_SHIP = 'X'.
PERFORM DISABLE_HU.
ENDIF.
IF R_HU = 'X'.
PERFORM DISABLE_SHIP.
ENDIF.
2005 Nov 29 6:35 AM
ARCHANA,
THE ONLY WAY FOR THIS, ATTACH SOME USER COMMAND WITH THE RADIO BUTTON..PLZ SEE MY CODE IN THE PREVIUS POST. [ THE DECLRATION OF RADION BUTTON]
IF YOU RUN THAT CODE IN MY PREVIOUS POST..YOU WILL GET THE IDEA..
ON CLICK OF RADIOBUTON, I AM NOT ONLY MAKING TEXT-FIELD VISIBLE/INVISIBLE, ALSO BUTTONS.
2005 Nov 29 6:24 AM
plz run the follwing code.
plz reward points if it helps you.
Report ZANID_TEST2 Message-ID ZM.
tables: SSCRFIELDS.
DATA: BEGIN OF it_file OCCURS 0,
buffer(2000),
END OF it_file.
DATA: filename1(128),
filename2(128),
rec(1750).
DATA: c_fnh_mask TYPE dxfields-filemask VALUE '*',
searched_dir TYPE dxfields-longpath,
file_path LIKE dxfields-longpath.
-parameters----
selection-screen:
Begin of block r1 with frame title text-006.
parameters:
p_cp1 radiobutton group rb1 default 'X' USER-COMMAND RND,
p_mv1 radiobutton group rb1,
p_ren radiobutton group rb1,
p_del1 radiobutton group rb1.
selection-screen:
End of block r1.
selection-screen:
begin of block b1 with frame title text-004.
parameters:
loc1(128) obligatory lower case "Location1
default 'E:\usr\sap\put' modif id 1,
file(128) obligatory lower case "Filename
default 'E:\usr\sap\put\ekpo.dat' modif id 2,
newname(128) obligatory lower case "Filname
default 'abcd.txt' modif id 3,
loc2(128) obligatory lower case "Location2
default 'E:\usr\sap\D12\SYS\gen' modif id 4.
selection-screen:
skip,
PUSHBUTTON /05(23) TEXT-001 USER-COMMAND ZCOPY modif id 5,"COPY
PUSHBUTTON 30(23) TEXT-002 USER-COMMAND ZMOV modif id 6, "CUT
PUSHBUTTON 55(23) TEXT-003 USER-COMMAND ZDELETE modif id 7, "DELTE
skip,
PUSHBUTTON /30(23) TEXT-005 USER-COMMAND ZREN modif id 8, "RENAME
end of block b1.
*
at selection-screen output .
perform modify_screen.
start-of-selection.
***your code
&----
*& Form modify_screen
&----
form modify_screen.
loop at screen.
if p_cp1 eq 'X'.
if screen-group1 = '3' or
screen-group1 = '6' or
screen-group1 = '7' or
screen-group1 = '8'.
screen-active = 0.
endif.
elseif p_mv1 eq 'X'.
if screen-group1 = '3' or
screen-group1 = '5' or
screen-group1 = '7' or
screen-group1 = '8'.
screen-active = 0.
endif.
elseif p_del1 eq 'X'.
if screen-group1 = '3' or
screen-group1 = '4' or
screen-group1 = '5' or
screen-group1 = '6' or
screen-group1 = '8'.
screen-active = 0.
endif.
elseif p_ren eq 'X'.
if screen-group1 = '4' or
screen-group1 = '5' or
screen-group1 = '6' or
screen-group1 = '7'.
screen-active = 0.
endif.
endif.
modify screen.
endloop.
endform. " modify_screen
2005 Nov 29 6:25 AM
1.PARAMETERS: R_SHIP RADIOBUTTON GROUP G1 DEFAULT 'X' USER-COMMAND ABC,
R_HU RADIOBUTTON GROUP G1 .
2.AT SELECTION-SCREEN OUTPUT.
IF R_SHIP = 'X'.
PERFORM DISABLE_HU.
ENDIF.
IF R_HU = 'X'.
PERFORM DISABLE_SHIP.
ENDIF.
3.FORM DISABLE_HU .
LOOP AT SCREEN.
CASE SCREEN-NAME.
WHEN 'P_EXIDV'.
SCREEN-INPUT = 0.
CLEAR P_EXIDV.
MODIFY SCREEN.
WHEN 'P_BUKRS'.
SCREEN-INPUT = 0.
CLEAR P_BUKRS.
MODIFY SCREEN.
WHEN 'P_TKNO'.
SCREEN-INPUT = 0.
CLEAR P_TKNO.
MODIFY SCREEN.
WHEN 'P_ENTRY'.
SCREEN-INPUT = 0.
CLEAR P_ENTRY.
MODIFY SCREEN.
WHEN 'P_EXIT'.
SCREEN-INPUT = 0.
CLEAR P_EXIT.
MODIFY SCREEN.
WHEN 'P_ROUTE'.
SCREEN-INPUT = 0.
CLEAR P_ROUTE.
MODIFY SCREEN.
WHEN 'P_TRAIL'.
SCREEN-INPUT = 0.
CLEAR P_TRAIL.
MODIFY SCREEN.
ENDCASE.
ENDLOOP.
ENDFORM. " disable_HuMessage was edited by: Vijay Babu Dudla
2005 Nov 29 6:39 AM
Hi Archana,
Please Close the thread if your Problem solves.
reward for helpful answers.
regards
vijay
2005 Nov 29 6:42 AM
HI...
I found the solution..
I attached the Radio button group to an OK CODe and checked for it in the PAI...
so its wroking now...
Thnaks to all
2005 Nov 29 7:26 AM
Hi Vijay
I have rewarded the points already...is there any other way to close the thread ??
2005 Nov 29 7:07 AM
DATA: flag1(1) type c,
flag2(1) type c.
********************************************
In the PAI write this code
Case sy-ucomm
when <radiobutton1> = 'X'.
flag1 = 'x'.
when <radiobutton2> = 'X'.
flag2 = 'x'.
endcase.
*********************************************
In the PBO of screen write this code
If flag1 = 'x'.
LOOP AT SCREEN.
IF screen-name = 'Field-name2'. "To Hide the second I/P Field
screen-active = 0.
screen-invisible = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
If flag2 = 'x'.
LOOP AT SCREEN.
IF screen-name = 'Field-name1'. "To Hide the First I/P Field
screen-active = 0.
screen-invisible = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
Hope this will work 4 u.
Reward me if u find it working..
Ask 4 clarification ny time.
Regards
-
Sachin Dhingra