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

internal table

Former Member
0 Likes
469

hi

in an Internal table i have

1.no

2.name

3.value

fields.

in loop i have only one no but multiple name and value for that no !

how to reterive that name and value.

loop at itab into wa.

write: no.

loop at itab into wa.

write:name.

write:value.

endloop.

endloop.

is is correct ???????

no.101 --->name aa value 90

bb 89

cc 77

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
450

Do like this :


Loop at itab.
at new num.
write itab-num.
endat.
write itab-name
write itab-value.
endloop.

regards,

Advait

5 REPLIES 5
Read only

Former Member
0 Likes
450

write the code, and run it. and correct it if needed

Read only

Former Member
0 Likes
451

Do like this :


Loop at itab.
at new num.
write itab-num.
endat.
write itab-name
write itab-value.
endloop.

regards,

Advait

Read only

Former Member
0 Likes
450

Hi Dharma,

Do it in this way.


TYPES: BEGIN OF TY_TAB,
           no(18) TYPE C,
           name(30) TYPE C,
           value (10) TYPE C,
             END OF TY_TAB.
DATA: IT_TAB1 TYPE STANDARD TABLE OF TY_TAB WITH HEADER LINES.
DATA: IT_TAB2 TYPE STANDARD TABLE OF TY_TAB WITH HEADER LINES.l

"--------> Now populate the internal table IT_TAB1.
 IT_TAB2[] = IT_TAB1[].
SORT IT_TAB1 BY NO.
LOOP AT IT_TAB1.
   READ TABLE IT_TAB2 WITH KEY NO = IT_TAB2-NO.
   IF SY-SUBRC = 0.
      WRITE:/  IT_TAB2-NO,   IT_TAB2-NAME,  IT_TAB2-VALUE.
      DELETE IT_TAB2 INDEX SY-TABIX.
   ENDIF.
ENDLOOP.

Thanks,

Chidanand

Read only

Former Member
0 Likes
450

thanks to all

i got it

Read only

0 Likes
450

Hi Dharma ,

If you are done with this issue , so please close this thread

Thanks & Regards