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: 

HI PLZ URGENT

Former Member
0 Kudos

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

11 REPLIES 11

Former Member
0 Kudos

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

0 Kudos

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

0 Kudos

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

0 Kudos

hi ,,,i am getting idate erroe as unknown

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

0 Kudos

HI ANJI

i am not getting .any other way plz

Former Member
0 Kudos

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>

0 Kudos

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

0 Kudos

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.

0 Kudos

Hi,

I guess then you should implement the corrections as suggested.

Regards, Joerg