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

explanation regarding loop at screen

former_member219850
Participant
0 Likes
2,453

hiee everyone,

I am new into abap.

I am not getting the theory of screen table.

I wish to have clarification on functions of screen-group 1 to screen-group4.

When the screen groups 2 to 4 comes in picture???..

thanx

1 ACCEPTED SOLUTION
Read only

former_member196651
Contributor
0 Likes
1,910

Hi Darshan,

What we had explained above is for Modulepool Screens. In case of selection screens, we will be able to give the screen group using MODIF ID. Moreover I don't think that it will be possible to assign more than one group for a field in selection screen.

Regards,

Abijith

5 REPLIES 5
Read only

Former Member
0 Likes
1,910

Hi,

A field on the SCREEN have different attributes. You can see them when you double click a field in SE51 for a screen. All the screen attributes for these fields will be available during run-time in "SCREEN" internal table.

The field groups attribute helps the program to group fields together. Eg: you can make a  group of fields editable/display/ invisible etc..using "SCREEN Modification.

You could get more information on these on F1 help on "LOOP AT SCREEN", F1 help on field group in SE51, also search in SCN.

Br,

Maju

Read only

former_member196651
Contributor
0 Likes
1,910

Hi Darshan,

As the name suggest, GROUP is used to group the screen fields together for modifying the screen properties together. For example, if we want to hide 2 button in the screen, then in the properties screen of the buttons, give a name in group1 as GP1. Then in PBO, within LOOP AT SCREEN we can make use of SCREEN-GROUP1 = 'GP1' and make the fields as invisible.

It possible to add a screen field into up to 4 groups. That is why we are having 4 groups.

Regards,

Abijith

Read only

0 Likes
1,910

this is a sample code.


can you please tell me when the group 2 and group 4 will come in picture??



SELECTION-SCREEN BEGIN OF BLOCK MAIN.

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

SELECTION-SCREEN SKIP 1.

PARAMETERS: CUST RADIOBUTTON GROUP RND USER-COMMAND TEST DEFAULT 'X',

             VEND  RADIOBUTTON GROUP RND.

SELECTION-SCREEN END OF BLOCK B1.

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

SELECTION-SCREEN SKIP 1.

SELECT-OPTIONS:

S_KUNNR FOR KNB1-KUNNR MODIF ID MD1,

S_COMPCO FOR KNB1-BUKRS MODIF ID MD1,

S_SALORG FOR KNVV-VKORG MODIF ID MD1,

S_ACCOGR FOR KNA1-KTOKD MODIF ID MD1.

SELECTION-SCREEN END OF BLOCK B2.

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

SELECTION-SCREEN SKIP 1.

SELECT-OPTIONS:

  S_LIFNR FOR LFB1-LIFNR MODIF ID MD2,

  S_VCOMCO FOR LFB1-BUKRS MODIF ID MD2,

  S_VSALOG FOR LFM1-EKORG MODIF ID MD2,

  S_VACCOG FOR LFA1-KTOKK MODIF ID MD2.

SELECTION-SCREEN END OF BLOCK B3.

SELECTION-SCREEN BEGIN OF BLOCK B4 WITH FRAME TITLE TEXT-005.

PARAMETERS: S_DIS1 AS CHECKBOX DEFAULT GC_FOR_X  USER-COMMAND CHECK1.

PARAMETERS: S_DOWN1 AS CHECKBOX USER-COMMAND CHECK2.

SELECTION-SCREEN END OF BLOCK B4.

SELECTION-SCREEN BEGIN OF BLOCK B5 WITH FRAME TITLE TEXT-006.

PARAMETERS: CUSTFILE LIKE IBIPPARMS-PATH DEFAULT CUSTFILEPATH MODIF ID MD3.

SELECTION-SCREEN END OF BLOCK B5.

SELECTION-SCREEN BEGIN OF BLOCK B6 WITH FRAME TITLE TEXT-007.

PARAMETERS: VENDFILE  LIKE IBIPPARMS-PATH DEFAULT VENDFILEPATH MODIF ID MD4.

