‎2007 Jan 01 12:19 PM
hi guys,
I have a data in internal table.
iam extracting based upon the fields KURST and GDATU.
If i have more than one same currencey conversion like given below , i should display a error message,
-
kurst fcurr tcurr gdatu
-
TCL GBP EUR 13.03.2006
TCL GBP EUR 31.03.2006
It should not have more than one time same currency conversion.
GBP-->EUR
GBP-->EUR.
how can i do it.
please help.
‎2007 Jan 01 1:05 PM
Hi Ahmed
Please try with a logic similar to below:
data: tabix like sy-tabix,
wa like itab.
sort itab by kurst fcurr tcurr.
loop at itab.
tabix = sy-tabix.
tabix = tabix + 1.
read table itab index tabix.
if sy-subrc eq 0 and
itab-kurst = wa-kurst and
itab-fcurr = wa-fcurr and
itab-tcurr = wa-tcurr.
Write:/ 'Duplicate Record:', itab.
endif.
endloop.Kind Regards
Eswar
‎2007 Jan 01 3:25 PM
Hi,
store the currency combinations into an internal table. As soon as one combination apperas more than once, it can not be stored and you can do what you want in this case to be done.
data:
begin of ls_conv,
fcurr like...
tcurr like...
end of ls_conv,
lt_conv like hashed table of ls_conv
with unique key table_line.
loop at itab.
move-corresponding itab to ls_conv.
insert ls_conv into table lt_conv.
if sy-subrc <> 0.
"Alarm: Here comes the duplicate
* TAKE ACTION
endif.
endloop.
At least this is the fastest solution.
Regards,
Clemens