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

Select statement not working

SELECT * FROM zstv_ekko_ekpo INTO CORRESPONDING FIELDS OF TABLE lt_poitems

UP TO lv_rec_to ROWS

WHERE ebeln IN lr_po_number

AND bsart IN lr_doc_type

AND loekz EQ space "not deleted

AND reswk IN lr_suppl_plant

AND bedat IN lr_post_date

AND matnr IN lr_material

AND werks IN lr_plant

AND lifnr IN lr_vendor

AND bednr IN lr_trackingno

AND elikz IN lr_deliv_compl_ind

AND frgke IN lr_approve_status

AND bsgru IN lr_order_reason

AND kdatb >= in_valid_date

AND kdate <= in_valid_date

ORDER BY (lv_order).

the above query is not working when I include kdatb >= in_valid_date AND kdate <= in_valid_date.

zstv_ekko_ekpo is the database view .

Thanks vinay

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 18, 2008 at 04:11 AM

    Use it like this

    kdatb gt in_valid_date

    kdate lt in_valid_date

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 18, 2008 at 04:28 AM

    Hi Vinay,

    After using this select stamt are you geting any error or ?

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 18, 2008 at 04:30 AM

    Hi,

    Use like this

    kdatb GE in_valid_date

    kdate LE in_valid_date

    >= is GE,

    <= is LE

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 18, 2008 at 04:42 AM

    HI,

    SELECT * FROM zstv_ekko_ekpo INTO CORRESPONDING FIELDS OF TABLE lt_poitems

    UP TO lv_rec_to ROWS

    WHERE ebeln IN lr_po_number

    AND bsart IN lr_doc_type

    AND loekz EQ space "not deleted

    AND reswk IN lr_suppl_plant

    AND bedat IN lr_post_date

    AND matnr IN lr_material

    AND werks IN lr_plant

    AND lifnr IN lr_vendor

    AND bednr IN lr_trackingno

    AND elikz IN lr_deliv_compl_ind

    AND frgke IN lr_approve_status

    AND bsgru IN lr_order_reason

    AND kdatb >= in_valid_date

    AND kdate <= in_valid_date

    ORDER BY (lv_order).

    the above query is not working when I include kdatb >= in_valid_date AND kdate <= in_valid_date.

    zstv_ekko_ekpo is the database view .

    Try reversing the statement, Make it

    KDATB <= in_valid_date

    kdate >= in_valid_date.

    As kdtab is the start of validity date it requires to be less than or equal to the current date. and kdate is end of validity date it should be greater than or equal to the given date.

    Say for a particular records.

    KDATE = 16/12/08

    KDATB = 12/12/08

    given_date = 13/12/08

    Now

    kdatb <= given_date (True)

    and kdate >= given_date (True.

    Hope it will help.

    With best regards,

    Navneet Chaubey

    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.