2007 Jan 11 11:17 AM
Hi,
i need to select record from kona and the query shud go like this:
SELECT knuma, datab, datbi, bosta and abrex from table kona where vkorg,
vtweg and bonem are equals to values of selection screen and valid on
value is between datab and datbi.
need to check while writing select query if the selection screen date is between datab and datbi how shall i achieve this?
regards
Gunjan
Message was edited by:
Gunjan Kumar
2007 Jan 11 11:19 AM
Hi,
You cann use the event
At selection-screen on field S_date.
Write the validation code here.
Regards,
Aman
2007 Jan 11 11:19 AM
Hi,
You cann use the event
At selection-screen on field S_date.
Write the validation code here.
Regards,
Aman
2007 Jan 11 11:21 AM
2007 Jan 11 11:21 AM
Hi..
Write the select .. and in where condition for the dates ..
datab LE selection screen date
datbi GE selection screen date .
Regards,
GSR.
2007 Jan 11 11:22 AM
between is the right clause.
or you may use in...
but here into is missing try to include that.
and if you have an option to give select option for date do that because between clause may decrease your performance.
regards
shiba dutta
2007 Jan 11 11:22 AM
If the datab and datbi are inclusive , you can use like below
datab le f_date
datbi ge f_date
otherwise you can use like below,
datab lt f_date
datbi gt f_date
where f_date is the selection date
2007 Jan 11 11:23 AM
Hello,
U can check this in the at selection-screen event
If validon between batab and datbi.
If useful reward.
Vasanth
2007 Jan 11 11:24 AM
2007 Jan 11 11:25 AM
Hi Gunjan,
Try with this code.
SELECT KNUMA DATAB DATBI BOSTA ABREX
FROM KONA
INTO TABLE IT_KONA
WHERE VKORG IN S_VKORG
AND VTWEG IN S_VTWEG
AND BONEM IN S_BONEM
AND ( <b>DATAB >= S_VALID-LOW AND DATBI <= S_VALID-HIGH</b> ).
Thanks,
Vinay
2007 Jan 11 11:27 AM
Hi,
tables kona.
types : begin of ty,
knuma type kona-knuma,
datab type kona-datab,
datbi type kona-datbi,
bosta type kona-bosta,
abrex type kona-abrex,
end of ty.
data itab type standard table of ty.
select-options : s_vkorg for kona-vkorg,
s_vtweg for kona-vtweg,
s_bonem for kona-bonem.
SELECT knuma datab datbi bosta abrex from table kona into table itab
where vkorg in s_vkorg
and vtweg in s_vtweg and bonem in s_bonem
and datab GE valid on and datbi LE datbi.