Application Development and Automation 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: 
Read only

selection statement

Former Member
0 Likes
669

i want to check this condition ina select statement

if clearing date in s_cldate or clearing date

is greater than key date

wat will be the syntax

6 REPLIES 6
Read only

former_member195383
Active Contributor
0 Likes
647

s_cldate GT key_date.

Read only

Former Member
0 Likes
647

Hi,

Select *

from TABLE

into ITAB

where CLEARING_DATE in S_CLDATE

or CLEARING_DATE gt V_KEY_DATE

--> Is this you want?

Reward points if it is helpful.

Edited by: Ravi Kumar on Jun 20, 2008 8:50 AM

Read only

Former Member
0 Likes
647

select *

from....

into ......

where clear_date in s_idate or

clear_date GT key_day.

or

this will be the better option.

s_date-low = key_date

s_daet-sign = 'I'.

s_date-option = 'GT'.

append it to ur select option internal table

select *

from....

into ......

where clear_date in s_date.

Edited by: S.r.v.r.Kumar on Jun 20, 2008 12:15 PM

Read only

Former Member
0 Likes
647

SELECT * from <table name>

INTO TABLE <itab>

WHERE cldate IN S_CLDATE

OR cldate GT key_date .

IF s_date contains SINGLE date rather than range then.

READ TABLE S_CLDATE INDEX 1.

SELECT * from <table name>

INTO TABLE <itab>

FOR ALL ENTRIES IN S_CLDATE

WHERE cldate GT S_CLDATE-LOW.

Regards,

Swarup.

Edited by: swarup basagare on Jun 20, 2008 8:51 AM

Read only

sachin_mathapati
Contributor
0 Likes
647

Hi ,

What you can do is, append all the dates(s_cldate ,clearing date) in internal table itab and delete entries from itab if date is less than key date .Then use select query for all entries in itab where date = date.

Regards,

Sachin M M

Read only

Former Member
0 Likes
647

Hi,

Try the code below :



select f1 f2 from <dbtabel> into table itab
             where ( augdt in s_cldate 
                OR augdt > key_date ).

Thanks,

Sriram Ponna.