‎2007 Jul 16 8:07 AM
Hi all,
I am new to ABAP. I am creating a prog. in which i am using Case-EndCase.
Code:
PARAMETERS: CH TYPE I.
CASE CH.
WHEN 1.
WRITE: 'I AM CASE 1'.
WHEN 2.
Parameter : string1(20) type c , string2(20) type c .
if string1 ca string2 .
write : ' contain any '.
elseif string1 co string2 .
write : 'Contain only'.
else .
write : 'doesnot contain '.
endif.
ENDLOOP.
ENDCASE.
In this Code i want screen should ask for parameters only when i enter choice = 2. but it is asking for all parameters without entering choice.
Pls. help me out.
Any Help willl be rewarded.
<b>Sachin</b>
‎2007 Jul 16 8:12 AM
Hi,
All PARAMTERS will be displayed in any case you need to hide them using SCREEN structure modifications.
What you can do is.
WRITE YOUR CODE to hide and display the fields in the event block
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF CH = 1.
CHECK SCREEN-NAME = 'STRING1' OR SCREEN-NAME = 'STRING2'.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ELSEIF CH = 2.
CHECK SCREEN-NAME = 'STRING1' OR SCREEN-NAME = 'STRING2'.
SCREEN-ACTIVE = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
Regards,
Sesh
‎2007 Jul 16 8:12 AM
Hi,
All PARAMTERS will be displayed in any case you need to hide them using SCREEN structure modifications.
What you can do is.
WRITE YOUR CODE to hide and display the fields in the event block
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF CH = 1.
CHECK SCREEN-NAME = 'STRING1' OR SCREEN-NAME = 'STRING2'.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ELSEIF CH = 2.
CHECK SCREEN-NAME = 'STRING1' OR SCREEN-NAME = 'STRING2'.
SCREEN-ACTIVE = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
Regards,
Sesh
‎2007 Jul 16 8:12 AM
I think you cannot that kind of things.
Luckily, you will be able to CALL SELECTION-SCREEN xxxx. (look help at this sentence).
Or you can use any FM to get values (check SE37 for POPUPGET*)
‎2007 Jul 16 8:13 AM
Need to write the code at the event AT SELECTION-SCREEN OUTPUT for these parameters and modify the screen as per the option entered.Something like..
Loop at screen.
....
Endloop.