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

Simple Transformation: loop - internal table

Former Member
0 Likes
1,208

Hey guys,

i am new with simple transformation. I read some stuff and try to build my first ST-programm. Now i stuck ......

Hope you guys could help me. I have build up an internal table and would like to transform it to an excel sheet. I found an article on the net and modified to my useage. It is working for a static table with static colunm number. But what if i have a internal table which column numbers could change?

Look at the coding:

<tt:loop ref=".table">

<Row>

<Cell>

<Data ss:Type="String">

<tt:value ref="FIELD_1"/>

</Data>

</Cell>

<Cell>

<Data ss:Type="String">

<tt:value ref="FIELD_2"/>

</Data>

</Cell>

=> here i want to loop over my internal table columns

<Cell>

<Data ss:Type="String">

<tt:value ref="FIELD_N"/>

</Data>

</Cell>

</Row>

</tt:loop>

I know i have to define a variable but this variable has to count startin from 1 to the end of the table columns. Then i have to concatenate the column name with the variable FILED_XX (like i do in ABAP). How can i achieve this?

thx,

M.

1 REPLY 1
Read only

Former Member
0 Likes
629

DATA:

w_index LIKE sy-index..

LOOP AT "internal table" INTO "workare" FROM w_index.

w_index = sy-tabix..

Menlo.

concatenate w_index into "x" x is the variable to which to transfer

thanking you