‎2009 Mar 01 11:16 PM
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
‎2009 Mar 02 4:58 AM
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
‎2009 Mar 03 5:02 PM
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
‎2009 Mar 04 7:14 PM
Hello Harsha,
This is a limitation with the tool i guess , not everyting can be handled through automation.
Thanks & Best regards,
Ajay
‎2009 Mar 04 7:23 PM
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