Application Development and Automation 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: 
Read only

Hide or show selection-screen block

Former Member
0 Likes
10,289

Hi experts,

I would like to hide/show a selection screen block depending on the value entered on a list box.

I have a parameter where I should choose an entry.

PARAMETERS: p_layout AS LISTBOX VISIBLE LENGTH 15 LIKE ltdxt-variant.

In this list box, I will have to choose layout. For example, the saved layouts are Layout_1 and Layout_2.

If I choose Layout_2, an entire selection-screen block should show.

SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE text-903

PARAMETERS:     whse LIKE mseg-lgnum.

SELECT-OPTIONS: lgpla  FOR mseg-lgpla.

SELECTION-SCREEN END OF BLOCK block1.

Then if I select Layout_1 or another layout, the selection block should be invisible again.

Is this scenario possible without pressing 'Enter' or any key? Can anyone guide me how to do it?

Thanks!

Mari

Hi experts,

I would like to hide/show a selection screen block depending on the value entered on a list box.

I have a parameter where I should choose an entry.

PARAMETERS: p_layout AS LISTBOX VISIBLE LENGTH 15 LIKE ltdxt-variant.

In this list box, I will have to choose layout. For example, the saved layouts are Layout_1 and Layout_2.

If I choose Layout_2, an entire selection-screen block should show.

SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE text-903

PARAMETERS:     whse LIKE mseg-lgnum.

SELECT-OPTIONS: lgpla  FOR mseg-lgpla.

SELECTION-SCREEN END OF BLOCK block1.

Then if I select Layout_1 or another layout, the selection block should be invisible again.

Is this scenario possible without pressing 'Enter' or any key? Can anyone guide me how to do it?

Thanks!

Mari

5 REPLIES 5
Read only

Former Member
0 Likes
6,726

It is possible if you build your own screens instead of using the default report technology (screen 1000). But even then, I can't think of a way to do so without at least exiting the field.  So you'd have to TAB at the very least.

Neal

Read only

former_member209120
Active Contributor
0 Likes
6,726

Hi Mari Danielle Dinoso.


Try like this

TYPE-POOLS: vrm.

TABLES: sscrfields.

DATA: name TYPE vrm_id,
       list TYPE vrm_values,
       value LIKE LINE OF list.

data : W_AUX_FKDAT type sy-datum,
        W_VBELN type VBELN.

PARAMETERS: ps_parm AS LISTBOX VISIBLE LENGTH 10
USER-COMMAND abc.


SELECT-OPTIONS SO_FKDAT FOR W_AUX_FKDAT MODIF ID VB.
SELECT-OPTIONS SO_VBELN FOR W_VBELN MODIF ID VB1.


INITIALIZATION.


   name = 'PS_PARM'.
   value-key = '1'. value-text = 'OVERVIEW'. APPEND value TO list.
   value-key = '2'. value-text = 'DETAIL'. APPEND value TO list.

AT SELECTION-SCREEN OUTPUT.



   CALL FUNCTION 'VRM_SET_VALUES'
     EXPORTING
id     = name
       values = list.


   LOOP AT SCREEN.
     IF ps_parm = 1.
       IF screen-group1 = 'VB' OR  screen-group1 = 'VB1'.
screen-active = '0'.
       ENDIF.
       MODIFY SCREEN.
     ELSEIF ps_parm = 2.
       IF screen-group1 = 'VB' OR  screen-group1 = 'VB1'.
         screen-active = '1'.
       ENDIF.
       MODIFY SCREEN.
     ELSEIF ps_parm = space.
         IF screen-group1 = 'VB' OR  screen-group1 = 'VB1'.
          screen-active = '0'.
         MODIFY SCREEN.
       ENDIF.
     ENDIF.

   ENDLOOP.


Read only

0 Likes
6,726

Thank you again, I just tweaked the code a little and it worked perfectly. Thank you!

Read only

0 Likes
6,726

Thank You....Mari Danielle Dinoso

Read only

Former Member
0 Likes
6,726

Hi,

  You can make it Dynamic.

http://scn.sap.com/thread/39476

Regards

Ajit