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

Pass internal table of selection-options through method!

I created a selection screen with multiple select-options. Now I want in a method of a class work with the internal tables of the select options.

But the internal tables are dynamic, depending on the lenght of the fieldtype.

If I want to pass the internal table through a method defining the type as RSELOPTION, then the LOW en HIGH have different length and I get a compatible problem.

How can I solve this?

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Nov 22, 2004 at 03:36 PM

    In your method definition, try declaring the importing parameter with type ANY.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 22, 2004 at 04:36 PM

    Hello Frank,

    you can also declare an (non-Ddic) type and use this in the method signature. With release 640 or higher you might do this within the class itself. In lower releases this option is limited to private methods. So you can eigther make the signature untyped ( type data ) or due the type definition within a type-pool.

    Kind Regards

    Klaus

    REPORT  KZI_TEST_01.
      tables: Trdir.
      select-options:
        p_Progs for Trdir-Name default sy-Repid.
    
       class lcl_Sample definition.
         public section.
    ***************************************************
           types:  ty_Prog_Range type range of Program.
    ***************************************************
           class-methods: list_Authors importing Programs type ty_Prog_Range.
       endclass.
    
       class lcl_Sample implementation.
         method list_Authors.
           data: author_Name type sy-Uname.
           select Cnam from Trdir into author_Name where Name in Programs.
             write: / author_Name.
           endselect.
         endmethod.
       endclass.
    
    start-of-selection.
      lcl_Sample=>list_Authors( p_Progs[] ).
    

    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.