Skip to Content
author's profile photo Former Member
Former Member

select query!!

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

8 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 11, 2007 at 11:19 AM

    Hi,

    You cann use the event

    At selection-screen on field S_date.

    Write the validation code here.

    Regards,

    Aman

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 11, 2007 at 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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 11, 2007 at 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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 11, 2007 at 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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 11, 2007 at 11:23 AM

    Hello,

    U can check this in the at selection-screen event

    If validon between batab and datbi.

    If useful reward.

    Vasanth

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 11, 2007 at 11:24 AM

    just wanted tp cross check thx a lot!!

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 11, 2007 at 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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 11, 2007 at 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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.