‎2009 Oct 05 7:21 AM
Hi to all experts,
My requirement is to generated different selection screens for different tcodes
most of the selection screens is same
just need to have different file for differnt tcodes
for example
Appraisal period (select options) -
same
upload
file1 -
file name (change according tcode)----tcode1
file2 -
file name (change according tcode)----tcode2
file3 -
file name (change according tcode)----tcode3
test run.(same for all )
i tried this but getting error as program not found
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.
SELECT-OPTIONS: s_appr FOR sy-datum OBLIGATORY.
SELECTION-SCREEN end OF BLOCK b2.
SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.
SELECTION-SCREEN COMMENT 1(20) text-006.
PARAMETERS: c_mode as CHECKBOX,
p_file(128) TYPE c.
SELECTION-SCREEN END OF SCREEN 100.
SELECTION-SCREEN BEGIN OF SCREEN 200 AS SUBSCREEN.
SELECTION-SCREEN COMMENT 1(20) text-006.
PARAMETERS: c_mode1 as CHECKBOX ,
p_file1(128) TYPE c.
SELECTION-SCREEN END OF SCREEN 200.
SELECTION-SCREEN BEGIN OF SCREEN 300 AS SUBSCREEN.
SELECTION-SCREEN COMMENT 1(20) text-006.
PARAMETERS: c_mode2 as CHECKBOX ,
p_file2(128) TYPE c.
SELECTION-SCREEN END OF SCREEN 300.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME.
PARAMETERS : c_test AS CHECKBOX DEFAULT 'X'.
SELECTION-SCREEN END OF BLOCK b3.
SELECTION-SCREEN BEGIN OF TABBED BLOCK tab1 FOR 8 LINES.
SELECTION-SCREEN END OF BLOCK tab1.
NODES: peras.
*infotypes
infotypes :0001,
9005.
AT SELECTION-SCREEN OUTPUT.
***
CASE sy-tcode.
WHEN 'ZHR005'.
tab1-dynnr = '100'.
WHEN 'ZHR010'.
tab1-dynnr = '200'.
WHEN OTHERS.
tab1-dynnr = '300'.
ENDCASE.
‎2009 Oct 05 7:41 AM
no need to do so much thing.
check this:
SELECT-OPTIONS: s_appr FOR sy-datum OBLIGATORY.
PARAMETERS : p1 type char40.
at SELECTION-SCREEN OUTPUT.
clear p1.
LOOP AT SCREEN.
case sy-tcode.
when 'ZTEST_111'.
p1 = 'C:\file1.txt'.
when 'ZTEST_123'.
p1 = 'D:\file1.txt'.
ENDCASE.
MODIFY SCREEN. " actually this is not needed in this case :)
ENDLOOP.
‎2009 Oct 05 7:41 AM
no need to do so much thing.
check this:
SELECT-OPTIONS: s_appr FOR sy-datum OBLIGATORY.
PARAMETERS : p1 type char40.
at SELECTION-SCREEN OUTPUT.
clear p1.
LOOP AT SCREEN.
case sy-tcode.
when 'ZTEST_111'.
p1 = 'C:\file1.txt'.
when 'ZTEST_123'.
p1 = 'D:\file1.txt'.
ENDCASE.
MODIFY SCREEN. " actually this is not needed in this case :)
ENDLOOP.
‎2009 Oct 05 7:52 AM
Hi,
If you are using tabbed block you have to do provide a default sunscreen to the tabbed screen
SELECTION-SCREEN BEGIN OF TABBED BLOCK block1 FOR n LINES.
SELECTION-SCREEN TAB TAB1 USER-COMMAND utab DEFAULT sy-cprog SCREEN screen number.
SELECTION-SCREEN END OF BLOCK block1.
a better way in my view would be to call the screens in the selection screen after teh initial value has been entered.
at selection-screen.
after the value for the mandatory field has been entered
if sy-tcode = tcode1.
call screen 100
else.
call screen 200.
endif.
Regards,
Himanshu