‎2007 Jun 19 3:15 PM
Hi all,
I m having a internal table lt_list in that i m having a field zversion...so in the runtime it stores some versions eg: 1,2,3...so my requiremnt is i want to find the latest version at the runtime itself and substract it by -1...
Eg: if lt_list-zversion is having versions as 1,2 and 3.
i want to find the latest version i.e, here 3 and want to substract it by -1.
pls help
‎2007 Jun 19 3:26 PM
Hi
First Sort ur internal table based on version.
Then loop the internal table.
Use at events. Like At end of or at last version...
Subtract 1 from version. U will get a answer..
Regards
Ravi
‎2007 Jun 19 3:20 PM
SORT the internal table by decending order by version number, read the first record in internal table. You will get the latest version number then u subtract.
‎2007 Jun 19 3:21 PM
HEllo,
U can do like this.
data: wa_itab like itab.
SORT ITAB BY FIELD1." (First field of the itab)
loop at itab.
wa_itab = itab.
at end of field1.
subtract 1 from wa_itab-zversion.
modify itab from wa_itab.
endif.
endloop.
If useful reward.
Vasanth
‎2007 Jun 19 3:26 PM
Hi
First Sort ur internal table based on version.
Then loop the internal table.
Use at events. Like At end of or at last version...
Subtract 1 from version. U will get a answer..
Regards
Ravi
‎2007 Jun 19 3:46 PM
‎2007 Jun 19 4:59 PM
Try this..
SORT LT_LIST BY ZVERSION DESCENDING.
READ TABLE LT_VERSION INTO LS_VERSION INDEX 1.
IF SY-SUBRC = 0.
........
WRITE UR CONDITION AS SUBSTRACT - 1
ENDIF.
‎2007 Jun 19 5:00 PM