‎2007 Dec 12 8:58 AM
Hi,
I have a function module with a TABLE parameter with generic type TABLE.
I have to pass these table parameter to a method in the class, then what should be the type of the corresponding parameter inside my class.
Regards,
Anoop
‎2007 Dec 12 9:11 AM
<b>STANDARD TABLE</b> should work from a function module table param. Otherwise <b>ANY TABLE</b>
If your function module table parameter is "<b>mytab</b>", you may have to call the method using <b>mytab[].</b>
matt
‎2007 Dec 12 9:11 AM
<b>STANDARD TABLE</b> should work from a function module table param. Otherwise <b>ANY TABLE</b>
If your function module table parameter is "<b>mytab</b>", you may have to call the method using <b>mytab[].</b>
matt
‎2007 Dec 12 9:43 AM
As if now i had passed mytab from fn mod to the method.
Now i have to assign it to a class attribute
Could u please guide me to create a class attribute with generic type to assign this value.
[I have tried to create a class attribute with type STANDARD TABLE but it shows error msg like Generic type not possible for class attribute...]
‎2007 Dec 12 11:27 AM
Ah, you can't create a generic class attribute. But you <b>can</b> create a data reference to a generic object.
Instead of creating an attribute "mytab", create an attribute that is a reference to data,e.g. <b>ref_mytab</b>, of type REF TO DATA.
In your method, where you've received the table through the parameters (e.g. it_mytab TYPE STANDARD TABLE ), do this:
GET REFERENCE OF it_mytab INTO ref_mytab.Whenever you need to do something with the table, do this:
FIELD-SYMBOLS: <mytab> TYPE STANDARD TABLE.
ASSIGN ref_mytab->* TO <mytab>.matt