You can copy the content of a structure to another using the assignment operator =. In the following example, it is assumed that the target and source structures are of compatible types. In general, note that special conversion and comparison rules apply to value assignments involving structures.
some_struc = another_struc.
"When creating a new structure by inline declaration, the type of
"the right-hand structure is derived and the content is assigned.
DATA(struc_inl) = some_struc.
To assign values to individual structure components, use the component selector.
TYPES: BEGIN OF addr_struc,
name TYPE string,
street TYPE string,
city TYPE string,
END OF addr_struc.
DATA address TYPE addr_struc.
address-name = `Mr. Duncan Pea`.
address-street = `Vegetable Lane 11`.
address-city = `349875 Botanica`.
Serkan AKKAVAK
Computer Engineer BSc
Head of SAP & Software Department
Contact : serkurumsal@yandex.com

0 Comments