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

Range table

Former Member
0 Likes
621

Hi experts,

I am trying to use a range table.

Anyone can tell me how to define a range table like this?

fieldname-sign-option-low-high

zip-I-eq---30152

zip-I-bt-30111-30113

yeare-lt---2005

etc etc....

Zip and Year are different data type of course.

I saw this example here

Thanks in advance!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
604

I think that in that example, they were trying to build a dynamic where clause out of multiple ranges. I don't think you can have multiple fields in a single range table.

Rob

5 REPLIES 5
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
604

You can do the ZIP like this.




report zrich_0001 .

data: zip(5) type n.


ranges: r_zip for zip.


REgards,

Rich Heilman

Read only

0 Likes
604



data: zip(5) type n.
data: year(4) type c.


ranges: r_zip for zip.
ranges: r_year for year.


clear r_zip.
r_zip-sign   = 'I'.
r_zip-option = 'EQ'.
r_zip-low    = '30152'.
append r_zip.

clear r_zip.
r_zip-sign   = 'I'.
r_zip-option = 'BT'.
r_zip-low    = '30111'.
r_zip-high   = '30113'.
append r_zip.

clear r_year.
r_year-sign   = 'E'.
r_year-option = 'LT'.
r_year-low    = '2005'.
append r_year.



if p_zip in r_sip
  and p_year in r_year.
  
  
  
endif.


REgards,

Rich Heilman

Read only

Former Member
0 Likes
605

I think that in that example, they were trying to build a dynamic where clause out of multiple ranges. I don't think you can have multiple fields in a single range table.

Rob

Read only

Former Member
0 Likes
604

Hi Linda,

Just use statement.

RANGES: R_ZIP FOR ADRC-POST_CODE1,

R_YEAR FOR YEAR.

R_ZIP-SIGN = 'I'.

R_ZIP-OPTION = 'EQ'.

R_ZIP-LOW = '30152'.

APPEND R_ZIP.

R_ZIP-SIGN = 'I'.

R_ZIP-OPTION = 'BT'.

R_ZIP-LOW = '30111'.

R_ZIP-HIGH = '30113'.

APPEND R_ZIP.

R_YEAR-SIGN = 'E'.

R_YEAR-OPTION = 'LT'.

R_YEAR-LOW = '2005'.

APPEND R_YEAR.

Read only

Former Member
0 Likes
604

Thank you all guys.

Doubt cleared.

It is impossible to put two different fields in one range table.

Points awarded!

Linda