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

Expand and collapse functionality on selection screen

Former Member
0 Likes
1,409

Hi all ,

On my selection screen i have added two icons expand and collapse

Now what i want is when user choose expand button 4 fields should be displayed

and when collapse 4 fields should be hidden.

How do i achieve ths on selection screen?

4 REPLIES 4
Read only

Former Member
0 Likes
779

hi,

go through the sample code , in this there are 2 radiobuttons, if one is pressed then first sunscreen will come and if second radiobutton is pressed then second subscreen will come


write this where u r decleraing code for selection screen:

PARAMETERS:      par_cust     radiobutton group g1 DEFAULT 'X' USER-COMMAND sel ,
                 par_vend     radiobutton group g1.

PARAMETERS:      par_cust     radiobutton group g1 DEFAULT 'X' USER-COMMAND sel ,
                 par_vend     radiobutton group g1.


*selection criteria for venodr if par_vend radiobutton is ticked

SELECT-OPTIONS:  s_txcd1      FOR  bset-mwskz MODIF ID M1,
                 s_txcd2      FOR  bset-mwskz MODIF ID M1,
                 s_txcd3      FOR  bset-mwskz MODIF ID M1,

*selection criteria for customer if par_CUST radiobutton is ticked
                 s_txcd12     FOR  bset-mwskz MODIF ID M2,
                 s_txcd13     FOR  bset-mwskz MODIF ID M2,


*write this code at : AT SELECTION-SCREEN OUTPUT

 
AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.
IF par_vend = 'X' AND SCREEN-GROUP1 = 'M2'.
SCREEN-INPUT = 0.
SCREEN-ACTIVE = 0.
SCREEN-INVISIBLE = 1.
MODIFY SCREEN.
ENDIF.

IF par_cust = 'X' AND SCREEN-GROUP1 = 'M1'.
SCREEN-INPUT = 0.
SCREEN-ACTIVE = 0.
SCREEN-INVISIBLE = 1.
MODIFY SCREEN.
ENDIF.

ENDLOOP.

regards

rahul

Read only

Former Member
0 Likes
779

check this.......

[https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/8722] [original link is broken] [original link is broken] [original link is broken];

[http://help.sap.com/saphelp_nw04/helpdata/EN/9f/dba6aa35c111d1829f0000e829fbfe/content.htm]

Read only

Former Member
0 Likes
779

just applied loop at screen logic search in sdn you will got it

Read only

Former Member
0 Likes
779

Hi,

Try this it will definitely work for you,

TABLES sscrfields.

SELECTION-SCREEN:
  PUSHBUTTON /7(9) but1 USER-COMMAND cli1,
  PUSHBUTTON 17(9) but2 USER-COMMAND cli2.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE t1.
PARAMETERS: p_name  TYPE c LENGTH 28 MODIF ID abc,
            p_name1 TYPE c LENGTH 28 MODIF ID abc,
            p_name2 TYPE c LENGTH 28 MODIF ID abc,
            p_name3 TYPE c LENGTH 28 MODIF ID abc.
SELECTION-SCREEN END OF BLOCK b1.

DATA: fl_flag TYPE i.

INITIALIZATION.
t1 = 'TEST'.

AT SELECTION-SCREEN OUTPUT.
  IF fl_flag = 0.
    LOOP AT SCREEN.
      IF screen-group1 CS 'ABC'.
        screen-active = 0.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ELSE.
    LOOP AT SCREEN.
      IF screen-group1 CS 'ABC'.
        screen-active = 1.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.


AT SELECTION-SCREEN.
  CASE sscrfields.
    WHEN 'CLI1'.
      fl_flag = 1.
    WHEN 'CLI2'.
      fl_flag = 0.
  ENDCASE.

Thanks&Regards

Sarves