‎2007 Jan 11 6:06 PM
Hi ,
This is how I have defined my selection screen .
SELECTION-SCREEN BEGIN OF BLOCK pcode1 WITH FRAME TITLE text-s02.
parameters : p_crun type char1 radiobutton group rad2 ,
p_prun type char1 radiobutton group rad2 default 'X'.
select-options : s_date for sy-datum .
selection-screen skip .
parameters : p_test type char1 as checkbox .
SELECTION-SCREEN END OF BLOCK pcode1.
My intension is insert a code in the program which should work this way :
When I select p_crun the select option for date filed should disappear from the screen and when I select p_prun the date option should appear so that I can enter my date range .
this is the code I am using and it is not working :
at selection-screen output .
perform modify_screen .
FORM modify_screen .
loop at screen .
if p_crun eq c_x .
if screen-name eq '*S_DATE*' .
screen-invisible = '0' .
screen-active = '0' .
screen-input = '0' .
endif .
endif .
modify screen .
endloop .
endform .
Can anyone help me to fix tis problem .
Thanks and Regards ,
Daniel .
‎2007 Jan 11 6:14 PM
Hi,
Please check the modified code..Changes are marked in bold..
SELECTION-SCREEN BEGIN OF BLOCK pcode1 WITH FRAME TITLE text-s02.
parameters : p_crun type char1 radiobutton group rad2 <b>USER-COMMAND USR</b>,
p_prun type char1 radiobutton group rad2 default 'X'.
select-options : s_date for sy-datum <b>MODIF ID G1</b>.
selection-screen skip .
parameters : p_test type char1 as checkbox .
SELECTION-SCREEN END OF BLOCK pcode1.
at selection-screen output .
perform modify_screen .
FORM modify_screen .
loop at screen .
if p_crun eq c_x .
<b>if screen-GROUP1 = 'G1'.
screen-invisible = '1' .
screen-active = '0' .
screen-input = '0' .
endif .
else p_prun eq c_x.
if screen-GROUP1 = 'G1'.
screen-invisible = '0' .
screen-active = '1' .
screen-input = '1' .
endif .</b>
endif .
modify screen .
endloop .
endform .
Thanks,
Naren
‎2007 Jan 11 6:09 PM
Hi,
Changes are marked in bold..Instead of using the select-options name..use the modif id..
SELECTION-SCREEN BEGIN OF BLOCK pcode1 WITH FRAME TITLE text-s02.
parameters : p_crun type char1 radiobutton group rad2 <b>USER-COMMAND USR</b>,
p_prun type char1 radiobutton group rad2 default 'X'.
select-options : s_date for sy-datum <b>MODIF ID G1</b>.
selection-screen skip .
parameters : p_test type char1 as checkbox .
SELECTION-SCREEN END OF BLOCK pcode1.
at selection-screen output .
perform modify_screen .
FORM modify_screen .
loop at screen .
if p_crun eq c_x .
if screen<b>-GROUP1 = 'G1'.</b>
screen-invisible = '<b>1</b>' .
screen-active = '0' .
screen-input = '0' .
endif .
else p_prun eq c_x.
<b> if screen<b>-GROUP1 = 'G1'.</b>
screen-invisible = '<b>0</b>' .
screen-active = '1' .
screen-input = '1' .</b>
endif .
endif .
modify screen .
endloop .
endform .
Thanks,
Naren
‎2007 Jan 11 6:12 PM
Hi Naren ,
This did not work . I am working in HR ABAP . Is that a constraint ?
Can you please recheck and let me know .
Thanks ,
Daniel .
‎2007 Jan 11 6:18 PM
Hi
Try this: it works fine:
SELECTION-SCREEN BEGIN OF BLOCK PCODE1 WITH FRAME TITLE TEXT-S02.
PARAMETERS : P_CRUN TYPE CHAR1 RADIOBUTTON GROUP RAD2 USER-COMMAND AAA,
P_PRUN TYPE CHAR1 RADIOBUTTON GROUP RAD2 DEFAULT 'X'.
SELECT-OPTIONS : S_DATE FOR SY-DATUM MODIF ID SEL.
SELECTION-SCREEN SKIP .
PARAMETERS : P_TEST TYPE CHAR1 AS CHECKBOX .
SELECTION-SCREEN END OF BLOCK PCODE1.
AT SELECTION-SCREEN OUTPUT .
PERFORM MODIFY_SCREEN .
*---------------------------------------------------------------------*
* FORM modify_screen *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
FORM MODIFY_SCREEN .
LOOP AT SCREEN .
IF P_CRUN EQ 'X' .
IF SCREEN-GROUP1 EQ 'SEL' .
SCREEN-ACTIVE = '0' .
ENDIF .
ENDIF .
MODIFY SCREEN .
ENDLOOP .
ENDFORM .Max
‎2007 Jan 11 6:14 PM
Hi,
Please check the modified code..Changes are marked in bold..
SELECTION-SCREEN BEGIN OF BLOCK pcode1 WITH FRAME TITLE text-s02.
parameters : p_crun type char1 radiobutton group rad2 <b>USER-COMMAND USR</b>,
p_prun type char1 radiobutton group rad2 default 'X'.
select-options : s_date for sy-datum <b>MODIF ID G1</b>.
selection-screen skip .
parameters : p_test type char1 as checkbox .
SELECTION-SCREEN END OF BLOCK pcode1.
at selection-screen output .
perform modify_screen .
FORM modify_screen .
loop at screen .
if p_crun eq c_x .
<b>if screen-GROUP1 = 'G1'.
screen-invisible = '1' .
screen-active = '0' .
screen-input = '0' .
endif .
else p_prun eq c_x.
if screen-GROUP1 = 'G1'.
screen-invisible = '0' .
screen-active = '1' .
screen-input = '1' .
endif .</b>
endif .
modify screen .
endloop .
endform .
Thanks,
Naren
‎2007 Jan 11 6:17 PM
Hi Naren ,
Good this worked . But can you please explain me what difference this
<b>USER-COMMAND USR</b> is making .
Thanks ,
Daniel .
‎2007 Jan 11 6:17 PM
Hi DAniel,
Execute this code ,its working.
data:c_x type c value 'X'.
SELECTION-SCREEN BEGIN OF BLOCK pcode1 WITH FRAME TITLE text-s02.
parameters : p_crun type char1 radiobutton group rad2 ,
p_prun type char1 radiobutton group rad2 default 'X' .
select-options : s_date for sy-datum MODIF ID SC1.
selection-screen skip .
parameters : p_test type char1 as checkbox .
SELECTION-SCREEN END OF BLOCK pcode1.
at selection-screen output .
perform modify_screen .
FORM modify_screen .
loop at screen .
if p_crun eq c_x .
IF SCREEN-GROUP1 = 'SC1'.
screen-invisible = '0' .
screen-active = '0' .
screen-input = '0' .
endif .
endif .
modify screen .
endloop .
endform .
Check the Radiobutton p_crun ,press execute,
reward if helpful,
keerthi
‎2007 Jan 11 6:19 PM
Hi,
If you specify the USER-COMMAND, when the user presses the radio button it will immediately trigger the AT SELECTION-SCREEN & AT SELECTION-SCREEN OUTPUT..
Please reward points for helpful answers..
Thanks,
Naren
‎2007 Jan 11 6:22 PM
Hi
That Nares's saying is right, but you should consider one thing:
The select-options is defined for input/output by default, so u need code only to change this attribute and not the code to restore the default attribute.
So:
loop at screen .
if p_crun eq c_x .
if screen-GROUP1 = 'G1'.
screen-invisible = '1'. "This line is useless
screen-active = '0' . "This line is useless
screen-input = '0' .
endif .
* All the following code is done automatically
else p_prun eq c_x. "This line is useless
if screen-GROUP1 = 'G1'. "This line is useless
screen-invisible = '0'. "This line is useless
screen-active = '1' . "This line is useless
screen-input = '1' . "This line is useless
endif .
endif .
modify screen .
endloop .<u>So you need only this code</u>:
loop at screen .
if p_crun eq c_x and screen-GROUP1 = 'G1'.
screen-input = '0' .
modify screen.
endif .
endloopMax
‎2007 Jan 11 6:24 PM
Hi Daniel, Simply set the ACTIVE field. If you set the INPUT field, you will see an extra field appear next to the SELECT-OPTION that you do not want. Try this coding.
report zrich_0001.
constants: c_x type c value 'X'.
SELECTION-SCREEN BEGIN OF BLOCK pcode1 WITH FRAME TITLE text-s02.
parameters : p_crun type char1 radiobutton group rad2 user-command chk,
p_prun type char1 radiobutton group rad2 default 'X'.
select-options : s_date for sy-datum modif id SD .
selection-screen skip .
parameters : p_test type char1 as checkbox .
SELECTION-SCREEN END OF BLOCK pcode1.
*My intension is insert a code in the program which should work this way
* :
*
*When I select p_crun the select option for date filed should disappear
*from the screen and when I select p_prun the date option should appear
*so that I can enter my date range .
*
*this is the code I am using and it is not working :
at selection-screen output .
perform modify_screen .
FORM modify_screen .
loop at screen .
if p_crun eq c_x
and screen-group1 eq 'SD' .
screen-active = '0' .
endif .
if p_prun eq c_x
and screen-group1 eq 'SD' .
screen-active = '1' .
endif .
modify screen .
endloop .
endform .
Regards,
Rich Heilman
‎2007 Jan 11 6:38 PM
Hi ,
Thanks a lot Rich , Max and Naren for your valuable answers and quick response .
I have awarded ponits for all .
Once again thanks a ton .
Regards ,
Daniel .