on 01-10-2008 10:15 AM
I've created a selection screen. On this i've got a field (pr_inpt) depending on whose value i have to display the rest select-options viz. (so_c1, so_n1, so_d1, so_t1) say ,
1.)if (pr_inpt) contains value 'A' then display (so_c1 & so_d1)
2.)if (pr_inpt) contains value 'B' then display (so_n1, so_d1 & so_t1)
To achieve it, in the initialization event, i looped at the screen and for all (so_c1, so_n1, so_d1, so_t1) i made screen-active = '0'. Due to this my objective to hide fields in the beginning is achieved.
Next when user is entering value into (pr_inpt), i am making screen-active = '1' at selection-screen output event, for those relevant select-options (say if A, then made active for so_c1 & so_d1) but my problem is that it is making all select-options (so_c1, so_n1, so_d1, so_t1) visible on the screen which i don't want.
How can i achieve this, also is it possible to change the label of the select-options while displaying.
Kindly suggest.
Hi Praveen,
For this functionality you should loop on SCREEN in the code for the event
AT SELECTION SCREEN OUTPUT.
and for the select options and text you want to make invisible set them as invisible and modify the table screen.
Check if you haven't missed modify screen at any point...
There are many different elements for select-options, hence it's better you assign modif-id to each select options (say M1, M2, M3 and M4) and check screen-group1 = M1 (M2, or M3 or M4)...
Also put screen-active = '1'
screen-invisibile = '0'
modify screen
for those you want to make visible.
*Exclusively you have to mention screen-active = '0'
or you must use screen-invisible = '1' *
Follow the below syntax.This will help you in understanding it much better.
parameteres: pr_inpt.
select-options:so_c1,
so_n1,
so_d1,
so_t1 .
If pr_inpt = 'A'.
loop at screen.
if screen-name = 'so_c1' .
screen-input = 1.
endif.
if screen-name = 'so_d1'.
screen-input = 1.
endif.
modify screen.
endloop.
endif.
If pr_inpt = 'B'.
loop at screen.
if screen-name = 'so_n1' .
screen-input = 1.
endif.
if screen-name = 'so_d1'.
screen-input = 1.
endif.
if screen-name = 'so_t1'.
screen-input = 1.
endif.
modify screen.
endloop.
endif.
Hope this will solve your query.
Revert if you come across any more issues.
Kindly reward if helpful.
Regards,
Jose
Edited by: Jose Anthony Reddy on Jan 11, 2008 12:16 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All, Thanks for your replies,
The codes sent by Kalyan and Jose worked properly.
Thanks for the help guys.
Regards,
Jose
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi praveen ,
The below code might helpful.
TABLES : vbak.
PARAMETERS pr_inpt TYPE c.
SELECT-OPTIONS : so_c1 FOR vbak-vbeln MODIF ID GR1.
SELECT-OPTIONS : so_d1 FOR vbak-vbeln MODIF ID GR2.
SELECT-OPTIONS : so_n1 FOR vbak-vbeln MODIF ID GR3.
select-options : so_t1 FOR vbak-vbeln MODIF ID GR3.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-group1 EQ 'GR1'.
IF pr_inpt EQ 'A'.
screen-active = 1.
screen-invisible = 0.
ELSE.
screen-active = 0.
screen-invisible = 1.
ENDIF.
MODIFY SCREEN.
elseif screen-group1 eq 'GR3'.
IF pr_inpt EQ 'B'.
screen-active = 1.
screen-invisible = 0.
ELSE.
screen-active = 0.
screen-invisible = 1.
ENDIF.
MODIFY SCREEN.
ENDIF.
IF screen-group1 EQ 'GR2'.
IF pr_inpt EQ 'A' OR pr_inpt EQ 'B' .
screen-active = 1.
screen-invisible = 0.
ELSE.
screen-active = 0.
screen-invisible = 1.
ENDIF.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
I have tested this code it works.Please check.
For your second question.
In SE38 goto > Textelements > Selection texts
Here you can give text for your selectoptions and parameters.
Regards,
Kalyan.
Edited by: Kalyan on Jan 10, 2008 5:56 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi praveen,
try this piece of code it may be helpful to u
at selection-screen output.
if pr_inpt = 'A'.
loop at screen.
screen-active = '1'.
screen-input = 0.
modify screen.
endloop.
elseif pr_inpt = 'B'.
loop at screen.
screen-active = '1'.
screen-input = 0.
modify screen
endloop.
endif.
try grouping the select-options so_c1 and so_d1 and give it atry
regards,
sravanthi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Your second question is answered. For the first one, please refer to this link with an useful example:
http://help.sap.com/saphelp_47x200/helpdata/en/79/34a234d9b511d1950e0000e8353423/content.htm
Moreover, for complete information about Selection Screen Processing, refer to:
http://help.sap.com/saphelp_47x200/helpdata/en/56/1eb6c705ad11d2952f0000e8353423/content.htm
I hope it will help you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi praveen,
ia can help u regarding changing the label of select-options while diplaying.
this can be done as:
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE t01.
-
-
SELECTION-SCREEN END OF BLOCK b1.
in the menu -> go to -> textelements ->selection texts -> here you can give the desired name of any length.
reward if helpful
regards,
sravanthi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.