10-10-2007 12:14 PM
HI ALL
SELECT SINGLE knumh FROM a081 INTO wf_knumh WHERE datbi < idate AND
datab > idate AND KONT_PACK = WF-PCKG_NO AND KONT_ZEILE = WF-LINE_NO
.
INPUT IS IDATE,THERE is one record in datbase table for this condtion.
but i am not getting. i dont how the dates r compared?
plz give me ur suggestions
10-10-2007 12:23 PM
Hi,
Just an idea - DATBI is "date to" and DATAB is "date from" so you are checking whether your date is later than "date from" <i>and</i> earlier than "date to". Are you sure that's correct and not the other way around?
Regards, Joerg
10-10-2007 12:28 PM
hi jeorg, its very urgent for me,
i am checking whether my input is less than DATBI and greater than DATAB.
I am giving the input as mm/dd/yyyy.but during debugging, it becomes yyyy/mm/dd. i guess that may be the problem. how to bring the to common.
regards
karthik
IND
10-10-2007 12:36 PM
Hi,
SELECT SINGLE knumh
FROM a081
INTO wf_knumh
WHERE
datbi < idate AND datab > idate
AND KONT_PACK = WF-PCKG_NO
AND KONT_ZEILE = WF-LINE_NO
I believe you are checking whether
datab > idate < datbi
You should be checking
datab < idate < datbi
So try this:
SELECT SINGLE knumh
FROM a081
INTO wf_knumh
WHERE
datab < idate AND idate < datbi
AND KONT_PACK = WF-PCKG_NO
AND KONT_ZEILE = WF-LINE_NO
Take care of the boundary conditions, i. e. what should happen if <b>idate</b> = <b>datab</b> or <b>idate</b> = <b>datbi</b>?
If you are working with the ABAP data type DATE (A081-DATAB) is of that type, then the internal format of the variables is <i>always</i> YYYYMMDD. Sometimes this is displayed in other formats - depending on cultural and/or language settings, but the internal format is always the same.
Hope this helps (please reward me if it does).
Regards, Joerg
10-10-2007 12:44 PM
10-10-2007 12:23 PM
suppose begin date is p_begda and end date is p_endda
then genrally to get records we use....
begda le p_endda
and
endda ge p_begda
But it will be according to ur requirement....
try using....
SELECT SINGLE knumh FROM a081 INTO wf_knumh WHERE datbi le idate AND
datab ge idate AND KONT_PACK = WF-PCKG_NO AND KONT_ZEILE = WF-LINE_NO.
10-10-2007 12:27 PM
Hi
try this and see
SELECT SINGLE knumh FROM a081 INTO wf_knumh
WHERE KONT_PACK = WF-PCKG_NO AND KONT_ZEILE = WF-LINE_NO
and ( datbi le idate AND datab ge idate ).
Regards
ANJI
10-10-2007 12:38 PM
10-10-2007 12:28 PM
Hi
you had created one internal table in that please remove unwanted fields
just keep knumh filed then it will retrive the data
i had faced same problem once at that time my internal table contains unnessary fields
my logic is correct but i am not getting any output at that time i had declared my internal table with what values i want
then it had executed sucessfully
do like that
<b>Reward if usefull</b>
10-10-2007 12:45 PM
Hi kartikeyan,
can you tell the requirement clearly.,.
as If u need the Record with Validity end date Less than idate(Not even sure whether idate is parameter or wht)
Wht code you have writen wont work
Try using.,.
SELECT SINGLE knumh
FROM a081 INTO wf_knumh
WHERE datbi > idate (instead of datbi < idate) AND
datab < idate( instead of datab > idate)
AND KONT_PACK = WF-PCKG_NO
AND KONT_ZEILE = WF-LINE_NO.
Try using this as startdate can not be less than end date.
DATBI KODATBI Validity end date of the condition record
DATAB KODATAB Validity start date of the condition record
10-10-2007 12:50 PM
hi
i am giving the idate as my input parameter. i ahve to check whether the date is between the datab and dabtbi
this is my requirement.
10-10-2007 12:52 PM
Hi,
I guess then you should implement the corrections as suggested.
Regards, Joerg