‎2007 Oct 05 7:31 AM
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
‎2007 Oct 05 7:36 AM
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.
‎2007 Oct 05 7:37 AM
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
‎2007 Oct 05 7:37 AM
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
‎2007 Oct 05 7:38 AM
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
‎2007 Oct 05 7:50 AM
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