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 value

Former Member
0 Likes
614

hi friends,

i have created on report my internal table value is

MATNR LEVEL<b></b>

NEW-ATP-C2 0

NEW-ATP-S1 1

NEW-ATP-FG 2

TEST-ATP-FG 3

NEW-ATP-S2 1

NEW-ATP-FG2 2

i want move highest level Material to another internal table . how to do this ?

please help me.

regards ,

jayachandran

5 REPLIES 5
Read only

abdulazeez12
Active Contributor
0 Likes
594

sort <INTERNAL_TABLE> by LEVEL.

loop at INTERNAL_TABLE.

if sy-tabix = 1.

NEW_INTERNAL_TABLE-FIELD = ITAB-MATNR.

append NEW_INTERNAL_TABLE.

else.

exit.

endif.

endloop.

Read only

Former Member
0 Likes
594

Hi jai,

SORT ITAB

BY level

matnr .

LOOP AT itab

INTO wa_itab.

AT NEW matnr.

write : / wa_itab-matnr,wa_itab-level.

ENDAT.

ENDLOOP.

Regards,

Mukesh Kumar

Read only

Former Member
0 Likes
594

Hi,

sort itab descending by level.

this can give the highest level first

read table itad assigning <fs_itab> index 1;

IF SY_SUBRC EQ 0.

append <fs_itab> to itab2.

endif.

to append

grtz,

Koen

Read only

former_member673464
Active Contributor
0 Likes
594

hi,

Sort the internal table with Level and move the first record into another internal table .Check the next record level with first,if it is same move those records to required internal table.If it differs from first record exit the process.

Regards,

Veeresh

Read only

Former Member
0 Likes
594

ITAB2[] = ITAB1[].

SORT ITAB2 BY LEVEL DESCENDING.

READ TABLE ITAB2 INDEX 1 .

DELETE ITAB2 WHERE LVL NE ITAB2-LEVEL.

ITAB2 will have the data with highest level