cancel
Showing results for 
Search instead for 
Did you mean: 

expand/compress the selection screen attributes

Former Member
0 Kudos

Friends,

I do have a requirement that, on my selection screen i want to arrange a push button and when the user selects the function, i want to display certain selection fields.

On the initial execution of the program i want to display certain no. of fields and when the user clicks the push button, i want to display the hidden selection fields as well.

Any inputs on this?

Thanks in advance.

Bill Joseph

Accepted Solutions (0)

Answers (6)

Answers (6)

andreas_mann3
Active Contributor
0 Kudos

Hi Bill,

try that code :

SELECTION-SCREEN PUSHBUTTON /1(20) text-040 USER-COMMAND com1.
DATA cflag.

AT SELECTION-SCREEN.
  IF sy-ucomm = 'COM1'.
    cflag = 1.
  ENDIF.

AT SELECTION-SCREEN OUTPUT.
  IF cflag = 1.
    LOOP AT SCREEN .
      IF screen-name cs  'FLD1'.
        screen-active = 0.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.

Andreas

Former Member
0 Kudos

You can do it in a very simple way . Just try this code below. To all selction fields you want to enable on button press assign to a MODIF ID .

tables sscrfields.

data ok_code like sy-ucomm.

selection-screen pushbutton /10(20) P1 user-command SEL.

Parameter Ptest1(10).

Parameter Ptest2(10) modif id MOD.

At Selection-screen output.

loop at screen.

check screen-group1 eq 'MOD'.

if ok_code = 'SEL'.

screen-active = 1.

else.

screen-active = 0.

endif.

modify screen.

endloop.

at selection-screen.

ok_code = sscrfields-ucomm .

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Create a subscreen and call the same after the pushbutton is pressed.

Former Member
0 Kudos

Hi,

You can use MODIF ID TST and then use LOOP AT SCREEN technique to hide/show these fields..Also set a flag when then pusch button is clicked (<your flag> = 'X')

For example,

PARAMETERS: p_matnr LIKE VBAK-MATNR MODIF ID TST,

p_audat LIKE VBAK-AUDAT MODIF ID TST.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF screen-group1 EQ 'TST' AND <your flag> EQ 'X'.

screen-active = 0.

MODIFY SCREEN.

ELSE.

screen-active = 1.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Hope this helps..

Sri

Former Member
0 Kudos

Hi ..

Declare a subscreen with the hidden fields and when the user clicks the push buttom. Call that sub screen.

With Regards,

Ranganathan.

Former Member
0 Kudos

Pushbutton,

Refer Program: RPLICO10

Check this link too

http://www.sapdevelopment.co.uk/reporting/selscr/selscrhome.htm

U can modify the screen

AT SELECTION SCREEN OUTPUT ON XXX.

perform ...

Check this link for sample code.

Hope this helps.