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

Help with ranges.

Former Member
0 Likes
831

Hi!,

Is the first time that I work with ranges, some body can explain me this code? I dont know if the append in this code is correct or I need to put it below of it r_bstat-low and I dont know how can I use the LOW or High part in this code.

Thanks!!


ranges: r_bstat for bkpf-bstat occurs 0.

  r_bstat-sign     = 'E'.
  r_bstat-option   = 'EQ'.
  r_bstat-LOW      = 'S'.
  r_bstat-LOW      = 'V'.
  r_bstat-LOW      = 'W'.
  r_bstat-LOW      = 'Z'.
  r_bstat-LOW      = 'D'.

  APPEND R_BSTAT.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
811

Hi Carlos,

Change your code as mentioned below:

r_bstat-sign = 'E'.

r_bstat-option = 'EQ'.

r_bstat-LOW = 'S'.

APPEND R_BSTAT.

r_bstat-sign = 'E'.

r_bstat-option = 'EQ'

r_bstat-LOW = 'V'.

APPEND R_BSTAT.

r_bstat-sign = 'E'.

r_bstat-option = 'EQ'

r_bstat-LOW = 'W'.

APPEND R_BSTAT.

r_bstat-sign = 'E'.

r_bstat-option = 'EQ'

r_bstat-LOW = 'Z'.

APPEND R_BSTAT.

r_bstat-sign = 'E'.

r_bstat-option = 'EQ'

r_bstat-LOW = 'D'.

APPEND R_BSTAT.

Hope this may help you.

Lanka

6 REPLIES 6
Read only

Former Member
0 Likes
812

Hi Carlos,

Change your code as mentioned below:

r_bstat-sign = 'E'.

r_bstat-option = 'EQ'.

r_bstat-LOW = 'S'.

APPEND R_BSTAT.

r_bstat-sign = 'E'.

r_bstat-option = 'EQ'

r_bstat-LOW = 'V'.

APPEND R_BSTAT.

r_bstat-sign = 'E'.

r_bstat-option = 'EQ'

r_bstat-LOW = 'W'.

APPEND R_BSTAT.

r_bstat-sign = 'E'.

r_bstat-option = 'EQ'

r_bstat-LOW = 'Z'.

APPEND R_BSTAT.

r_bstat-sign = 'E'.

r_bstat-option = 'EQ'

r_bstat-LOW = 'D'.

APPEND R_BSTAT.

Hope this may help you.

Lanka

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
811

If you wish to exclude all of those values, you need to append to the table for each.




ranges: r_bstat for bkpf-bstat. 
 r_bstat-sign     = 'E'. 
 r_bstat-option   = 'EQ'. 
 r_bstat-LOW      = 'S'.  APPEND R_BSTAT.
 r_bstat-LOW      = 'V'.  APPEND R_BSTAT.
 r_bstat-LOW      = 'W'.  APPEND R_BSTAT.
 r_bstat-LOW      = 'Z'.  APPEND R_BSTAT.
 r_bstat-LOW      = 'D'.  APPEND R_BSTAT.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
811

HI Carlos,

You have to append each time for LOW to the field.

r_bstat-sign = 'E'.

r_bstat-option = 'EQ'.

r_bstat-LOW = 'S'.

APPEND R_BSTAT.

r_bstat-sign = 'E'.

r_bstat-option = 'EQ'.

r_bstat-LOW = 'V'.

APPEND R_BSTAT.

etc etc....

Read only

Former Member
0 Likes
811

Try:


ranges: r_bstat for bkpf-bstat occurs 0.
 
  r_bstat-sign     = 'E'.
  r_bstat-option   = 'EQ'.
  r_bstat-LOW      = 'S'.
  APPEND R_BSTAT.
  r_bstat-LOW      = 'V'.
  APPEND R_BSTAT.
  r_bstat-LOW      = 'W'.
  APPEND R_BSTAT.
  r_bstat-LOW      = 'Z'.
  APPEND R_BSTAT.
  r_bstat-LOW      = 'D'.
  APPEND R_BSTAT.
 

Rob

Read only

Former Member
0 Likes
811

hi Carlos,

You can use the RANGES statement to create internal tables of the same type as selection

tables...

i.e..

This statement is simply a shortened form of the following statements:

DATA: BEGIN OF <rangetab> OCCURS 0,

SIGN(1),

OPTION(2)

LOW LIKE <f>,

HIGH LIKE <f>,

END OF <rangetab>.

hope you got the idea behind ranges..

Internal tables created with RANGES have the same structure as selection tables, but they do

not have the same functionality.

RANGES R_CARRID FOR SPFLI-CARRID.

R_CARRID-SIGN = 'I'.

R_CARRID-OPTION = 'EQ'.

R_CARRID-LOW = 'LH'.

APPEND S_CARRID.

IF CARRID IN R_CARRID.

Does this answer your question...

Read only

Former Member
0 Likes
811

Thanks for the help people, now I understand better the ranges.