05-03-2007 10:48 AM
Hello Friends,
I have following requirement, that I have a program which is called via a tcode. Now I have to create another tcode for the same program. I have created the new tran and it works fine. But now the requirement is, this new tran. should not show all selectoption ( inside a block ) and two another select - option block ?
As far as I remember, one can use initilization, and can loop over selection screen ? any idea how to eleiminate the selection screen ? or any docu would be really appreiciated.
Thanks..
05-03-2007 10:52 AM
Hi shah,
1. in our program either we create one selection screen,
and put all parameters/select options
for both tcodes.
Then using IF Condition, we can either hide/show the required screen elements.
2. Another way is to create two selection screens,
and call one of them, based upon the tcode value.
(Make sure, u put one screen as default if we run from se38)
regards,
amit m.
05-03-2007 11:01 AM
Thanks for your reply:
I just want to know, at which event I can loop over the screen, I mean select-option are stored in internal table sel-SIGN, sel-OPTION, sel-LOW and sel-HIGH, and I can delete the corresponding entries which I dont want to show ? or
Regards,
CAN anyone pls let me know on which event I can loop over the screen ? is it inililization ?
or its AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
ENDLOOP.
Message was edited by:
Shah H
05-03-2007 11:04 AM
Hi again,
1.CAN anyone pls let me know on which event I can loop over the screen
<b>AT SELECTION-SCREEN OUTPUT.</b>
regards,
amit m.
05-03-2007 11:09 AM
and at AT SELECTION-SCREEN OUTPUT., I can delete the entries from sel, internal table which I dont want to show ? or
Regards,
I thought the internal table which contains the select-option called sel, but when I loop over the screen, I could not see 'sel', how I can loop over the internal table which contains the select-option ?
Actually in the program there is one screen, with one main block, and inside this main block there are three further blocks, and by using the 2nd tcode, I have to eliminate few fields from first block, and both other block... any idea
Message was edited by:
Shah H
05-03-2007 11:11 AM
Hi,
Yes ..You got to write in "AT SELCTION-SCREEN OUTPUT" event only.
TO delete select-option value,Use
<b>REFRESH <Sel-option field name>.</b>
05-03-2007 11:14 AM
Hi Vigneswaran,
While looping over screen, can I see the field names as well ?
because currently I cant see the filednames, while looping over screen ?
....
05-03-2007 11:18 AM
hi again,
1. how I can loop over the internal table which contains the select-option
suppose your select-option name is ABCD.
Then loop like this.
loop at abcd.
*--- code
endloop.
2. for making invisible do something like this.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF SCREEN-NAME = 'XYZ'
OR SCREEN-NAME = 'ABC.
SCREEN-INPUT = 0.
SCREEN-INVISIBLE = 1.
MODIFY SCREEN.
ENDLOOP.
regards,
amit m.
05-03-2007 11:25 AM
Thanks ,
As I said, there is one main selection - screen with main block, ...and then are the further blocks inside, so how I can access the inside block:
SELECTION-SCREEN BEGIN OF BLOCK mainframe .
SELECTION-SCREEN SKIP 1.
SELECTION-SCREEN BEGIN OF BLOCK firstblock WITH FRAME TITLE text-001.
SELECT-OPTIONS:
lest say 4 select options.....
SELECTION-SCREEN END OF BLOCK firstblock.
SELECTION-SCREEN BEGIN OF BLOCK secondblock WITH FRAME TITLE text-002.
SELECT-OPTIONS:
lest say 4 select options.....
SELECTION-SCREEN END OF BLOCK secondblock
Prozessdaten
SELECTION-SCREEN BEGIN OF BLOCK thirdblock WITH FRAME TITLE text-003.
SELECT-OPTIONS:
lest say 4 select options.....
PARAMETERS: so_stat TYPE flag AS CHECKBOX DEFAULT 'X'.
SELECTION-SCREEN END OF BLOCK thirdblock.
PARAMETERS:
SELECTION-SCREEN END OF BLOCK mainframe.
Now my req is, when tcode is 2nd, then secondblock, and thirdblock should not appear, and from first block only 2 fields should apper....
is it at all possible, by looping over screen, because when I loop over screen, I could not even see the block name... ( the field block1 field is empty.. )
05-03-2007 11:29 AM
To me it shows, the screen-name as %_17SNS0000004792_%_%_%_%_%_%_ ?
Any idea, what I am doing wrong
05-03-2007 11:29 AM
Hi,
check out the following eg:
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: s_matnr FOR makt-matnr OBLIGATORY <b>MODIF ID gr1 .</b>SELECT-OPTIONS: s_werks FOR ekpo-werks OBLIGATORY <b>MODIF ID gr1</b>.
SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-group1 = 'GR1' or screen-name = '%B001000_BLOCK_1000'.
screen-invisible = '1'.
screen-active = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
GR1 is group1 for s_matnr,s_werks.
'%B001000_BLOCK_1000' is Block name
05-03-2007 11:40 AM
As I paste the code there is no group in selectin screen, I just want to know how I can access the various block, and their corresponding select-option fields to make them invisible ?
Regards,
05-03-2007 11:57 AM
Hi,
To access the specific block,You just got to debugg that screen in
At selection-screen output and find its name in <i>SCREEN-NAME</i> attribute.
Loop at screen.
endloop.
Eg. For the following 3 blocks,The block name is
%B001000_BLOCK_1000
%B001004_BLOCK_1000
%B001007_BLOCK_1000
SELECTION-SCREEN BEGIN OF BLOCK vv1 WITH FRAME TITLE text-001 .
SELECT-OPTIONS: s_matnr FOR makt-matnr OBLIGATORY MODIF ID gr1 .
SELECT-OPTIONS: s_werks FOR ekpo-werks OBLIGATORY MODIF ID gr1.
SELECTION-SCREEN END OF BLOCK vv1.
SELECTION-SCREEN BEGIN OF BLOCK vv2 WITH FRAME TITLE text-001 .
SELECT-OPTIONS: s_werks1 FOR ekpo-werks OBLIGATORY MODIF ID gr1.
SELECTION-SCREEN END OF BLOCK vv2.
SELECTION-SCREEN BEGIN OF BLOCK vv3 WITH FRAME TITLE text-001 .
SELECT-OPTIONS: s_werks2 FOR ekpo-werks OBLIGATORY MODIF ID gr1.
SELECTION-SCREEN END OF BLOCK vv3.
05-03-2007 12:11 PM
Hi,
Try to remember that if u dont use <i>screen group</i> option to hide the select-option field,Then u got to do like this.
AT SELECTION-SCREEN OUTPUT.
*----- To make one select-option field (say S_MATNR) invisible
*-------U have to do like this if don't use GROUP option
LOOP AT SCREEN.
IF screen-name = '%_S_MATNR_%_APP_%-TEXT' or
screen-name = '%_S_MATNR_%_APP_%-OPTI_PUSH' or
screen-name = 'S_MATNR-LOW' or
screen-name = '%_S_MATNR_%_APP_%-TO_TEXT' or
screen-name = 'S_MATNR-HIGH' or
screen-name = '%_S_MATNR_%_APP_%-VALU_PUSH' or.
screen-invisible = '1'.
screen-active = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
05-03-2007 11:16 AM
Hi,
CHECK THIS CODE.
TABLES:MARA,LFA1,EKKO.
SELECT-OPTIONS:MATNR FOR MARA-MATNR MODIF ID TR1 .
SELECT-OPTIONS:LIFNR FOR LFA1-LIFNR MODIF ID TR2.
SELECT-OPTIONS:EBELN FOR EKKO-EBELN.
AT SELECTION-SCREEN OUTPUT.
IF SY-TCODE = 'XXX'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'TR1'.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSEIF SY-TCODE = 'YYY'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'TR2'.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
RGDS,
BHARAT.