‎2008 Oct 28 12:08 PM
Hi,
i have a variable from type any.
data lv_xyz type any.
How can refer to its components while
runtime. I dont the syntax.
MAybe something with assign ?
regards
sas
‎2008 Oct 28 12:43 PM
Assuming CREATED_BY is first field in the structure of your data, both ASSIGN COMPONENTS below will work. You probably want the second one.
FIELD-SYMBOLS: <some_data> TYPE ANY,
<some_field> TYPE ANY.
DATA: l_field TYPE fieldname VALUE 'CREATED_BY'.
ASSIGN COMPONENT 1 OF STRUCTURE <some_data> TO <some_field>.
ASSIGN COMPONENT l_field OF STRUCTURE <some_data> TO <some_field>.matt
‎2008 Oct 28 12:15 PM
you can refer only using fieldsymbols.
it is not possible to define TYPE ANY using DATA.
field-symbols: <fs> type any.
after field-symbol assignment , you can access the components in it , using the assign component.
‎2008 Oct 28 12:18 PM
Hi u can't define data type like type any.
it used to define only for field-symbols.
‎2008 Oct 28 12:29 PM
Hello this is not possible,
data lv_bu_pa_guid type PARTNER_GUID.
FIELD-SYMBOLS: <fs_is_he_line> TYPE ANY.
ASSIGN IS_HDR_LINE TO <fs_is_he_line>.
*if <fs_is_he_line>-CREATED_BY <> GS_USER_INFO-USER_NAME.
I get erromessage is not a structure therefore
it hasn't a component named CREATED_BY
‎2008 Oct 28 12:43 PM
Assuming CREATED_BY is first field in the structure of your data, both ASSIGN COMPONENTS below will work. You probably want the second one.
FIELD-SYMBOLS: <some_data> TYPE ANY,
<some_field> TYPE ANY.
DATA: l_field TYPE fieldname VALUE 'CREATED_BY'.
ASSIGN COMPONENT 1 OF STRUCTURE <some_data> TO <some_field>.
ASSIGN COMPONENT l_field OF STRUCTURE <some_data> TO <some_field>.matt