‎2009 Jun 23 11:40 AM
Is it possible to design selection screen based on condition. I mean , is it possible to display different selection screen based on a particlar cond ? I tried with the code below and it did not work :
IF TCODE = 'ZSCPPAC1'.
SELECTION-SCREEN:BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS:p_var TYPE zde_variant,
p_desc TYPE zde_rdesc.
SELECTION-SCREEN:END OF BLOCK b1.
ELSE.
SELECTION-SCREEN:BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
PARAMETERS:p_var1 TYPE zde_variant.
SELECTION-SCREEN:END OF BLOCK b2.
ENDIF.
Please suggest
‎2009 Jun 23 11:42 AM
Hi,
Design the selection screen with all the fields.
However in the AT SELECTION-SCREEN event ENABLE or DISABLE the required fields using LOOP at SCREEN.
Regards,
Ankur Parab
‎2009 Jun 23 11:50 AM
Hi,
Use Modif ID for all screen fields to make the process Easier.
Regards
Karthik D
‎2009 Jun 23 11:58 AM
Hi,
SELECTION-SCREEN:BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS:p_var TYPE zde_variant MODIF ID abc,
p_desc TYPE zde_rdesc MODIF ID abc.
SELECTION-SCREEN:END OF BLOCK b1.
SELECTION-SCREEN:BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
PARAMETERS:p_var1 TYPE zde_variant MODIF ID bcd.
SELECTION-SCREEN:END OF BLOCK b2.
AT SELECTION-SCREEN OUTPUT.
IF sy-tcode = 'ZSCPPAC1'.
LOOP AT SCREEN.
IF screen-group1 = 'ABC'.
screen-active = 0.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
Regards,
Kumar Bandanadham
‎2009 Jun 23 12:01 PM
yes based on condition we can able to DISABLE or ENABLE our selection screen
define all selection fileds first with MODIF ID.
In AT-SELECTION SCREEN EVENT You can use LOOP AT SCREEN to Modify our screen.
Go through ABAP Documentation then you will come to know.....
‎2009 Jun 23 12:11 PM
Hi,
You can modify the code as below,
SELECTION-SCREEN:BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS:p_var TYPE zde_variant modif id nnn,
p_desc TYPE zde_rdesc modif id nnn.
SELECTION-SCREEN:END OF BLOCK b1.
SELECTION-SCREEN:BEGIN OF BLOCK b2 WITH FRAME TITLE text-002 modif id mmm.
PARAMETERS:p_var1 TYPE zde_variant modif id mmm.
SELECTION-SCREEN:END OF BLOCK b2.
ENDIF.
Now at AT SELECTION SCREEN OUTPUT
IF TCODE = 'ZSCPPAC1'.
loop at SCREEN.
if screen-group1 = 'mmm'.
screen-active = '0'.
modify screen.
endif.
endloop.
else.
loop at SCREEN.
if screen-group1 = 'nnn'.
screen-active = '0'.
modify screen.
endif.
endloop.
‎2009 Jun 23 12:19 PM
Hi,
Refer code, its working:-
SELECTION-SCREEN:BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS : p_var TYPE zde_variant MODIF ID abc,
p_desc TYPE zde_rdesc MODIF ID abc.
SELECTION-SCREEN:END OF BLOCK b1.
SELECTION-SCREEN:BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
PARAMETERS:p_var1 TYPE zde_variant MODIF ID def.
SELECTION-SCREEN:END OF BLOCK b2.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF sy-tcode = 'ZSCPPAC1'.
IF screen-group1 = 'ABC'.
screen-active = 1.
screen-invisible = 0.
ENDIF.
IF screen-group1 = 'DEF'.
screen-active = 0.
screen-invisible = 1.
ENDIF.
ELSE.
IF screen-group1 = 'ABC'.
screen-active = 0.
screen-invisible = 1.
ENDIF.
IF screen-group1 = 'DEF'.
screen-active = 1.
screen-invisible = 0.
ENDIF.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
Hope this helps you.
Regards,
Tarun
‎2009 Jun 23 12:22 PM
Hi,
Check this link for further link.
[http://help.sap.com/saphelp_nw04/Helpdata/EN/9f/dba70535c111d1829f0000e829fbfe/content.htm]
Please let me know if you still need any more help.
Thanks and regards,
Rajeshwar.