on 11-22-2004 2:49 PM
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?
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[] ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In your method definition, try declaring the importing parameter with type ANY.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Frank,
Did you try something like this:
In definition
METHODS methd1 IMPORTING itab TYPE ANY.
In your program
data: lt_range type rseloption,
ls_range type line of rseloption.
ls_range-sign = 'I'.
ls_range-option = 'EQ'.
ls_range-low = 'ABC'.
append ls_range to lt_range.
...
call method methd1( itab = lt_range ).
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.