01-30-2008 12:33 AM
Hi All,
Is there a way to hide the parameters initially on the screen and only showing them when another field is selected?
For example, when I click on "range" then I want to to display two fields....start date and end date.
Thanks,
~Mark
01-30-2008 12:46 AM
Hi Mark
If the click you are referring to is on a check box or radio button, yes we can do it. But if selection are to be invoked when you click on label, i think it may not be possible.
An example on a possible scenario is:
parameters: p_rd1 radiobutton group rad1 default 'X' user-command but,
p_rd2 radiobutton group rad1,
p_text type char128 obligatory.
at selection-screen output.
loop at screen.
if screen-name CP '*P_TEXT*'.
if not p_rd1 is initial.
screen-active = 1.
screen-required = 1.
else.
screen-active = 0.
screen-required = 0.
endif.
modify screen.
endif.
endloop.
Regards
Eswar
01-30-2008 12:41 AM
Hi Mark
In the selection screen
you can use the code
AT SELECTION-SCREEN OUTPUT.
IF pa_equip <> 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'I1'.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
IF pa_logic <> 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'I2'.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
You will get many examples if you search the forum.
01-30-2008 12:46 AM
Hi Mark
If the click you are referring to is on a check box or radio button, yes we can do it. But if selection are to be invoked when you click on label, i think it may not be possible.
An example on a possible scenario is:
parameters: p_rd1 radiobutton group rad1 default 'X' user-command but,
p_rd2 radiobutton group rad1,
p_text type char128 obligatory.
at selection-screen output.
loop at screen.
if screen-name CP '*P_TEXT*'.
if not p_rd1 is initial.
screen-active = 1.
screen-required = 1.
else.
screen-active = 0.
screen-required = 0.
endif.
modify screen.
endif.
endloop.
Regards
Eswar
01-30-2008 12:54 AM
Thanks for your reply Eswar.
This code will hide the entire screen and not the specific fields? How do I hide just the fields?
~Mark
01-30-2008 12:57 AM
Mark in my example above am doing the manipulations only to parameter P_TEXT.
Check another example:
PARAMETERS: p_chb AS CHECKBOX USER-COMMAND chb,
p_file TYPE localfile.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-name CP '*P_FILE*'.
IF p_chb IS INITIAL.
screen-active = 0.
ELSE.
screen-active = 1.
ENDIF.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
To have a better feel, execute in a temporary program.
Regards
Eswar
01-30-2008 1:01 AM
Thanks I got it. I missed online.
So initially when the checkbox is not checked the other field does not appear, then when I make it checked can I make the field appear dynamically?
Thanks,
~Mark
01-30-2008 1:04 AM
01-30-2008 1:18 AM
01-30-2008 1:42 AM
01-30-2008 5:00 PM
*SELECT-OPTIONS
SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE frametxt.
Parameter: cttyp type p0016-cttyp.
SELECT-OPTIONS: s_date for p0016-aedtm NO-extension.
SELECTION-SCREEN END OF BLOCK block1.
SELECTION-SCREEN BEGIN OF BLOCK block2 WITH FRAME TITLE frame.
parameters: Test as checkbox.
parameters: m_run as checkbox.
Parameters: st_date type p0016-begda MODIF ID MOD.
Parameters: en_date type p0016-endda.
SELECTION-SCREEN END OF BLOCK block2.
*AT SELECTION-SCREEN OUTPUT.
Loop at Screen.
if m_run is initial.
if Screen-name CP 'st_date'.
Screen-active = 0.
screen-required = 0.
ELSE.
screen-active = 1.
Endif.
modify screen.
endif.
Endloop.
01-30-2008 3:02 AM
MArk,
EX:
PARAMETERS: p_chb AS CHECKBOX USER-COMMAND chb,
p_sdate LIKE sy-datum MODIF ID mod,
p_edate LIKE sy-datum MODIF ID mod.
AT SELECTION-SCREEN OUTPUT.
IF p_chb NE 'X'.
LOOP AT SCREEN.
IF screen-group1 EQ 'MOD'.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSE.
IF p_chb NE 'X'.
LOOP AT SCREEN.
IF screen-group1 EQ 'MOD'.
screen-active = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
Don't forget to reward if useful...