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

Dynamically Selection Screen Change

Former Member
0 Likes
1,029

Hi Experts,

I have 5 buttons on the application toolbar and on click of each button, i need to populate difference selection parameters.

I have tried modifying the SCREEN table dynamically but maintaining SCREEN table for 5 different action seems very difficult.

Can you provide any alternate to address this scenario?

Thanks

Ankur

6 REPLIES 6
Read only

Former Member
0 Likes
942

Hi ,

Go for Modulepool Programming this would surely solve your issue Else its really seems compicated.

Read only

Former Member
0 Likes
942

draw five selection-screens and call them by defined conditions.

Read only

Former Member
0 Likes
942

Hi,

Group all the selection fields acc to the screen on which you want to display.

Depending on the function code of the button, then active the corresponding group.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF screen-group1 = 'GR1'

AND sy-ucomm = <func_code>.

screen-active = 0.

ENDIF.

IF screen-group1 = 'GR2'

AND su-ucomm = <func_code>.

screen-active = 0.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

In case of any clarifications, please revert back.

Hope this will help you.

Regards

Natasha Garg

Read only

Former Member
0 Likes
942

Hi,

in Report program, Function code doesnt get available in SY-UCOMM,

you need to look structure "sscrfields" at runtime for function code.

As suggested above to go for Module Pool program, if you want to stick to Report only then go for tab strips corresponding to each button.

Tab Strip will be easily managed and will provide you the selection corresponding to each tab.

Thank you

Depesh

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
942

Hi Ankur,

An easy approach do this is to go for Module Pool Programming.

To include selection screen parameters take few radiobuttons as per your requirement and then include/exclude parameters for selection using:-


loop at screen.
  "code
  modify screen.
endloop.

Take the function group for radiobuttons as 'CS' and function type as 'S'.

Hope this solves your problem.

Thanks & Regards,

Tarun Gambhir

Read only

Former Member
0 Likes
942

hi ,

try this..

in this text boxes are displays and disapper on the selection of radio button.....




*&---------------------------------------------------------------------*
*& Report  Z_TG_LOOP
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  z_tg_loop.

DATA : rb1(1) VALUE 'X',
       rb2(1).

CALL SCREEN 8000.
*&---------------------------------------------------------------------*
*&      Module  STATUS_8000  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE status_8000 OUTPUT.
*  SET PF-STATUS 'xxxxxxxx'.
*  SET TITLEBAR 'xxx'.

  IF rb1 EQ 'X'.
    LOOP AT SCREEN.
      IF ( screen-group1 EQ 'ABC' ).
        screen-invisible = 0.
        screen-active = 1.
      ELSEIF ( screen-group1 EQ 'DEF' ).
        screen-invisible = 1.
        screen-active = 0.
      ENDIF.
      MODIFY SCREEN.
    ENDLOOP.
  ELSE.
    LOOP AT SCREEN.
      IF ( screen-group1 EQ 'DEF' ).
        screen-invisible = 0.
        screen-active = 1.
      ELSEIF ( screen-group1 EQ 'ABC' ).
        screen-invisible = 1.
        screen-active = 0.
      ENDIF.
      MODIFY SCREEN.
    ENDLOOP.
  ENDIF.

ENDMODULE.                 " STATUS_8000  OUTPUT

*&---------------------------------------------------------------------*
*&      Module  MODIFY  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE modify INPUT.

  IF rb1 EQ 'X'.
    LOOP AT SCREEN.
      IF ( screen-group1 EQ 'ABC' ).
        screen-invisible = 0.
        screen-active = 1.
      ELSEIF ( screen-group1 EQ 'DEF' ).
        screen-invisible = 1.
        screen-active = 0.
      ENDIF.
      MODIFY SCREEN.
    ENDLOOP.
  ELSE.
    LOOP AT SCREEN.
      IF ( screen-group1 EQ 'DEF' ).
        screen-invisible = 0.
        screen-active = 1.
      ELSEIF ( screen-group1 EQ 'ABC' ).
        screen-invisible = 1.
        screen-active = 0.
      ENDIF.
      MODIFY SCREEN.
    ENDLOOP.
  ENDIF.

ENDMODULE.                 " MODIFY  INPUT