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: 

logic for Push button actions for expand and collapse...

former_member267852
Participant
0 Kudos

Hi All,

i need to place a button in the selection screen..

i am able to place a button but not able to perform actions for Expand and collapse....

help me with the logic....

Regards,

Naresh.

3 REPLIES 3

Former Member
0 Kudos

Naresh, Can you be a little more detailed. What are you trying to expand and collapse?

0 Kudos

Hi Vikram,

i have 8 radio buttons and one push button on my selection-screen.

by default, only one radio button should display...

if we click on pushbutton, it should expand and display all 8 radio buttons.

if we click second time, it should collapse and should display the 1st as default...

let me know if required more detailed...

Regards,

Naresh.

0 Kudos

Try something like below:

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.

PARAMETERS: r1 RADIOBUTTON GROUP g1 USER-COMMAND uc1,

             r2 RADIOBUTTON GROUP g1,

             r3 RADIOBUTTON GROUP g1.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN PUSHBUTTON (20) text-t01 USER-COMMAND exp.

SELECTION-SCREEN PUSHBUTTON (20) text-t02 USER-COMMAND col.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK b1.

AT SELECTION-SCREEN.

   CASE sy-ucomm.

     WHEN 'EXP'.

       LOOP AT SCREEN.

         IF screen-name = 'R2' OR screen-name = 'R3'.

           screen-active = '1'.

           screen-output = '1'.

           screen-invisible = '0'.

           MODIFY SCREEN.

         ENDIF.

       ENDLOOP.

     WHEN 'COL'.

       LOOP AT SCREEN.

         IF screen-name = 'R2' OR screen-name = 'R3'.

           screen-active = '0'.

           screen-output = '0'.

           screen-invisible = '1'.

           MODIFY SCREEN.

         ENDIF.

       ENDLOOP.

   ENDCASE.