REPORT demo_mod_tech_example_4.
TYPES: BEGIN OF line,
name(10) TYPE c,
age(2) TYPE n,
country(3) TYPE c,
END OF line.
name(10) TYPE c,
age(2) TYPE n,
country(3) TYPE c,
END OF line.
DATA who TYPE line.
who-name = 'Otto'. who-age = '10'. who-country = 'D'.
PERFORM components CHANGING who.
WRITE: / who-name, who-age, who-country.
FORM components
CHANGING value(person) TYPE line.
CHANGING value(person) TYPE line.
WRITE: / person-name, person-age, person-country.
person-name = 'Mickey'.
person-age = '60'.
person-country = 'USA'.
person-name = 'Mickey'.
person-age = '60'.
person-country = 'USA'.
ENDFORM.
This produces the following output:
Otto 10 D
Mickey 60 USA
The actual parameter who with the user-defined, structured data type line is passed to the formal parameter person. The formal parameter person is typed with TYPE line. Since line is a user-defined data type, the type of person is completely specified. The subroutine accesses and changes the components
of person. They are then returned to the components of who in the calling program.
Serkan AKKAVAK
Computer Engineer
ABAP Developer & SAP S/4 HANA Logistics Consultant
Contact : serkurumsal@yandex.com
Computer Engineer
ABAP Developer & SAP S/4 HANA Logistics Consultant
Contact : serkurumsal@yandex.com
Social Plugin