Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

pass the internal table with different structures to the class module

Madhurivs23
Participant
0 Kudos

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

1 REPLY 1

Former Member
0 Kudos

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.