‎2007 Nov 05 3:15 AM
Hi all,
How to check the below condition in abap,
here i have date field in table a and table b, i want to compare these 2 dates like :
sql statement is like,
WHERE a.BIL_DAT < min( b.GDATU ).
so how check this con in abap.
Thanks in advance,
sudharsan.
‎2007 Nov 05 3:19 AM
select <fields> from B into table it_b.
sort it_b by GDATU descending.
read table it_b index 1.
if sy-subrc = 0.
l_date = it_b-gdatu.
endif.Now you can use l_date in place of min(b.gdatu)
Regards
Gopi
‎2007 Nov 05 3:19 AM
select <fields> from B into table it_b.
sort it_b by GDATU descending.
read table it_b index 1.
if sy-subrc = 0.
l_date = it_b-gdatu.
endif.Now you can use l_date in place of min(b.gdatu)
Regards
Gopi
‎2007 Nov 05 3:55 AM
Hi friends ,
Thank u very much for quickl replay.
i ve given good rewards.
regards,
sudharsan
‎2007 Nov 05 3:19 AM
Hi,
Try this..
SELECT SINGLE bil_date
INTO (v_date)
FROM tableA
WHERE bil_date < ( select min( BIL_DAT )
FROM table A
WHERE key = 'ab' ).
Thanks
Naren
‎2007 Nov 05 3:35 AM
check
sort b by GDATU.
Read b index 1.
if sy-subrec =0.
LV_DATE = b-GDATU
endif.
Select *
From a
WHERE BIL_DAT LE LT LV_DATE.
‎2007 Nov 05 3:41 AM
Hello Sudarshan,
If you want to compare date fields in two tables there might be somr other common fields also .
You can Loop internal Table A
and use Read statment based on other common fields to get record of B in work area..
Then compare the work area data of table A against the work area of B..
Hope this Helps.
Thanks
Praveen