SELECTION-SCREEN END OF BLOCK B6.

SELECTION-SCREEN END OF BLOCK MAIN.



FORM AT_SCREEN_EVENTS.

   LOOP AT SCREEN.

     CHECK SCREEN-GROUP1 = 'MD1'  OR SCREEN-GROUP1 = 'MD2' " MD1 AND MD2 ARE MODIF ID NUMBERS

     IF CUST          = GC_FOR_X.

       IF SCREEN-GROUP1 = 'MD2'.

         SCREEN-INPUT     = GC_ZERO.

         SCREEN-ACTIVE    = GC_ZERO.

         SCREEN-REQUIRED  = GC_ONE.

         MODIFY SCREEN.

       ENDIF.

     ELSE.

       IF SCREEN-GROUP1 = 'MD1'.

         SCREEN-INPUT     = GC_ZERO.

         SCREEN-ACTIVE    = GC_ZERO.

         SCREEN-REQUIRED  = GC_ONE.

         MODIFY SCREEN.

       ENDIF.

     ENDIF.

   ENDLOOP.

   LOOP AT SCREEN.

     IF CUST EQ GC_FOR_X  AND S_DOWN1 EQ GC_FOR_X.

       IF SCREEN-GROUP1 = 'MD3'.

         SCREEN-INPUT     = GC_ONE.

         SCREEN-ACTIVE    = GC_ONE.

         MODIFY SCREEN.

       ELSEIF SCREEN-GROUP1 = 'MD4'.

         SCREEN-INPUT         = GC_ZERO.

         SCREEN-ACTIVE        = GC_ZERO.

         MODIFY SCREEN.

       ENDIF.

     ELSEIF CUST EQ GC_FOR_X  AND S_DOWN1 NE GC_FOR_X.

       IF SCREEN-GROUP1   = 'MD3' OR SCREEN-GROUP1   = 'MD4'.

         SCREEN-INPUT       = GC_ZERO.

         SCREEN-ACTIVE      = GC_ZERO.

         MODIFY SCREEN.

       ENDIF.

     ELSEIF VEND EQ GC_FOR_X  AND S_DOWN1 EQ GC_FOR_X .

       IF SCREEN-GROUP1   = 'MD4'.    "ADD

         SCREEN-INPUT       = GC_ONE.

         SCREEN-ACTIVE      = GC_ONE.

         MODIFY SCREEN.

       ELSEIF SCREEN-GROUP1 = 'MD3'.

         SCREEN-INPUT         = GC_ZERO.

         SCREEN-ACTIVE        = GC_ZERO.

         MODIFY SCREEN.

       ENDIF.

     ELSEIF VEND EQ GC_FOR_X  AND S_DOWN1 NE GC_FOR_X.

       IF SCREEN-GROUP1 = 'MD3' OR SCREEN-GROUP1 = 'MD4'.

         SCREEN-INPUT     = GC_ZERO.

         SCREEN-ACTIVE    = GC_ZERO.

         MODIFY SCREEN.

       ENDIF.

     ENDIF.

   ENDLOOP.

ENDFORM.               

Read only

former_member196651
Contributor
0 Likes
1,911

Hi Darshan,

What we had explained above is for Modulepool Screens. In case of selection screens, we will be able to give the screen group using MODIF ID. Moreover I don't think that it will be possible to assign more than one group for a field in selection screen.

Regards,

Abijith

Read only

Former Member
0 Likes
1,910

Hi,

The components group1 to group4 can contain three-character IDs, which were assigned to the current screen element in its definition. These IDs allow you to combine the screen elements in up to four different modification groups. In the statement block after LOOP AT SCREEN, these can be queried in logical expressions in order to process several elements in the same way.

The other components of table screen represent the display properties of the current screen element. With the exception of length, they can contain 0 or 1, where 1 is "active" and 0 is "inactive".

Except active, all components of structure screen directly correspond to one attribute of the current screen element. The component active has no match in the attributes. If you change its content with MODIFY SCREEN, this affects the attributes Input, Output and Invisible and thus the components input, output and invisible of structure screen.