hi.
i am writing a select query hereby but seems that it is not logically viable.please give me the best possible,logically correct piece of code.....thnks in adv.
i am using tables to give the output depending on the date.
ranges r_audat for vakpa-audat.
r_audat-sign = 'I'.
r_audat-option = 'BT'.
r_audat-low = '20060101'.
r_audat-high = '20071231'.
append r_audat.
clear r_audat.
select vbeln kunde vkorg audat
from vakpa
into table it_vakpa
for all entries in it_knb1
where kunnr = it_knb1-kunnr
and vkorg = it_tvko-vkorg
and audat in r_audat.
sort it_vakpa by vkorg.
delete adjacent duplicates from it_vakpa.
sort it_knb1 by kunnr.
loop at it_knb1.
Read table it_vakpa with key vkorg = it_tvko-vkorg.
if sy-subrc ne 0.
delete it_knb1 where bukrs = it_knb1-bukrs.
delete it_knb1.
endif.
endloop.