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

Problem in Dynamic screen

EkanshCapgemini
Active Contributor
0 Likes
1,754

Hi,

I am having trouble in dynamic screen creation. When I choose a field as a parameter and use screen-invisible = 1 , it works fine with me and the field & selection text both get hide. But when I choose it as select-options, the selection text gets hide but not the fields. The fields are still being shown.

Here is my code:

SELECTION-SCREEN BEGIN OF BLOCK B WITH FRAME TITLE TEXT-002.

SELECT-OPTIONS: KUNNR FOR KNA1-KUNNR,             

                               PRCTR FOR BSID-PRCTR,               

                               UMSKZ FOR BSID-UMSKZ.

SELECTION-SCREEN END OF BLOCK B.

SELECTION-SCREEN BEGIN OF BLOCK C WITH FRAME TITLE TEXT-003.

PARAMETERS: OS    RADIOBUTTON GROUP GP1 DEFAULT 'X' USER-COMMAND FLAG,   

                          AGING RADIOBUTTON GROUP GP1,                                 

                          ADV_AG RADIOBUTTON GROUP GP1.                             

SELECTION-SCREEN END OF BLOCK C.

AT SELECTION-SCREEN OUTPUT.

   IF OS = 'X'.

     LOOP AT SCREEN.

       IF screen-name = 'UMSKZ' or

          screen-name = '%_UMSKZ_%_APP_%-TEXT' .

         screen-active = '0'.

         screen-input = '0'.

         screen-output = '0'.

         screen-invisible = '1'.

         MODIFY SCREEN.

       ENDIF.

     ENDLOOP.

   ENDIF.




1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,708

Hi, try this if help you:

     LOOP AT SCREEN.

IF screen-name = 'UMSKZ-LOW' or

screen-name = 'UMSKZ-HIGH' or

          screen-name = '%_UMSKZ_%_APP_%-TEXT' .

         screen-active = '0'.

         screen-input = '0'.

         screen-output = '0'.

         screen-invisible = '1'.

         MODIFY SCREEN.

15 REPLIES 15
Read only

Former Member
0 Likes
1,708

Hi ekansh,

Try screen-active = 0. yo hide and 1 to show.

regards

vaibhav

Read only

0 Likes
1,708

Hi vaibhav,

I am already using screen-active = 0. but it is of no help in my scene.

Read only

0 Likes
1,708

Hi ekansh

Are you writing this in PBO or PAI ?

regards

vaibhav

Read only

0 Likes
1,708

in PBO

Read only

Former Member
0 Likes
1,708

Hi Ekansh,

Refer below:

We can Hide parameter / select option in selection screen dynamically by manipulating screen object.

SCREEN is like an internal table with a header line. However, you do not have to declare it in your program. Go to debugging mode and then view structure of screen.

You can modify SCREEN in your ABAP program during the PBO event of a screen. Its contents override the static attributes of the screen fields for a single screen call. The only statements that you can use with SCREEN are:


LOOP AT SCREEN.
...
MODIFY SCREEN.
...
ENDLOOP.

We can hide parameter by set screen-active to 0.
Here is example of how to hide parameter in selection screen. Write it, and change click on radiobutton to hide parameter.


REPORT ZAALGAL0006.

DATA: d_ucomm LIKE sy-ucomm.

PARAMETERS: p_grpa1(10) MODIF ID A,
p_grpa2(5) MODIF ID A,
p_grpb1(2) MODIF ID B.

PARAMETERS: p_actA RADIOBUTTON GROUP rad1 USER-COMMAND ACT DEFAULT 'X',
p_actB RADIOBUTTON GROUP rad1.

AT SELECTION-SCREEN.
d_ucomm = sy-ucomm.

AT SELECTION-SCREEN OUTPUT.
LOOP AT screen.
IF p_actA = 'X'.
IF screen-group1 = 'B'.
screen-active = 0.
ENDIF.
ELSEIF p_actB = 'X'.
IF screen-group1 = 'A'.
screen-active = 0.
ENDIF.
ENDIF.
MODIFY screen.
ENDLOOP.

START-OF-SELECTION.
Read only

Former Member
0 Likes
1,708

Hi Ekansh,

This might also be useful:

Other than the NO-DISPLAY option you can also do the following...

select-options: so_os for zwimo_status-code0 modif id os.


AT SELECTION-SCREEN OUTPUT.
    LOOP AT SCREEN.
      CASE screen-group1.
        WHEN 'OS'.
          screen-active = '0'.
          MODIFY SCREEN.
      ENDCASE.
    ENDLOOP.

Read only

Former Member
0 Likes
1,709

Hi, try this if help you:

     LOOP AT SCREEN.

IF screen-name = 'UMSKZ-LOW' or

screen-name = 'UMSKZ-HIGH' or

          screen-name = '%_UMSKZ_%_APP_%-TEXT' .

         screen-active = '0'.

         screen-input = '0'.

         screen-output = '0'.

         screen-invisible = '1'.

         MODIFY SCREEN.

Read only

0 Likes
1,708

hi Fabrizio Ballante,

Thanks for the help. The fields got hide but still there is the icon of multiple selection. What to do to hide this icon as well.

Read only

0 Likes
1,708

Hi Ekansh,

You can try the below code

LOOP AT SCREEN.

CHECK   screen-name = 'UMSKZ-LOW'

OR     screen-name = 'UMSKZ-HIGH'

         screen-active = 0.

         screen-invisible = 1.

         MODIFY SCREEN.

ENDLOOP.

Read only

0 Likes
1,708

Hi ankit,

the button is still there.

Read only

0 Likes
1,708

Hi, maybe you can't hide, but if you don't need at all, you can try this:

declare your select-options with no-intervals

UMSKZ FOR BSID-UMSKZ no-intervals.


Read only

0 Likes
1,708

i need this field but it should hide in that certain case as i stated in my code.

Read only

0 Likes
1,708

Thanks a lot for the help. it seems it is mandatory to specify MODIF ID in case of select-option. BTW thanks for the help.

Read only

former_member491621
Contributor
0 Likes
1,708

Hi Ekansh,

You can declare your select-options as

SELECT-OPTIONS UMSKZ FOR BSID-UMSKZ MODIF id G1

LOOP AT SCREEN.

CHECK   screen-group1 = 'G1'.

          screen-active = 0.

          screen-input  = 0.

         screen-invisible = 1.

         MODIFY SCREEN.

ENDLOOP.

Read only

Former Member
0 Likes
1,708

SELECT-OPTIONS: KUNNR FOR KNA1-KUNNR,            

                               PRCTR FOR BSID-PRCTR,              

                               UMSKZ FOR BSID-UMSKZ MODIF ID g1.

loop at screen.

   IF screen-group1 = 'G1' .

         screen-active = '0'.

         screen-input = '0'.

         screen-output = '0'.

         screen-invisible = '1'.

         MODIFY SCREEN.

       ENDIF.

     ENDLOOP.