Skip to Content
author's profile photo Former Member
Former Member

Field symbols or ?

Hi,

its possible form internal table like this:

-


tabname | row | columnName | columnValue

-


t005 | 1 | land1 | AD

t005 | 1 | landk | AND

t005 | 1 | lnplz | 00

...

t005 | 2 | land1 | AS

t005 | 2 | landk | ND

t005 | 2 | lnplz | 01

to create internal table "t005" in this structure:

-


row| land1 | landk | lnplz | ...

-


1 | AD | AND | 00

2 | AS | ND | 01

...

(use field-symbols, or dynamic attribute declarations...)

thanks, m

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 Apr 25, 2007 at 02:20 PM

    use the Field symbols...for this requirement.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 25, 2007 at 02:23 PM

    Try this...

    Get the T005 data into internal table as first table...

    -


    tabname | row | columnName | columnValue

    -


    t005 | 1 | land1 | AD

    t005 | 1 | landk | AND

    t005 | 1 | lnplz | 00

    ...

    t005 | 2 | land1 | AS

    t005 | 2 | landk | ND

    t005 | 2 | lnplz | 01

    Now declare another internal table in the form...

    -


    row| land1 | landk | lnplz | ...

    -


    sort itab_t005 by tablename row.

    now loop at itab_t005.

    at new row.

    clear itab_new.

    endat.

    if itab_t005-columename eq 'land1.

    itab_new-land1 = itab_t005-columevalue.

    endif.

    the same for other two....

    at end of row.

    append itab_new.

    endat.

    endloop.

    Hope this will solve ur porblem...

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Yes, using case...endcase will solve it, but there are about 50 tables with many columns, which should be handled in program this way, so it will be a work for few days. Therefore I was thinking of using field-symbols, but here is also problem -> I need to somehow transform each row from the first table into structure like:

      land1 | AD

      landk | AND

      ...

      and then will be posible to use "Assign component "LAND1" of structure ...",

      Any idea how to do it?

      thanks,

      m

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.