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

ABAP loop inside eCATT

harsha_s
Advisor
Advisor
0 Likes
819

Hello Colleagues,

I want to read multiple values from a table and display for which i going thru an loop .

But to display it is becoming an problem can you kindly see the code below .

Am trying to store the table fields in an table as mentioend below in the ABAP ENDABAP code.

V_C3[]-TABLE_LINE = <fs_field>.

But i am getting an error while compiling the code.

Can you suggest the solution for the same ?

loop at <fs_itab> assigning <fs_wa>.

assign component 'CLIENT' of structure <fs_wa> to <fs_field>.

V_CLIENT = <fs_field>.

assign component 'C0' of structure <fs_wa> to <fs_field>.

V_C0 = <fs_field>.

assign component 'C1' of structure <fs_wa> to <fs_field>.

V_C1 = <fs_field>.

assign component 'C2' of structure <fs_wa> to <fs_field>.

V_C2 = <fs_field>.

assign component 'C3' of structure <fs_wa> to <fs_field>.

V_C3[]-TABLE_LINE = <fs_field>.

assign component 'C4' of structure <fs_wa> to <fs_field>.

V_C4 = <fs_field>.

assign component 'C5' of structure <fs_wa> to <fs_field>.

V_C5 = <fs_field>.

assign component 'C6' of structure <fs_wa> to <fs_field>.

V_C6 = <fs_field>.

assign component 'C7' of structure <fs_wa> to <fs_field>.

V_C7 = <fs_field>.

assign component 'C8' of structure <fs_wa> to <fs_field>.

V_C8 = <fs_field>.

assign component 'MESSAGE_ID' of structure <fs_wa> to <fs_field>.

V_MESSAGE_ID = <fs_field>.

assign component 'TIMESTAMP' of structure <fs_wa> to <fs_field>.

V_TIMESTAMP = <fs_field>.

assign component 'EXTRACTKEY' of structure <fs_wa> to <fs_field>.

V_EXTRACTKEY = <fs_field>.

assign component 'STATEID' of structure <fs_wa> to <fs_field>.

V_STATEID = <fs_field>.

assign component 'DEVICE_ID' of structure <fs_wa> to <fs_field>.

V_DEVICE_ID = <fs_field>.

ENDLOOP.

regards

harsha

4 REPLIES 4
Read only

Former Member
0 Likes
646

Hello Harsha,

This task can be performed in more simpler way if i understand your requirements correctly.

Inside ABAP ... ENDABAP statements use Select statement and read all the values from your target table and assign it to a Local variable of the same table type.

Note : Import & Export variables cannot be used inside the ABAP ... ENDABAP statement.

Once all the values are stored in the Local table , outside the ENDABAP statement you can assign directly to the Export variable of table type with the local variable.

This export variable becomes visible outside the script asusual.

This should solve your requirment.

Thanks & Best regards,

Ajay

Read only

0 Likes
646

Hello ,

As i am not able to even apply that logic because am fetching the name of the table everytime using one more script as the table name is generated dynamically .

So i cannot create a variable of that datatype .

Can anyone kindly suggest if there are any other solution for this problem/issue ?.

regards

harsha

Read only

0 Likes
646

Hello Harsha,

This is a limitation with the tool i guess , not everyting can be handled through automation.

Thanks & Best regards,

Ajay

Read only

0 Likes
646

Hello Ajay,

Its True even i did lot of R&D but was not able to find any logic .

Apart from Internal table concept

regards

harsha