PROVIDE - Short Form

Syntax

PROVIDE {*|{comp1 comp2 ...}} FROM itab1
        {*|{comp1 comp2 ...}} FROM itab2
        ...
        BETWEEN extliml AND extlimu.


Effect

This forbidden form of the PROVIDE statement is a short form of the permitted variant. The compiler distinguishes the long and short forms by the additions FIELDS to be specified explictly before the component specifications.

In principle, the short form of the PROVIDE statement works like the permitted variant. Unlike the permitted variant, however, fewer additions are allowed here. In the short form, you cannot specify a table several times. The internal tables must have headers and the additions that have to be specified in the long form are enhanced in the short form by the runtime environment, as described below.

For the PROVIDE loop to function correctly, the same conditions apply as in the long form. However, now exceptions are raised if one of the involved tables is not sorted or there are overlapping intervals.

Interval limits BOUNDS

The columns for interval limits to be specified in the long form as intlim1 and intlim2 using BOUNDS are attributes of the relevant tables in the short form and must be specified when they are declared.

This is done using the VALID BETWEEN addition that can be specified after DATA ENDOF if an internal table is declared with the obsolete OCCURS addition to the DATA BEGIN OF statement.If an internal table is declared using the INFOTYPES statement, these are the BEGDA and ENDDA columns. If no columns are specified for the interval limits in the declaration, the short form of the PROVIDE uses the first two columns of the internal table.

Work area INTO

In the short form, the headers of the internal table are implicitly used for the work areas that have to be specified as wa in the long form using the INTO addition.

VALID flag

The data objects that have to be specified as flag in the long form using the VALID addition are added the short form by the system implicitly creating a data object itab_valid of type c and length 1 for every table itab.

WHERE condition

No conditions can be specified in the short form.

INCLUDING GAPS addition

In the short form, you cannot force the system to pass the PROVIDE loop for every interval.

Notes

Example

The example has the same result as the example for the long form. Here, the tables itab1 and itab2 have headers and the columns col1 and col2 are defined as interval limits of type i using the VALID addition to the DATA END OF statement.

DATA: BEGIN OF itab1 OCCURS 0,
        col1 TYPE i,
        col2 TYPE i,
        col3 TYPE string,
      END OF itab1 VALID BETWEEN col1 AND col2.

DATA: BEGIN OF itab2 OCCURS 0,
        col1 TYPE i,
        col2 TYPE i,
        col3 TYPE string,
      END OF itab2 VALID BETWEEN col1 AND col2.

itab1-col1 = 1.
itab1-col2 = 6.
itab1-col3 = 'Itab1 Int1'.
APPEND itab1 TO itab1.

itab1-col1 = 9.
itab1-col2 = 12.
itab1-col3 = 'Itab1 Int2'.
APPEND itab1 TO itab1.

itab2-col1 = 4.
itab2-col2 = 11.
itab2-col3 = 'Itab2 Int1'.
APPEND itab2 TO itab2.

PROVIDE col3 FROM itab1
        col3 FROM itab2
             BETWEEN 2 AND 14.
  WRITE: / itab1-col1, itab1-col2, itab1-col3, itab1_valid.
  WRITE: / itab2-col1, itab2-col2, itab2-col3, itab2_valid.
  SKIP.
ENDPROVIDE.