2008 May 20 1:36 PM
Hi Expert,
I have the following problem. I have in flat file the Column1, and I need write the column2. I need the number 1 with 10 only once, the number 1 with 11 only once, the number 1 with 12 only once, the number 1 with 13 only once, the number 1 with 14 only once......
As the number 10 is repeated, I need put 1 only once. If number 10 appear again put 0
Example:
Column1---- -
Column2
10----
1
10----
0
10----
0
14----
1
19----
1
19----
0
13----
1
13----
0
13----
0
13----
0
13----
0
11----
1
14----
0
14----
0
Is there any routine?
Can you help me please?
Thanks
Thanks.
2008 May 20 1:40 PM
Loop at itab.
at new column1.
column2 = '1'.
modify itab.
endat.
endloop.
Hi Expert,
I have the following problem. I have in flat file the Column1, and I need write the column2. I need the number 1 with 10 only once, the number 1 with 11 only once, the number 1 with 12 only once, the number 1 with 13 only once, the number 1 with 14 only once......
As the number 10 is repeated, I need put 1 only once. If number 10 appear again put 0
Example:
Column1---- -
Column2
10----
1
10----
0
10----
0
14----
1
19----
1
19----
0
13----
1
13----
0
13----
0
13----
0
13----
0
11----
1
14----
0
14----
0
Is there any routine?
Can you help me please?
Thanks
Thanks.
2008 May 20 1:40 PM
Loop at itab.
at new column1.
column2 = '1'.
modify itab.
endat.
endloop.
2008 May 20 1:41 PM
Hi,
You are using an internal table, then, loop it and use the AT NEW command.
Regards.
2008 May 20 1:44 PM
Hi,
fist sort the internal table before passing to flat file
sort i_itab by column1 column2.
loop itab into l_itab
at new colum1.
column2 = 1.
continue.
endat.
column2 = 0.
endloop.
Regards,
Sriram
2008 May 21 5:36 AM
Hi Germán López Rodríguez
do the following way,
sort itab by col1.
loop at itab.
on change of itab-col1.
itab-col2 = 1.
modify itab.
else.
itab-col2 = 0.
modify itab.
endon.
endloop.
reward if helpful
prasanth