‎2022 Jan 02 7:48 AM
Dear All,
Can anybody kindly guide how below code works?
CREATE DATA ld_proxy_data TYPE (ls_finf-ddicstructureraw). "2263322
ASSIGN ld_proxy_data->* TO <ls_proxy_input>. "2263322
ASSIGN COMPONENT ls_finf-rectyperaw OF STRUCTURE <ls_proxy_input> TO <ls_transform_input>. "2263322
‎2022 Jan 02 9:52 AM
Just debug it. Or maybe you have a precise question?
TYPES: BEGIN OF ty_name,
comp1 TYPE string,
END OF ty_name.
FIELD-SYMBOLS: <ls_proxy_input> TYPE any,
<ls_transform_input> TYPE any.
DATA: BEGIN OF ls_finf,
ddicstructureraw TYPE string,
rectyperaw TYPE string,
END OF ls_finf,
ld_proxy_data TYPE REF TO DATA.
ls_finf-ddicstructureraw = 'TY_NAME'.
ls_finf-rectyperaw = 'COMP1'.
CREATE DATA ld_proxy_data TYPE (ls_finf-ddicstructureraw). "2263322
ASSIGN ld_proxy_data->* TO <ls_proxy_input>. "2263322
ASSIGN COMPONENT ls_finf-rectyperaw OF STRUCTURE <ls_proxy_input> TO <ls_transform_input>. "2263322
<ls_transform_input> = 'hello world'.
‎2022 Feb 03 1:11 PM
create a new reference to data with a dynamic structure which
name is defined in variable ls_finf-ddicstructureraw
CREATE DATA ld_proxy_data TYPE (ls_finf-ddicstructureraw).assign the reference to a fiel symbol with accessable structure fields like <ls_proxy_input>-field1
ld_proxy_data: address to the structure (reference)
ld_proxy_data->* content to the reference structure (value)
ASSIGN ld_proxy_data->* TO <ls_proxy_input>The name of the component of the structure <ls_proxy_input>
is stored in ls_finf-rectyperaw, like ls_finf-rectyperaw = 'field1'.
Now <ls_proxy_input>-field1 is accecable via the field symbol <ls_transform_input>
ASSIGN COMPONENT ls_finf-rectyperaw OF STRUCTURE <ls_proxy_input> TO <ls_transform_input>.