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

loop at screen and at selection-screen output

Former Member
0 Likes
9,055

Hello abapers give some defnetion and some eg. for

AT SELECTION-SCREEN OUPUT and

LOOP AT SCREEN

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,526

F1 or search in SDN.

Amit.

Hello abapers give some defnetion and some eg. for

AT SELECTION-SCREEN OUPUT and

LOOP AT SCREEN

5 REPLIES 5
Read only

Former Member
0 Likes
3,527

F1 or search in SDN.

Amit.

Read only

Former Member
0 Likes
3,526

Hi Gopi,

Search in SDN using the Keyword AT SELECTION-SCREEN OUTPUT and LOOP AT SCREEN, You may get Lots of Information.

Regards,

Sujit

Read only

Former Member
0 Likes
3,526

Hi,

Check this sample code


REPORT z_sdn.
 
PARAMETERS:
  p_num RADIOBUTTON GROUP rad1 DEFAULT 'X' USER-COMMAND abc,
  p_char RADIOBUTTON GROUP rad1.
 
PARAMETERS:
  p_num1 TYPE i MODIF ID num,
  p_num2 TYPE i MODIF ID num,
  p_char1 TYPE c MODIF ID chr,
  p_char2 TYPE c MODIF ID chr.
 
 
AT SELECTION-SCREEN OUTPUT.
  IF p_num EQ 'X'.
    LOOP AT SCREEN.
      IF screen-group1 EQ 'CHR'.
        screen-active = 0.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ELSE.
    LOOP AT SCREEN.
      IF screen-group1 EQ 'NUM'.
        screen-active = 0.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.

Regards

Abhijeet

Read only

Former Member
0 Likes
3,526

Hi Gopi,

Welcome to SDN.

refer to the links below:

and also refer to :

http://www.sap-img.com/abap/change-the-input-fields-dynamically-in-a-screen.htm

With luck,

Pritam.

Read only

Former Member
0 Likes
3,526

Hi,

AT SELECTION-SCREEN OUTPUT.

This is the event which triggers before the screen is going to display. In this event we can done any change to the screen using LOOP AT SCREEN.

LOOP AT SCREEN [INTO wa].

...

ENDLOOP.

Effect

The statements LOOP AT SCREEN ... ENDLOOP define a loop around a statement block. For every screen element of the current dynpro, to which a dynpro field is assigned, one loop pass is executed. After the LOOP statement either the predefined workarea screen or the workarea wa (when using INTO) contains the properties of the respective screen element. wa must have the same data type as screen.

While processing a table control or a step loop (that is, within a LOOP loop of the dynpro flow logic), for its screen elements the current properties are determined in the current row or group. Outside of the processing of a table control or step loop, for its screen elements the statically predefined properties of all rows or groups are determined.

The table below shows the components of screen and their assignment to the field properties in the dynpro.

Component Length Type Attribute Description

name 132 c Name Name

group1 3 c Group1 Modification group

group2 3 c Group2 Modification group

group3 3 c Group3 Modification group

group4 3 c Group4 Modification group

required 1 c Required-entry field Mandatory field

input 1 c Input input-enabled field

output 1 c Output display field

intensified 1 c Intensified intensified field

invisible 1 c Invisible invisible element

length 1 x visLength Field length

active 1 c Input/Output/Invisible active field

display_3d 1 c Two-dimensional Box

value_help 1 c Input help Input help key

request 1 c - Input exists

values_in_combo 1 c Dropdown listbox Value help exists

The component name in the loop contains the name of the current dynpro field. 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.