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

Reading particular column from internal table

Former Member
0 Likes
4,850

Hi

I am having one internal table with one row. I know the column number. I want to read that particular column value. What should I add with the below statement.

Read table itab index 1.

This will give me the whole row. I want only the particular column.

Please help me to solve this issue

Thanks.

Hi

I am having one internal table with one row. I know the column number. I want to read that particular column value. What should I add with the below statement.

Read table itab index 1.

This will give me the whole row. I want only the particular column.

Please help me to solve this issue

Thanks.

4 REPLIES 4
Read only

Former Member
0 Likes
2,004

Read table itab index 1.

g_var = itab-colname.

write : g_var

Read only

Former Member
0 Likes
2,004

Hi subsar,

You might use Fieldsymbols for this.

READ TABLE itab INDEX 1.

ASSIGN COMPONENT col_num OF STRUCTURE itab TO <fs>.

Read only

Former Member
0 Likes
2,004

Hi

FIELD-SYMBOLS: <FS_COLUNM> TYPE ANY.

Read table itab index 1.

ASSIGN COMPONENT <NUMBER OF COLUNM> OF SCTRUCTURE ITAB TO <FS_COLUNM>.

Max

Read only

Former Member
0 Likes
2,004

Hi,

FIELD-SYMBOLS <FS_ANY>

ASSIGN COMPONENT N OF STRCUTURE OF WORKAREA TO <FS_ANY>

WRITE <FS_ANY>

Where n is the column number and workarea is the row of the internal table.

Rgards,

Ravi

Note : Please mark the helpful answers