Application Development 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: 

Reading particular column from internal table

Former Member
0 Kudos
3,824

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

Former Member
0 Kudos
978

Read table itab index 1.

g_var = itab-colname.

write : g_var

Former Member
0 Kudos
978

Hi subsar,

You might use Fieldsymbols for this.

READ TABLE itab INDEX 1.

ASSIGN COMPONENT col_num OF STRUCTURE itab TO <fs>.

Former Member
0 Kudos
978

Hi

FIELD-SYMBOLS: <FS_COLUNM> TYPE ANY.

Read table itab index 1.

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

Max

Former Member
0 Kudos
978

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