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

picking the second record from internal table

Former Member
0 Likes
3,260

Hi Friends,

I need to pick the second record from the internal which is declared as like without any loop. is there any statement how to pick the second record from the loop.

Thanx in advance,

Line

1 ACCEPTED SOLUTION
Read only

jayanthi_jayaraman
Active Contributor
0 Likes
1,811

Hi,

read table itab into wa index 2.

10 REPLIES 10
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
1,811

HI,

Hi you can use as follows

READ TABLE ITAB INTO WA INDEX 2.

Regards,

Sesh

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
1,812

Hi,

read table itab into wa index 2.

Read only

0 Likes
1,811

If it is without workarea.

Line

Read only

0 Likes
1,811

Read table itab index 2.

if sy-subrc = 0.

write : / itab-f1, itab-f2.

endif.

regards

shiba dutta

Read only

0 Likes
1,811

if it is without work area use

READ ITAB WHERE SY-TABIX = 2.

Here header line of itab will work as the Work area and will have the values at index 2.

Reward points if helpful

Read only

0 Likes
1,811

Hi,

read table itab index 2.

if itab has implicit workarea.

Read only

Former Member
0 Likes
1,811

Hi,

u can use read statement with index to pick the second record from internal table.

Read table itab index 2.

thanks & regards,

jogu_vinesh@yahoo.com

Read only

Former Member
0 Likes
1,811

Hi,

Use read statment like

READ ITAB WHERE SY-TABIX = 2.

OR

LOOP AT ITAB TO WA WHERE SY-TABIX = 2

Hope this helps you. Reply for queries, shall post the updates.

Regards.

Kumar.

Read only

Former Member
0 Likes
1,811

hi..

u can use this statement..

<b>READ TABLE ITAB INTO WA INDEX 2.</b>

Reward if useful

Regards

Ashu

Read only

Former Member
0 Likes
1,811

Hi,

You can use the syntax to pick the second record from internal table

READ ITAB WHERE SY-TABIX = 2.

OR

LOOP AT ITAB TO WA WHERE SY-TABIX = 2