<?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 Re: Create structure at run time for table type any in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-structure-at-run-time-for-table-type-any/m-p/1241690#M142313</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jayaraman,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This technique is really useful if we have predefined structure in the data dictionary(as in your case it is SYST).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But in my case t_table(my importing parameter of the method) is of type ANY that means it can contain any strcuture at the run time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;following your technique I tried to implement my scenario like this.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-------" /&gt;&lt;P&gt;report zxyz.&lt;/P&gt;&lt;P&gt;types : begin of t_tree,&lt;/P&gt;&lt;P&gt;           carrid type s_carr_id,&lt;/P&gt;&lt;P&gt;           planetype type s_planetye,&lt;/P&gt;&lt;P&gt;        end of t_tree.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data gt_tree type table of t_tree.&lt;/P&gt;&lt;P&gt;select carrid planetype up to 5 rows from sflight&lt;/P&gt;&lt;P&gt;                              into table gt_tree.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  call method cap_alv-&amp;gt;publish_alv_tree&lt;/P&gt;&lt;P&gt;    exporting&lt;/P&gt;&lt;P&gt;      t_table     = gt_tree.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-----" /&gt;&lt;P&gt;method publish_alv_tree&lt;/P&gt;&lt;P&gt;*!importing t_table type any&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE' &lt;/P&gt;&lt;P&gt;EXPORTING &lt;/P&gt;&lt;P&gt;i_structure_name = 't_table' &lt;/P&gt;&lt;P&gt;CHANGING &lt;/P&gt;&lt;P&gt;ct_fieldcat = it_fcat[]. &lt;/P&gt;&lt;P&gt;--&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-------" /&gt;&lt;P&gt;Even if somehow you pass the structure t_tree to the method but it still won't work b'cuz i_structure_name expects a structure name which is already defined in the DD.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;If still I am missing your solution anywhere pls let me know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sanjay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Mar 2006 09:46:35 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-03-27T09:46:35Z</dc:date>
    <item>
      <title>Create structure at run time for table type any</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-structure-at-run-time-for-table-type-any/m-p/1241683#M142306</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;I am trying to create a local structure of type t_table inside one method where t_table type any , and it is an importing parameter for this method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At run time t_table can contain any table data like gt_flight(custom internal table).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now inside my method I have to determine the structure of this incoming table t_table and then will create local strcuture of it's type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From SDN I got some solution but it's having some limitation as it will work only when 'gt_flight' strcuture is defined inside respository.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;lv_descr_ref ?= cl_abap_typedescr=&amp;gt;describe_by_data( t_table ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Platform : MySAP ERP 2004&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know if anyone have some solution for this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sanjay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Mar 2006 06:32:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-structure-at-run-time-for-table-type-any/m-p/1241683#M142306</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-27T06:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: Create structure at run time for table type any</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-structure-at-run-time-for-table-type-any/m-p/1241684#M142307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sanjay,&lt;/P&gt;&lt;P&gt;Its right&lt;/P&gt;&lt;P&gt;cl_abap_typedescr=&amp;gt;describe_by_data( t_table )&lt;/P&gt;&lt;P&gt;requires that the table definition must be defined in the ABAP Dictionary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can create custom &amp;lt;b&amp;gt;structures&amp;lt;/b&amp;gt; in SE11 and use them in your program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Wenceslaus.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Mar 2006 06:33:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-structure-at-run-time-for-table-type-any/m-p/1241684#M142307</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-27T06:33:33Z</dc:date>
    </item>
    <item>
      <title>Re: Create structure at run time for table type any</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-structure-at-run-time-for-table-type-any/m-p/1241685#M142308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sanjay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can try something like this (Older version - however it works).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS : &amp;lt;FT_TABLE&amp;gt; TYPE ANY TABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;assign table to &amp;lt;FT_TABLE&amp;gt;.&lt;/P&gt;&lt;P&gt;CREATE DATA workarea like line of &amp;lt;FT_TABLE&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note : Please mark the helpful answers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Mar 2006 06:33:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-structure-at-run-time-for-table-type-any/m-p/1241685#M142308</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-27T06:33:33Z</dc:date>
    </item>
    <item>
      <title>Re: Create structure at run time for table type any</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-structure-at-run-time-for-table-type-any/m-p/1241686#M142309</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;Try this sample code and kindly reward points by clicking the star on the left of reply,if it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT zmaschl_create_data_dynamic . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPE-POOLS: slis. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: it_fcat TYPE slis_t_fieldcat_alv, &lt;/P&gt;&lt;P&gt;      is_fcat LIKE LINE OF it_fcat. &lt;/P&gt;&lt;P&gt;DATA: it_fieldcat TYPE lvc_t_fcat, &lt;/P&gt;&lt;P&gt;      is_fieldcat LIKE LINE OF it_fieldcat. &lt;/P&gt;&lt;P&gt;DATA: new_table TYPE REF TO data. &lt;/P&gt;&lt;P&gt;DATA: new_line  TYPE REF TO data. &lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;l_table&amp;gt; TYPE ANY TABLE, &lt;/P&gt;&lt;P&gt;               &amp;lt;l_line&amp;gt;  TYPE ANY, &lt;/P&gt;&lt;P&gt;               &amp;lt;l_field&amp;gt; TYPE ANY. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Build fieldcat &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE' &lt;/P&gt;&lt;P&gt;       EXPORTING &lt;/P&gt;&lt;P&gt;           i_structure_name = 'SYST' &lt;/P&gt;&lt;P&gt;       CHANGING &lt;/P&gt;&lt;P&gt;           ct_fieldcat      = it_fcat[]. &lt;/P&gt;&lt;P&gt;   LOOP AT it_fcat INTO is_fcat WHERE NOT reptext_ddic IS initial. &lt;/P&gt;&lt;P&gt;        MOVE-CORRESPONDING is_fcat TO is_fieldcat. &lt;/P&gt;&lt;P&gt;        is_fieldcat-fieldname = is_fcat-fieldname. &lt;/P&gt;&lt;P&gt;        is_fieldcat-ref_field = is_fcat-fieldname. &lt;/P&gt;&lt;P&gt;        is_fieldcat-ref_table = is_fcat-ref_tabname. &lt;/P&gt;&lt;P&gt;        APPEND is_fieldcat TO it_fieldcat. &lt;/P&gt;&lt;P&gt;   ENDLOOP. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create a new Table &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL METHOD cl_alv_table_create=&amp;gt;create_dynamic_table &lt;/P&gt;&lt;P&gt;       EXPORTING &lt;/P&gt;&lt;P&gt;        it_fieldcatalog = it_fieldcat &lt;/P&gt;&lt;P&gt;       IMPORTING &lt;/P&gt;&lt;P&gt;        ep_table        = new_table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create a new Line with the same structure of the table. &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ASSIGN new_table-&amp;gt;* TO &amp;lt;l_table&amp;gt;. &lt;/P&gt;&lt;P&gt;CREATE DATA new_line LIKE LINE OF &amp;lt;l_table&amp;gt;. &lt;/P&gt;&lt;P&gt;ASSIGN new_line-&amp;gt;* TO &amp;lt;l_line&amp;gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Test it... &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;   DO 30 TIMES. &lt;/P&gt;&lt;P&gt;      ASSIGN COMPONENT 'SUBRC' OF STRUCTURE &amp;lt;l_line&amp;gt; TO &amp;lt;l_field&amp;gt;. &lt;/P&gt;&lt;P&gt;      &amp;lt;l_field&amp;gt; = sy-index. &lt;/P&gt;&lt;P&gt;      INSERT &amp;lt;l_line&amp;gt; INTO TABLE &amp;lt;l_table&amp;gt;. &lt;/P&gt;&lt;P&gt;   ENDDO. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   LOOP AT &amp;lt;l_table&amp;gt; ASSIGNING &amp;lt;l_line&amp;gt;. &lt;/P&gt;&lt;P&gt;      ASSIGN COMPONENT 'SUBRC' OF STRUCTURE &amp;lt;l_line&amp;gt; TO &amp;lt;l_field&amp;gt;. &lt;/P&gt;&lt;P&gt;      WRITE &amp;lt;l_field&amp;gt;. &lt;/P&gt;&lt;P&gt;   ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Mar 2006 06:33:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-structure-at-run-time-for-table-type-any/m-p/1241686#M142309</guid>
      <dc:creator>jayanthi_jayaraman</dc:creator>
      <dc:date>2006-03-27T06:33:33Z</dc:date>
    </item>
    <item>
      <title>Re: Create structure at run time for table type any</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-structure-at-run-time-for-table-type-any/m-p/1241687#M142310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But every time I will get a new custom structure as input so it will not be a good idea to create a static strcuture in SE11 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sanjay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Mar 2006 06:34:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-structure-at-run-time-for-table-type-any/m-p/1241687#M142310</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-27T06:34:33Z</dc:date>
    </item>
    <item>
      <title>Re: Create structure at run time for table type any</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-structure-at-run-time-for-table-type-any/m-p/1241688#M142311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check out this code sample taken from ABAP key word documentation, i guess this is what you want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: struct_type TYPE REF TO cl_abap_structdescr, 
      comp_tab TYPE cl_abap_structdescr=&amp;gt;component_table, 
      comp LIKE LINE OF comp_tab, 
      dref TYPE REF TO data. 

