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

Dynamic SQL with var range

Former Member
0 Likes
519

Hi

I have dynamic sql:

CONCATENATE 'datum <= ''' datumOP '''' INTO whereLine.

APPEND whereLine TO iwhereSQL.

select * from table WHERE (iwhereSQL)

but when I change it to:

  • datumRG is like parameter range

CONCATENATE 'datum IN ''' datumRG '''' INTO whereLine.

APPEND whereLine TO iwhereSQL.

then this don't work, it isn't correct.

How to define dynamic SQL with range field?

3 REPLIES 3
Read only

Former Member
0 Likes
485

Hi Kosmo,

use following code.

select-options: datumRG for sy-datum.

CONCATENATE 'datum IN ' 'datumRG ' INTO whereLine separated by space.

Regards,

Yellappa.

Edited by: yellappa m on Feb 22, 2008 6:56 PM

Read only

Former Member
0 Likes
485

It isn't too simple

Your code give effect "datum IN ' IEQ2008022200000000 '"

It's not work

Read only

0 Likes
485

Then you have to deal with every cases included within the select-option : EQ, but also BT, NE, GT, etc.

Loop at your select option and do some transalation with a Case/When.

N.H.