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

Report Issue

Former Member
0 Likes
645

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
628

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

6 REPLIES 6
Read only

alex_m
Active Contributor
0 Likes
628

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.

Read only

Former Member
0 Likes
628

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

Read only

Former Member
0 Likes
629

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

Read only

0 Likes
628

Hi ravi,

can u write the code to achieve this...

thx

Read only

0 Likes
628

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.

Read only

0 Likes
628

Thanks alot...