Skip to Content

How to create structure from formal parameter TABLE TYPE ANY TABLE

Hi,

I have a FM where TABLES data_tab TYPE ANY TABLE.

Inside the FM I would like to create structure typed as line of this table. I know that generic type can't be used to create other types but maybe there is other way to do this.

I tried this way:

FIELDS-SYMBOLS: <fs> type any.

Loop at data_tab.

assign data_tab to <fs>. "now <fs> contains line of data_tab...

exit.

Endloop.

"..but...

data: begin of ls_struct.

include structure <fs>. "...here I receive 'The included type has no type'

data: end of ls_struct.

Any ideas?

Thx in advance.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2008 at 09:09 AM

    Hi Marcin,

    data: begin of ls_struct.

    include structure <fs>.

    data: end of ls_struct.

    In this case <fs> has no structure at complie time.

    anyways u have not assigned <fs> to any data type which has structure, hence the error.

    regards,

    Vaibhav Modi.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 29, 2008 at 09:19 AM

    So is there any other way to create such structure?

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.