‎2006 Jul 05 2:24 PM
Hi All!
I am having a internal table and the column <b>version</b> in the int. table will have the following fixed values.
1) Y-1
2) Y-2
3) Y-3
4) Y-4
5) Y-5
Now if the column value is Y-1 than i have to changes it to Y-2 ,if y-2 then to Y-3 and so on...Please advise,
Regards
Praneeth
<b></b>
‎2006 Jul 05 2:31 PM
Hi praneeth,
1. this is one way.
2. just copy paste, and it will do this.
3.
report abc.
data : begin of itab occurs 0,
abc(5) type c,
end of itab.
data : myval type c.
*----
itab-abc = 'Y-1'.
append itab.
itab-abc = 'Y-2'.
append itab.
itab-abc = 'Y-3'.
append itab.
itab-abc = 'Y-4'.
append itab.
itab-abc = 'Y-5'.
append itab.
*----
loop at itab.
myval = itab-abc+2(1).
myval = myval + 1.
concatenate itab-abc(2) myval into itab-abc.
modify itab.
endloop.
break-point.
regards,
amit m.
‎2006 Jul 05 2:28 PM
i dont think you should do direc increment (will give undesired results).
you can however-
split (field) at - into vara varb.
store varb into varc ( varc is of type i ).
increment varc.
concatenate vara varc into (field) separated by '-'.
modify this value in internal table using MODIFY statement.
‎2006 Jul 05 2:29 PM
Use a new column, VERSION_AUX, and make the changes in this new column. After that refresh values from column VERSION with values from column VERSIN_AUX.
Regards.
‎2006 Jul 05 2:30 PM
Hi can you add one more field to your internal table.
if yes use a flag bit.
loop at i_tab.
if i_tab-flag ne 'X'.
case i_tab-value.
when 'Y1'
i_tab-value = 'Y2'.
i_tab-flag = 'X'.
modify i_tab.
when 'Y2'.
and so on...
reward if you find this hlpful.
Regards,
Sumit.
‎2006 Jul 05 2:31 PM
Hi praneeth,
1. this is one way.
2. just copy paste, and it will do this.
3.
report abc.
data : begin of itab occurs 0,
abc(5) type c,
end of itab.
data : myval type c.
*----
itab-abc = 'Y-1'.
append itab.
itab-abc = 'Y-2'.
append itab.
itab-abc = 'Y-3'.
append itab.
itab-abc = 'Y-4'.
append itab.
itab-abc = 'Y-5'.
append itab.
*----
loop at itab.
myval = itab-abc+2(1).
myval = myval + 1.
concatenate itab-abc(2) myval into itab-abc.
modify itab.
endloop.
break-point.
regards,
amit m.