Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How does below code works?KIndly help

sanjay_deshpande4
Participant
0 Likes
843

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
2 REPLIES 2
Read only

Sandra_Rossi
Active Contributor
730

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'.

Read only

ThorstenHoefer
Active Contributor
0 Likes
730

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>.