02-11-2015 10:32 AM
Dear Abap experts,
I want to compare the date with year. How can I do this. I tried this but error.
Regards,
Aneel
select pa2001~aedtm pa2001~begda pa2001~endda pa2001~abwtg pa2001~awart
from pa2001 into corresponding fields of table tvbap
where pa2001~pernr eq so_pernr and pa2001~endda+0(4) eq so_year.
02-13-2015 10:55 AM
Dear All,
I have applied this solution which is more easy I think. Giving for the help of others.
concatenate '%' so_year '%' into so_year.
select * from pa2001 into corresponding fields of table tvbap
where pa2001~pernr eq so_pernr and pa2001~endda like so_year.
Regards,
Aneel
02-11-2015 10:38 AM
You cannot give this in a select statement.
remove that last condition and pa2001~endda+0(4) eq so_year.
Loop tvbap into tvbap_line where endda EQ so_year.
append tvbap_line INTO tvbap_2. "copy into another table
endloop.
02-11-2015 10:39 AM
Hi,
The select statement seems correct just with this correction:
and pa2001~endda+0(4) IN so_year.
Regards,
Suren.
02-11-2015 11:19 AM
Dear Suren,
pa2001~endda+0(4) IN so_year is not working.
Regards
Aneel
02-11-2015 10:43 AM
Did you try to convert you year parameter in a range of date (from january 1st to december 31...)
(just define a range, fill it in a AT SELECTION-SCREEN ON year form, no need to ask user...)
Regards,
Raymond
02-11-2015 10:45 AM
Hi,
can you try like this?
declere - range : date.
take years (so_year) start date and end date and create that in date range.
and pass that to your select query.
Regards-
Makarand
02-11-2015 11:21 AM
Dear All,
Thanks for your help. Let me check these solution and come back to you.
Regards,
Aneel
02-13-2015 10:55 AM
Dear All,
I have applied this solution which is more easy I think. Giving for the help of others.
concatenate '%' so_year '%' into so_year.
select * from pa2001 into corresponding fields of table tvbap
where pa2001~pernr eq so_pernr and pa2001~endda like so_year.
Regards,
Aneel