Skip to Content
author's profile photo Former Member
Former Member

How to declare a param. of type RANGE OF in a method (or function module)?

Hello,

I've got a following problem.

I want to pass a value of type RANGE OF to a method declared in

an interface (the interface is built using Class Builder). I don't know

how to do that and I did not manage to find a solution using both

SAP help and google.

Did anybody have the same problem before?

--

Best regards

Pawel

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 12:41 PM

    Hi,

    see my posting .

    You can specify such a table type in DDIC.

    Regards Rudi

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 10:42 AM

    HI I did it for the function module...i had passed the ranges for the function module

    in the tables devlare the fields like this.

    r_matnr like RANGE_WERKS

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 18, 2008 at 10:40 AM

    Hi,

    Can u tell me the method name and class name to which u want to pass the range values.

    Regards,

    Ruby

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 11:20 AM

    Ok, I find a workaround. Maybe it will be useful for somebody in the future.

    Declare the parameter type as ANY TABLE and then cast it to the expected type

    in the body of the method.

    So for example.

    Parameter Type Typing Method Associated Type

    I_RNG_DATUM Importing Type ANY TABLE

    In the body of the method.

    TYPES:

    erdat_range TYPE RANGE OF erdat.

    FIELD-SYMBOLS:

    <l_fs_rng_erdat> TYPE erdat_range.

    DATA:

    l_ref_to_range TYPE REF TO data.

    GET REFERENCE OF i_rng_datum INTO l_ref_to_range.

    ASSIGN l_ref_to_range->* TO <l_fs_rng_erdat> CASTING.

    However, if somebody know how to pass type RANGE OF

    explicitely, the right answer is still welcome.

    Best regards

    Pawel

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 12:45 PM

    Hi,

    data:

    w_matid TYPE matnr,

    • Range table for matid

    rt_matid LIKE RANGE OF w_matid,

    • Workarea for matid

    wa_matid LIKE LINE OF rt_matid.

    Thanks,

    Rajinikanth G

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.