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

Ranges statement in Classes

Former Member
0 Likes
9,764

Hi,

Can someone tell how to assign values to ranges table in Classes. Have declared it as

DATA: r1 type range of afih-AUFNR.

regards,

cs

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
4,308

Hi,

REPORT rich_0001.

----


  • CLASS lcl_app DEFINITION

----


*

----


CLASS lcl_app DEFINITION.

PUBLIC SECTION.

DATA: it_t000 TYPE TABLE OF t000.

DATA: it_mandt TYPE RANGE OF t000-mandt,

wa_mandt LIKE LINE OF it_mandt.

METHODS : test.

ENDCLASS. "lcl_app DEFINITION

----


  • CLASS lcl_app IMPLEMENTATION

----


*

----


CLASS lcl_app IMPLEMENTATION.

METHOD test.

wa_mandt-low = '100'.

wa_mandt-sign = 'I'.

wa_mandt-option = 'EQ'.

APPEND wa_mandt TO it_mandt.

wa_mandt-low = '200'.

APPEND wa_mandt TO it_mandt.

SELECT * FROM t000

INTO TABLE it_t000

WHERE mandt IN it_mandt.

ENDMETHOD. "test

ENDCLASS. "lcl_app IMPLEMENTATION

DATA: o_ref TYPE REF TO lcl_app.

START-OF-SELECTION.

CREATE OBJECT o_ref.

o_ref->test( ).

Regards,

Shiva Kumar

4 REPLIES 4
Read only

Former Member
0 Likes
4,308

DATA: my_range TYPE RANGE OF spfli-carrid.

Regards

Kiran Sure

Read only

Former Member
0 Likes
4,310

Hi,

REPORT rich_0001.

----


  • CLASS lcl_app DEFINITION

----


*

----


CLASS lcl_app DEFINITION.

PUBLIC SECTION.

DATA: it_t000 TYPE TABLE OF t000.

DATA: it_mandt TYPE RANGE OF t000-mandt,

wa_mandt LIKE LINE OF it_mandt.

METHODS : test.

ENDCLASS. "lcl_app DEFINITION

----


  • CLASS lcl_app IMPLEMENTATION

----


*

----


CLASS lcl_app IMPLEMENTATION.

METHOD test.

wa_mandt-low = '100'.

wa_mandt-sign = 'I'.

wa_mandt-option = 'EQ'.

APPEND wa_mandt TO it_mandt.

wa_mandt-low = '200'.

APPEND wa_mandt TO it_mandt.

SELECT * FROM t000

INTO TABLE it_t000

WHERE mandt IN it_mandt.

ENDMETHOD. "test

ENDCLASS. "lcl_app IMPLEMENTATION

DATA: o_ref TYPE REF TO lcl_app.

START-OF-SELECTION.

CREATE OBJECT o_ref.

o_ref->test( ).

Regards,

Shiva Kumar

Read only

matt
Active Contributor
0 Likes
4,308

DATA: r1  type range of afih-AUFNR,
      r1l type line of r1.

r1l-option = 'BT'.
r1l-sign = 'I'.
r1l-low = l_aufnr-low.
r1l-high = l_aufnr-high.

INSERT r1l INTO TABLE r1.

matt

Read only

Former Member
0 Likes
4,308

Hi Shiva and Matt,

Thanks for the help.

regards,

cs