‎2008 Dec 18 4:06 AM
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
‎2008 Dec 18 4:11 AM
‎2008 Dec 18 4:11 AM
‎2008 Dec 18 4:28 AM
Hi Vinay,
After using this select stamt are you geting any error or ?
‎2008 Dec 18 4:32 AM
Thanks Guys , Its working , nothing was wrong with statement , My logic was wrong
Vinay Kolla
‎2008 Dec 18 4:30 AM
Hi,
Use like this
kdatb GE in_valid_date
kdate LE in_valid_date
>= is GE,
<= is LE
‎2008 Dec 18 4: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