TYPES lr_bukrs_type TYPE RANGE OF bukrs.
DATA : lr_bukrs_01 TYPE lr_bukrs_type, "Table 1
lr_bukrs_02 TYPE lr_bukrs_type. "Table 2
* Using only LET with VALUE
*--------------------------------------------------------------------*
lr_bukrs_01 = VALUE lr_bukrs_type(
LET s = 'I'
o = 'EQ'
IN sign = s
option = o
( low = '0100' )
( low = '0200' )
( low = '0300' )
( low = '0400' )
( low = '0500' )
( low = '0600' )
( low = '0700' )
).
TYPES lr_bukrs_type TYPE RANGE OF bukrs.
DATA : lr_bukrs_01 TYPE lr_bukrs_type, "Table 1
lr_bukrs_02 TYPE lr_bukrs_type. "Table 2
* Using MACRO
*--------------------------------------------------------------------*
DEFINE range_bukrs.
lr_bukrs_01 = VALUE lr_bukrs_type(
BASE lr_bukrs_01 (
sign = 'I'
option = 'EQ'
low = &1
)
).
END-OF-DEFINITION.
*--------------------------------------------------------------------*
range_bukrs: '0100', '0200', '0300', '0400', '0500', '0600', '0700'.
*--------------------------------------------------------------------*
TYPES lr_bukrs_type TYPE RANGE OF bukrs.
DATA : lr_bukrs_01 TYPE lr_bukrs_type, "Table 1
lr_bukrs_02 TYPE lr_bukrs_type. "Table 2
* Using MACRO
DEFINE range_bukrs.
lr_bukrs_01 = VALUE lr_bukrs_type(
BASE lr_bukrs_01 (
sign = 'I'
option = 'EQ'
low = &1
)
).
END-OF-DEFINITION.
range_bukrs: '0100', '0200', '0300', '0400', '0500', '0600', '0700'.
* Combining LET with FOR LOOP
*--------------------------------------------------------------------*
lr_bukrs_02 = VALUE #( FOR ls_bukrs IN lr_bukrs_01
* ( sign = 'I' "Alternatively
* option = 'EQ' "Alternatively
LET s = 'I'
o = 'EQ'
IN sign = s
option = o
( low = ls_bukrs-low )
).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
5 | |
5 | |
4 | |
4 | |
3 | |
2 | |
2 | |
2 | |
2 |