2007 Dec 25 5:15 PM
Hi experts ,
I need your help,
I have 2 internal tables
ITAB1
Vbeln posnr etenr
100 10 1
100 10 2
100 10 3
101 10 1
101 10 2
102 10 1
ITAB2
Vbeln posnr etenr
101 10 1
Now the Result should look like in Itab3
Vbeln posnr etenr
100 10 1
100 10 2
100 10 3
101 10 1
102 10 1
Means the values what we have in ITAB2 - etenr , if it is greater than 1 those entries should not be taken into consideration .
Can any one send the detailed code for the same.
Hi experts ,
I need your help,
I have 2 internal tables
ITAB1
Vbeln posnr etenr
100 10 1
100 10 2
100 10 3
101 10 1
101 10 2
102 10 1
ITAB2
Vbeln posnr etenr
101 10 1
Now the Result should look like in Itab3
Vbeln posnr etenr
100 10 1
100 10 2
100 10 3
101 10 1
102 10 1
Means the values what we have in ITAB2 - etenr , if it is greater than 1 those entries should not be taken into consideration .
Can any one send the detailed code for the same.
2007 Dec 25 5:30 PM
Hi
declare itab1, itab2 and itab3 the final Itab.
Loop at itab1.
move-corresponding itab1 to itab3.
append itab3.
clear itab3.
endloop.
Loop at itab1.
read table itab2 with key vbeln = itab1-vbeln
posnr = itab1-posnr
etenr = itab1-etenr.
if sy-subrc = 0.
move-corresponding itab2 to itab3.
append itab3.
endif.
clear itab3.
endloop.
Regards
Anji
.
2007 Dec 25 5:40 PM
Hi Anji,
Thanks for your Reply .
The logic you suggested is not working.
my condition is that ITAB2-ETENR if its value is greater than 1 it should not consisderd for final Table Itab3
2007 Dec 25 6:38 PM
Hi,
use this code.
itab3[] = itab1[].
loop at itab2.
loop at itab3 where vbeln = itab2-vbeln posnr = itab2-posnr etenr > 1.
delete itab3.
endloop.
endloop.
Reward if useful
Regards
ANUPAM
2007 Dec 25 6:44 PM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |