<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Create Dynamic Structure at Runtime via ALV-Methods! in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-dynamic-structure-at-runtime-via-alv-methods/m-p/7447253#M1552441</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i try to create at the ABAP Runtime a new Structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;FOR EXAMPLE:&lt;/STRONG&gt;&lt;/U&gt; I have a internal Table "database" and i dont know their Structure or Typ.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;MY Question:&lt;/STRONG&gt;&lt;/U&gt; How can i get the structuretype for this internal Table "database" ??&lt;/P&gt;&lt;P&gt;                                I thought that it is possible with ALV-Methods, but i dont find the right way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;First Step&lt;/STRONG&gt;:&lt;/EM&gt;       I must get the structure of this internal Table.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Second Step:&lt;/STRONG&gt;&lt;/EM&gt; I must create a workarea/ line of this internal Table, that i can work row for row with the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have someone an code example for me, because iám very confused about this Problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With kind regards.&lt;/P&gt;&lt;P&gt;Ersin Tosun&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Nov 2010 13:01:28 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-11-18T13:01:28Z</dc:date>
    <item>
      <title>Create Dynamic Structure at Runtime via ALV-Methods!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-dynamic-structure-at-runtime-via-alv-methods/m-p/7447253#M1552441</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i try to create at the ABAP Runtime a new Structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;FOR EXAMPLE:&lt;/STRONG&gt;&lt;/U&gt; I have a internal Table "database" and i dont know their Structure or Typ.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;MY Question:&lt;/STRONG&gt;&lt;/U&gt; How can i get the structuretype for this internal Table "database" ??&lt;/P&gt;&lt;P&gt;                                I thought that it is possible with ALV-Methods, but i dont find the right way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;First Step&lt;/STRONG&gt;:&lt;/EM&gt;       I must get the structure of this internal Table.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Second Step:&lt;/STRONG&gt;&lt;/EM&gt; I must create a workarea/ line of this internal Table, that i can work row for row with the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have someone an code example for me, because iám very confused about this Problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With kind regards.&lt;/P&gt;&lt;P&gt;Ersin Tosun&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Nov 2010 13:01:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-dynamic-structure-at-runtime-via-alv-methods/m-p/7447253#M1552441</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-18T13:01:28Z</dc:date>
    </item>
    <item>
      <title>Re: Create Dynamic Structure at Runtime via ALV-Methods!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-dynamic-structure-at-runtime-via-alv-methods/m-p/7447254#M1552442</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For this specific requirement, SAP has provided RTTI class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is a code snippet for your ready reference. In this example we're trying to get the structure of the dynamic table &amp;lt;ITAB&amp;gt; whose structure is not defined till run-time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPE-POOLS: abap.

PARAMETERS: p_table TYPE tabname.

DATA: dref TYPE REF TO data.

FIELD-SYMBOLS &amp;lt;itab&amp;gt; TYPE STANDARD TABLE.

CREATE DATA dref TYPE STANDARD TABLE OF (p_table).
ASSIGN dref-&amp;gt;* TO &amp;lt;itab&amp;gt;.

DATA: go_tab_descr TYPE REF TO cl_abap_tabledescr,
      go_struc_descr TYPE REF TO cl_abap_structdescr,
      wa_comp TYPE abap_compdescr.

go_tab_descr ?= cl_abap_tabledescr=&amp;gt;describe_by_data( &amp;lt;itab&amp;gt; ).

CHECK sy-subrc = 0.

go_struc_descr ?= go_tab_descr-&amp;gt;get_table_line_type( ).

LOOP AT go_struc_descr-&amp;gt;components INTO wa_comp.
  WRITE: / wa_comp-name.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;I must create a workarea/ line of this internal Table, that i can work row for row with the table.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry i missed the Step 2:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FIELD-SYMBOLS: &amp;lt;itab&amp;gt; TYPE STANDARD TABLE,
               &amp;lt;wa&amp;gt; TYPE ANY,
               &amp;lt;val&amp;gt; TYPE ANY.

LOOP AT &amp;lt;itab&amp;gt; ASSIGNING &amp;lt;wa&amp;gt;.
  LOOP AT go_struc_descr-&amp;gt;components INTO wa_comp.
