Code: Alles auswählen.
REPORT.
TYPES:
BEGIN OF ty_1,
street TYPE c LENGTH 50,
housenumber TYPE c LENGTH 10,
END OF ty_1,
BEGIN OF ty_2,
postal_code TYPE c LENGTH 50,
city TYPE c LENGTH 50,
END OF ty_2.
TYPES:
BEGIN OF ty_3,
name TYPE c LENGTH 50.
INCLUDE TYPE ty_1.
INCLUDE TYPE ty_2.
TYPES END OF ty_3.
DATA(address) = VALUE ty_3( name = 'Max' street = 'Hauptstrasse' housenumber = '1' postal_code = '1000' city = 'Berlin' ).
WRITE address.
Code: Alles auswählen.
...
INCLUDE TYPE ty_1 AS sh.
INCLUDE TYPE ty_2 AS pc.
...
WRITE address-sh. "= WRITE: address-street, address-housenumber.
WRITE address-pc. "= WRITE: address-postal_code, address-city.
...
PERFORM write_sh USING address-sh.
FORM write_sh USING sh TYPE ty_1. "Verwendung in Schnittstellen
WRITE sh-street.
WRITE sh-housenumber NO-ZERO.
ENDFORM.
Folgende Benutzer bedankten sich beim Autor a-dead-trousers für den Beitrag (Insgesamt 2):
tm987456 • debianfan