03-02-2012 11:24 AM
Hi ,
I have created a class method to fill up the data in XML format. the method can be called from various programs with internal table with different structures. I want to pass it as dynamic How can I do that.
I tried to declare that as type any.
but not working.
regards,
Madhuri
03-02-2012 1:13 PM
Hi,
You could work with data reference.
Use GET REFERENCE OF itab INTO data_ref for passing the internal table to your method, and dereference it within the method with ASSIGN statement...
DATA: lr_data TYPE REF TO data.
GET REFERENCE OF itab INTO lr_data.
CALL METHOD meth EXPORTING pr_data = lr_data.
METHOD meth.
FIELD-SYMBOLS <fs> TYPE ANY TABLE
ASSIGN pr_data->* TO <fs>.
ENDMETHOD.
Kr,
Manu.