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: 

selection statement

Former Member
0 Kudos

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

former_member195383
Active Contributor
0 Kudos

s_cldate GT key_date.

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

sachin_mathapati
Contributor
0 Kudos

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

Former Member
0 Kudos

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.