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 Range

Former Member
0 Likes
815

Hi, I need to pass data from one range structure to a dynamic range.

The problem is that the program dump in the append line.

Here it's the code

DATA: lv_rangename TYPE char10 VALUE 'LR_RANGE1'.

FIELD-SYMBOLS: <fs-range> TYPE TABLE.

....

      CONCATENATE 'LR_RANGE'

                                     lv_count

                           INTO lv_rangename.

      ASSIGN (lv_rangename) TO <fs-range>.

....

    lr_range-sign    = 'I'.

    lr_range-option = 'EQ'.

    lr_range-low      = gt_bon_param-fieldvalue.

    APPEND lr_range TO <fs-range>.

How can I do this?

Regards,

Mariano.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
701

Hi Mariano

I tried replicate your problem, and I think the solution is this:

*For example I have a table of range.

   SELECT-OPTIONS:LR_RANGE FOR usr02-bname.

* Is requeride uses the characters [] in description of table


DATA:lv_rangename TYPE char10 value 'LR_RANGE[]' .
FIELD-SYMBOLS: <fs_range> TYPE TABLE .


*&---------------------------------------------------------------------*
*&      START-OF-SELECTION
*&---------------------------------------------------------------------*
START-OF-SELECTION.

ASSIGN (lv_rangename) TO <fs_range>.
LR_RANGE-sign = 'I'.
LR_RANGE-option = 'I'.
LR_RANGE-low = '10'.

   APPEND LR_RANGE TO <fs_range> .

THe result is table LR_RANGE with data.

3 REPLIES 3
Read only

Former Member
0 Likes
702

Hi Mariano

I tried replicate your problem, and I think the solution is this:

*For example I have a table of range.

   SELECT-OPTIONS:LR_RANGE FOR usr02-bname.

* Is requeride uses the characters [] in description of table


DATA:lv_rangename TYPE char10 value 'LR_RANGE[]' .
FIELD-SYMBOLS: <fs_range> TYPE TABLE .


*&---------------------------------------------------------------------*
*&      START-OF-SELECTION
*&---------------------------------------------------------------------*
START-OF-SELECTION.

ASSIGN (lv_rangename) TO <fs_range>.
LR_RANGE-sign = 'I'.
LR_RANGE-option = 'I'.
LR_RANGE-low = '10'.

   APPEND LR_RANGE TO <fs_range> .

THe result is table LR_RANGE with data.

Read only

0 Likes
701

Thanks my friend!!

The problem was that I forget the "[]" in the range name.

Have a happy new year.

Regards.

Mariano.

Read only

edgar_nagasaki
Contributor
0 Likes
701

Hi Mariano,

Check this thread, it well explains what you need: http://scn.sap.com/thread/1725739

Edgar