Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

display different selection scrren based on the input in the initial screen

Former Member
0 Kudos

Hi,

My requirement is that i need to call two new selecetion screens based on the value entered in the Fisrt selection screen.

Selection screen 1.

p_abcd(8) as list box values 'ZABC' & 'ZXYZ'.

if the user selects ZABC in the list box , then a new selection screen has to be displayed,

if he selects ZXYZ in the list box, a different selection screen has to be displayed.

Can you please tell how this is achieved.?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi sibi

try like this

PARAMETERS : p_abcd(8) LIKE z0322_plan-pname AS LISTBOX VISIBLE LENGTH 20 USER-COMMAND db1 values 'ZABC' & 'ZXYZ'

at selection-screen.

case sy-ucomm 'DIA'.

if p_abcd = 'ZABC'.

call selection-screen 9000.

elseif p_abcd = 'ZXYZ'.

call selection-screen 9001.

endif.

regards

baskaran.

Message was edited by:

baskaran nagamanickam

4 REPLIES 4

Former Member
0 Kudos

use event AT SELECTION-SCREEN OUTPUT

give some MODIF ID to each selection screen component

in this event loop ta screen and check for perticular list box selection...

if ABC is selected then make corresponding selection-screen parameters active..

i.e. set their screen parameters

e.g.

LOOP AT SCREEN.

IF screen-group1 = 'SC2' .

screen-input = '0'.

screen-active = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

same way write code for all the list box contents.

Former Member
0 Kudos

Hi SIBI,

Try this,

In first screen :

If p_abcd eq ZABC.

call selection-screen 2.

else.

call selection-screen 3.

endif.

Thanks,

Reward If Helpful.

Former Member
0 Kudos

hi sibi

try like this

PARAMETERS : p_abcd(8) LIKE z0322_plan-pname AS LISTBOX VISIBLE LENGTH 20 USER-COMMAND db1 values 'ZABC' & 'ZXYZ'

at selection-screen.

case sy-ucomm 'DIA'.

if p_abcd = 'ZABC'.

call selection-screen 9000.

elseif p_abcd = 'ZXYZ'.

call selection-screen 9001.

endif.

regards

baskaran.

Message was edited by:

baskaran nagamanickam

Former Member
0 Kudos

Hi Sibi Babu,

Use the below code.

tables: pa0000, pa0001.

type-pools : vrm. "Value Request Manager

parameters: p_test as listbox visible length 12 obligatory modif id ggg user-command rusr.

selection-screen: skip 2.

selection-screen: begin of block blk1 with frame.

select-options: s_pernr for pa0000-pernr modif id abc.

selection-screen: end of block blk1.

*selection-screen: skip 2.

selection-screen: begin of block blk2 with frame.

select-options: s_stat2 for pa0000-stat2 modif id def.

select-options: s_werks for pa0001-werks modif id def.

selection-screen: end of block blk2.

initialization.

perform f4_value_request.

at selection-screen output.

loop at screen.

if p_test = '1'.

if screen-group1 = 'ABC'.

screen-active = 1.

else.

if not screen-group1 = 'GGG'.

screen-active = 0.

endif.

endif.

elseif p_test = '2'.

if screen-group1 = 'DEF'.

screen-active = 1.

else.

if not screen-group1 = 'GGG'.

screen-active = 0.

endif.

endif.

endif.

modify screen.

endloop.

start-of-selection.

write p_test.

&----


*& Form f4_value_request

&----


  • text

----


form f4_value_request.

data: l_name type vrm_id,

li_list type vrm_values,

l_value like line of li_list.

l_value-key = '1'.

l_value-text = 'ZABC'.

append l_value to li_list.

clear l_value.

l_value-key = '2'.

l_value-text = 'ZXYZ'.

append l_value to li_list.

clear l_value.

l_name = 'P_TEST'.

p_test = '1'. "this is to set the default value of the list box.

call function 'VRM_SET_VALUES'

exporting

id = l_name

values = li_list

exceptions

id_illegal_name = 1

others = 2.

if sy-subrc <> 0.

message id sy-msgid type sy-msgty number sy-msgno

with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

endif.

endform. " f4_value_request