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: 

Function modules and generically typed tables

Former Member
0 Kudos
114

I want to write a function module which will take an internal table with an entirely arbitrary line type as its input and output a table in HTML. This is not very difficult to do in ABAP as long as I can get the table in and out. However, I have no idea how to transfer a generic table. At the moment I can see myself having to do something truly horrible to hack around this, when all I want to do is use "describe table" and a couple of "do...enddo" loops.

I really, really hope this is a dead easy question to answer...

1 ACCEPTED SOLUTION

Former Member
0 Kudos
71

Hi,

In Tables Parameters of your FM interface do not give any reference type for your IN table..

For your OUT Table you can use W3HTML as line type.

Hope this helps..

Sri

Message was edited by: Srikanth Pinnamaneni

Message was edited by: Srikanth Pinnamaneni

5 REPLIES 5

Former Member
0 Kudos
72

Hi,

In Tables Parameters of your FM interface do not give any reference type for your IN table..

For your OUT Table you can use W3HTML as line type.

Hope this helps..

Sri

Message was edited by: Srikanth Pinnamaneni

Message was edited by: Srikanth Pinnamaneni

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
71

Well, passing a table thru the interface with no type is easy, just don't assign a structure when defining the interface. It will then take its structure by what is being passed to it.

So if you would pass an internal table to it with the structure like so.

Data: begin of itab occurs 0,
      line(1000) type c,
      end  of itab.

Then that is the structure inside the function module.

Did this answer your question? Please explain further if not.

Regards,

Rich Heilman

Former Member
0 Kudos
71

Thanks guys. I feel like a right tit now! 😛 Can I just ask - what's so special about W3HTML? Am I not better off just passing back something of type string, as I'm obviously never going to go over 2GB of HTML (which I think is the maximum size for type string) and is surely easier to embed into a BSP? Obviously whatever it is I do I want it to be correct.

0 Kudos
71

Hi,

W3HTML is the line type typically used by CL_GUI_HTML_VIEWER or CL_DD classes for the HTML code internal tables.

That is why I have suggested it..

Hope this helps..

Sri

0 Kudos
71

If you want to use a string table, please define your table in the TABLES tab as type WRB_STRING_TABLE.

Regards,

Rich Heilman