*   To access the components of the structure dynamically
    ASSIGN COMPONENT wa_comp-name OF STRUCTURE &amp;lt;wa&amp;gt; TO &amp;lt;val&amp;gt;.
  ENDLOOP.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Suhas Saha on Nov 18, 2010 7:26 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Nov 2010 13:31:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-dynamic-structure-at-runtime-via-alv-methods/m-p/7447254#M1552442</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2010-11-18T13:31:17Z</dc:date>
    </item>
    <item>
      <title>Re: Create Dynamic Structure at Runtime via ALV-Methods!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-dynamic-structure-at-runtime-via-alv-methods/m-p/7447255#M1552443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi suhas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;many thanks for your excellent help.&lt;/P&gt;&lt;P&gt;When he want make "CREATE DATA dref TYPE STANDARD TABLE OF (&lt;EM&gt;&lt;STRONG&gt;datatab&lt;/STRONG&gt;&lt;/EM&gt;)." than it comes a &lt;U&gt;Error-Message&lt;/U&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Error-Message:&lt;/U&gt;&lt;/STRONG&gt; Runtime-error UC_OBJECTS_NOT_CHARLIKE !!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For again Information, my datatab is an internal table and i dont know what kind of structuretype it is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But why comes this Error-Message??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Nov 2010 15:38:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-dynamic-structure-at-runtime-via-alv-methods/m-p/7447255#M1552443</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-18T15:38:10Z</dc:date>
    </item>
    <item>
      <title>Re: Create Dynamic Structure at Runtime via ALV-Methods!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-dynamic-structure-at-runtime-via-alv-methods/m-p/7447256#M1552444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please review the below code..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: dy_table      TYPE REF TO data,
        dy_line       TYPE REF TO data,.

FIELD-SYMBOLS : &amp;lt;fs_table&amp;gt;    TYPE STANDARD TABLE,
                              &amp;lt;fs_workarea&amp;gt; TYPE ANY,

    V_table will hold the structure name.

    CREATE DATA dy_table TYPE TABLE OF (v_table).
*--Build the Table Details (Fields) at runtime for the Condition Table
    ASSIGN dy_table-&amp;gt;* TO &amp;lt;fs_table&amp;gt;.

    CREATE DATA dy_line LIKE LINE OF &amp;lt;fs_table&amp;gt;.
    ASSIGN dy_line-&amp;gt;* TO &amp;lt;fs_workarea&amp;gt;.

&amp;lt;fs_table&amp;gt; will be your dynamic internal table.
&amp;lt;fs_workarea&amp;gt; will be your dynamic work area.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a limitation in using the OOPS methods for creating the dynamic internal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;SRinivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Nov 2010 16:50:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-dynamic-structure-at-runtime-via-alv-methods/m-p/7447256#M1552444</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-18T16:50:38Z</dc:date>
    </item>
    <item>
      <title>Re: Create Dynamic Structure at Runtime via ALV-Methods!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-dynamic-structure-at-runtime-via-alv-methods/m-p/7447257#M1552445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;Error-Message: Runtime-error UC_OBJECTS_NOT_CHARLIKE&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read the F1 documentation for CREATE DATA &amp;amp; you'll understand why you're getting this error message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;my datatab is an internal table and i dont know what kind of structuretype it is.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway you should've used this piece of code snippet to get the structure of your dynamic internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: go_tab_descr TYPE REF TO cl_abap_tabledescr,
      go_struc_descr TYPE REF TO cl_abap_structdescr,
      wa_comp TYPE abap_compdescr.

FIELD-SYMBOLS:
&amp;lt;wa&amp;gt; TYPE ANY, "FS to store Work Area value
&amp;lt;val&amp;gt; TYPE ANY.  "FS to store field value
 
go_tab_descr ?= cl_abap_tabledescr=&amp;gt;describe_by_data( &amp;lt;itab&amp;gt; ).
 
CHECK sy-subrc = 0.
 
"Get the structure of your internal table
go_struc_descr ?= go_tab_descr-&amp;gt;get_table_line_type( ).
 
LOOP AT &amp;lt;itab&amp;gt; ASSIGNING &amp;lt;wa&amp;gt;.
  LOOP AT go_struc_descr-&amp;gt;components INTO wa_comp.
*   To access the components of the structure dynamically
    ASSIGN COMPONENT wa_comp-name OF STRUCTURE &amp;lt;wa&amp;gt; TO &amp;lt;val&amp;gt;.
  ENDLOOP.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Nov 2010 02:47:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-dynamic-structure-at-runtime-via-alv-methods/m-p/7447257#M1552445</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2010-11-19T02:47:04Z</dc:date>
    </item>
    <item>
      <title>Re: Create Dynamic Structure at Runtime via ALV-Methods!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-dynamic-structure-at-runtime-via-alv-methods/m-p/7447258#M1552446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Suhas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;first many thanks for your corrections and Helps this is also for all other experts in SDN.&lt;/P&gt;&lt;P&gt;I have copy your coding but there is another Problem with Casting!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;go_tab_descr ?= cl_abap_tabledescr=&amp;gt;describe_by_data( datatab ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On this line, the Compiler got me a Error Message:  MOVE_CAST_ERROR.&lt;/P&gt;&lt;P&gt;Why i got problems with casting??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is the reason that i use a old Release( 4.7) from SAP??&lt;/P&gt;&lt;P&gt;But in my Libary i can find the Class and Methods, which you have send me as a coding.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Nov 2010 10:18:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-dynamic-structure-at-runtime-via-alv-methods/m-p/7447258#M1552446</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-22T10:18:18Z</dc:date>
    </item>
  </channel>
</rss>

