Skip to Content
0
Jul 01, 2015 at 11:41 AM

Filling structure dynamic with internal table

28 Views

Hi,


I want to fill my structure with the values of the internal table: it_temp.


My structure: [ref, keynr, col001, col002, col003, ...., col020]


What is the easiest way to fill my structure?

I was thinking to loop through the internal table and creating a dynamic field but I'm not able to do the concatenate.


Thanks for the help!


loop at it_datatab INTO lv_string.

"Tabs splitsen en in interne tabel stoppen

SPLIT lv_string AT CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB INTO TABLE it_temp.

"Structure invullen

ls_data-ref = p_fname.

ls_data-keynr = sy-tabix.

lv_i = 001.

loop at it_temp into lv_string.


" This is not working, but I should do something like this

ls_data-col + " " + lv_i = lv_string.

lv_i = lv_i + 1.

endloop.

endloop.