FIELD-SYMBOLS: &amp;lt;struc&amp;gt; TYPE ANY, 
               &amp;lt;comp&amp;gt; TYPE ANY. 

comp-name = 'column1'. 
comp-type = cl_abap_elemdescr=&amp;gt;get_c( 40 ). 
APPEND comp TO comp_tab. 

comp-name = 'column2'. 
comp-type = cl_abap_elemdescr=&amp;gt;get_i( ). 
APPEND comp TO comp_tab. 

struct_type = cl_abap_structdescr=&amp;gt;create( comp_tab ). 

CREATE DATA dref TYPE HANDLE struct_type. 

ASSIGN dref-&amp;gt;* TO &amp;lt;struc&amp;gt;. 
ASSIGN COMPONENT 'COLUMN1' OF STRUCTURE &amp;lt;struc&amp;gt; TO &amp;lt;comp&amp;gt;. 
&amp;lt;comp&amp;gt; = 'Amount'. 

ASSIGN dref-&amp;gt;* TO &amp;lt;struc&amp;gt;. 
ASSIGN COMPONENT 'COLUMN2' OF STRUCTURE &amp;lt;struc&amp;gt; TO &amp;lt;comp&amp;gt;. 
&amp;lt;comp&amp;gt; = 11. 

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Raja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Mar 2006 06:47:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-structure-at-run-time-for-table-type-any/m-p/1241688#M142311</guid>
      <dc:creator>athavanraja</dc:creator>
      <dc:date>2006-03-27T06:47:29Z</dc:date>
    </item>
    <item>
      <title>Re: Create structure at run time for table type any</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-structure-at-run-time-for-table-type-any/m-p/1241689#M142312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for that hint Ravi. &lt;/P&gt;&lt;P&gt;One small doubt what is the type of workarea you are taking ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data workarea type ??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Mar 2006 09:32:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-structure-at-run-time-for-table-type-any/m-p/1241689#M142312</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-27T09:32:13Z</dc:date>
    </item>
    <item>
      <title>Re: Create structure at run time for table type any</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-structure-at-run-time-for-table-type-any/m-p/1241690#M142313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jayaraman,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This technique is really useful if we have predefined structure in the data dictionary(as in your case it is SYST).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But in my case t_table(my importing parameter of the method) is of type ANY that means it can contain any strcuture at the run time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;following your technique I tried to implement my scenario like this.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-------" /&gt;&lt;P&gt;report zxyz.&lt;/P&gt;&lt;P&gt;types : begin of t_tree,&lt;/P&gt;&lt;P&gt;           carrid type s_carr_id,&lt;/P&gt;&lt;P&gt;           planetype type s_planetye,&lt;/P&gt;&lt;P&gt;        end of t_tree.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data gt_tree type table of t_tree.&lt;/P&gt;&lt;P&gt;select carrid planetype up to 5 rows from sflight&lt;/P&gt;&lt;P&gt;                              into table gt_tree.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  call method cap_alv-&amp;gt;publish_alv_tree&lt;/P&gt;&lt;P&gt;    exporting&lt;/P&gt;&lt;P&gt;      t_table     = gt_tree.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-----" /&gt;&lt;P&gt;method publish_alv_tree&lt;/P&gt;&lt;P&gt;*!importing t_table type any&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE' &lt;/P&gt;&lt;P&gt;EXPORTING &lt;/P&gt;&lt;P&gt;i_structure_name = 't_table' &lt;/P&gt;&lt;P&gt;CHANGING &lt;/P&gt;&lt;P&gt;ct_fieldcat = it_fcat[]. &lt;/P&gt;&lt;P&gt;--&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-------" /&gt;&lt;P&gt;Even if somehow you pass the structure t_tree to the method but it still won't work b'cuz i_structure_name expects a structure name which is already defined in the DD.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;If still I am missing your solution anywhere pls let me know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sanjay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Mar 2006 09:46:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-structure-at-run-time-for-table-type-any/m-p/1241690#M142313</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-27T09:46:35Z</dc:date>
    </item>
    <item>
      <title>Re: Create structure at run time for table type any</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-structure-at-run-time-for-table-type-any/m-p/1241691#M142314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if you want to use 'REUSE_ALV_FIELDCATALOG_MERGE'  for your internal table you have to follow like below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;move: sy-repid to wf_repid  ,&lt;/P&gt;&lt;P&gt;        t_table to int_tab_name .&lt;/P&gt;&lt;P&gt;translate int_tab_name to upper case .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  call function 'REUSE_ALV_FIELDCATALOG_MERGE'&lt;/P&gt;&lt;P&gt;   exporting&lt;/P&gt;&lt;P&gt;     i_program_name              = wf_repid&lt;/P&gt;&lt;P&gt;     i_internal_tabname          = int_tab_name&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  I_STRUCTURE_NAME             =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  I_CLIENT_NEVER_DISPLAY       = 'X'&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    i_inclname                   = wf_repid&lt;/P&gt;&lt;P&gt;    i_bypassing_buffer           = 'X'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  I_BUFFER_ACTIVE              =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    changing&lt;/P&gt;&lt;P&gt;      ct_fieldcat                  = wf_fld_cat[]&lt;/P&gt;&lt;P&gt;   exceptions&lt;/P&gt;&lt;P&gt;     inconsistent_interface       = 1&lt;/P&gt;&lt;P&gt;     program_error                = 2&lt;/P&gt;&lt;P&gt;     others                       = 3&lt;/P&gt;&lt;P&gt;            .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Raja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Mar 2006 09:58:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-structure-at-run-time-for-table-type-any/m-p/1241691#M142314</guid>
      <dc:creator>athavanraja</dc:creator>
      <dc:date>2006-03-27T09:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: Create structure at run time for table type any</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-structure-at-run-time-for-table-type-any/m-p/1241692#M142315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sanjay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can define work area like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data : workarea TYPE REF to DATA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is dynamic declaration if you don't know the type at design time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note : Please mark the helpful answers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Mar 2006 10:00:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-structure-at-run-time-for-table-type-any/m-p/1241692#M142315</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-27T10:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: Create structure at run time for table type any</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-structure-at-run-time-for-table-type-any/m-p/1241693#M142316</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for your valuable tips for that problem.&lt;/P&gt;&lt;P&gt;After a long struggle utltimately it is resolved now and the soltuion is as follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt;--&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;field-symbols:&lt;/P&gt;&lt;P&gt;                 &amp;lt;fs&amp;gt; type any table,&lt;/P&gt;&lt;P&gt;                 &amp;lt;tab&amp;gt; type any,&lt;/P&gt;&lt;P&gt;                 &amp;lt;field&amp;gt; type any,&lt;/P&gt;&lt;P&gt;                 &amp;lt;wa&amp;gt; type any.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Assign incoming table to &amp;lt;fs&amp;gt;&lt;/P&gt;&lt;P&gt;  assign t_table to &amp;lt;fs&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--create a data ref to &amp;lt;fs&amp;gt; ,LIKE will create a ref to an empty&lt;/P&gt;&lt;P&gt;*--structure &amp;lt;fs&amp;gt; which is required to create tree instance&lt;/P&gt;&lt;P&gt;  create data tab_ref like &amp;lt;fs&amp;gt;.&lt;/P&gt;&lt;P&gt;  assign tab_ref-&amp;gt;* to &amp;lt;tab&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Create wa of type &amp;lt;fs&amp;gt;&lt;/P&gt;&lt;P&gt;  create data wa_ref like line of &amp;lt;fs&amp;gt;.&lt;/P&gt;&lt;P&gt;  assign wa_ref-&amp;gt;* to &amp;lt;wa&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--&lt;/P&gt;&lt;P&gt;--&lt;/P&gt;&lt;P&gt;This will give you an empty table type of T_TABLE(i.e table any) as well as WA type T_TABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even though I had already touched almost all soltuions suggested by you guys before this posting but it got clicked just after Ravi's reply i.e WA type ref to ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot Ravi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sanjay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Mar 2006 12:34:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-structure-at-run-time-for-table-type-any/m-p/1241693#M142316</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-28T12:34:15Z</dc:date>
    </item>
    <item>
      <title>Re: Create structure at run time for table type any</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-structure-at-run-time-for-table-type-any/m-p/1241694#M142317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sanjay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Glad to hear that your problem is solved.&lt;/P&gt;&lt;P&gt;Please mark the helpful answers and mark the thread as closed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Mar 2006 03:57:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-structure-at-run-time-for-table-type-any/m-p/1241694#M142317</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-29T03:57:53Z</dc:date>
    </item>
  </channel>
</rss>

