Application Development 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: 

Concatenate variables storing table/field names

former_member214626
Active Contributor
0 Kudos

Hi All ,

I want to concatenate the values stored in fields of structure EQUI . I am reading these fields from a z table . For example :

My Z table has 2 columns  -  ZTAB & ZFIELD with following 2 records :

                                              EQUI   ERNAM

                                              EQUI   AEDAT

At run time , I have access to EQUI structure .On reading the above ztable I got 2 lines in my internal table it_ztable .

Now what I want  system should read values of above fields from EQUI structure and  concatenate values of  EQUI-ERNAM and EQUI-AEDAT .

In other words it should work like following statement :

CONCATENATE EQUI-ERNAM  EQUI-AEDAT into var_string.

Here if at runtime ERNAM and AEDAT has value : rsudesh 20150810 then var_string should have value " rsudesh20150810"

Here in my z table there can be any field from EQUI table . How to write the code . I don't want to use if and else to compare each field . I have tried using field symbols but its not working .

With Regards

2 REPLIES 2

Former Member
0 Kudos

hi sap pm,

i am not clear what is your requirement but as per my understanding.

u can use.

loop at it_EQUI into wa_equi.

     read table it_equi into wa_equi1

former_member214626
Active Contributor
0 Kudos

it worked . I was missing brackets while assigning the variable to field symbol .

ASSIGN (var_field) to <f> worked for me .

here var_field was having value EQUI-ERNAM .