Syntax for LOOP on Internal Table part three

This is in continuation with Loop syntax with respect to internal table in part one and two. Going through this links will help in understanding the present concept.

Addition 4

... TRANSPORTING NO FIELDS

Effect

There is no field transport in the output area of the internal table. This addition can be used only in conjunction with a WHERE condition. Since it would make no sense to specify a work area with INTO wa when using the addition TRANSPORTING NO FIELDS , this option does not exist.

This addition can be used to determine a set of line indexes (index set) or to determine the number of lines in a table which satisfy a given condition.

Example

Determining the number COUNT of lines in a name table TAB which contain the name 'Walter' and the corresponding index set INDEX_SET .

DATA: BEGIN OF TAB OCCURS 100,

NAME(30) TYPE C,

END OF TAB,

COUNT TYPE I,

INDEX_SET LIKE SY-TABIX OCCURS 10 WITH

HEADER LINE.

LOOP AT TAB TRANSPORTING NO FIELDS WHERE

NAME CS 'Walter'.

INDEX_SET = SY-TABIX.

APPEND INDEX_SET.

ADD 1 TO COUNT.

ENDLOOP.

Loops on screen fields Syntax

Basic form

LOOP AT SCREEN.

Effect

All fields of the current screen are stored in the system table SCREEN with their attributes. The " LOOP AT SCREEN " statement places this information in the header line of the system table. If you want to change the attributes, you must put back the changed header line with MODIFY SCREEN . You can only do this in the PBO module of a screen .

If you use this statement for step loop processing, the information (and any changes) apply only to the current steploop line. Outside step loop processing, the information for a step loop field applies to the complete column.

Step loop fields should never be changed after the corresponding step loop processing has been performed. You can use the CONTINUE statement to leave the current loop pass prematurely and continue with the next loop pass.

Overview of all SCREEN fields:

Field Length Type Meaning

SCREEN-NAME 30 C Field name
SCREEN-GROUP1 3 C Evaluation of

modification group 1

SCREEN-GROUP2 3 C Evaluation of

modification group 2

SCREEN-GROUP3 3 C Evaluation of

modification group 3

SCREEN-GROUP4 3 C Evaluation of

modification group 4

SCREEN-REQUIRED 1 C Field input mandatory
SCREEN-INPUT 1 C Field ready to accept input
SCREEN-OUTPUT 1 C Field will be displayed
SCREEN-INTENSIFIED 1 C Field highlighted
SCREEN-INVISIBLE 1 C Field invisible
SCREEN-LENGTH 1 X Field length
SCREEN-ACTIVE 1 C Field active

Example

Make all fields display only:

CONSTANTS OFF VALUE '0'.

LOOP AT SCREEN.

SCREEN-INPUT = OFF.

MODIFY SCREEN.

ENDLOOP.

GENERATE

GET PART ONE AND TWO THREE

GET CURSOR PART ONE TWO

GET CURSOR PART ONE AND TWO

No comments :

Post a Comment