Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

select query!!

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

You cann use the event

At selection-screen on field S_date.

Write the validation code here.

Regards,

Aman

9 REPLIES 9

Former Member
0 Kudos

Hi,

You cann use the event

At selection-screen on field S_date.

Write the validation code here.

Regards,

Aman

0 Kudos

this is not the validation code..normal select query!!

Former Member
0 Kudos

Hi..

Write the select .. and in where condition for the dates ..

datab LE selection screen date

datbi GE selection screen date .

Regards,

GSR.

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Hello,

U can check this in the at selection-screen event

If validon between batab and datbi.

If useful reward.

Vasanth

Former Member
0 Kudos

just wanted tp cross check thx a lot!!

Former Member
0 Kudos

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

jayanthi_jayaraman
Active Contributor
0 Kudos

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.