<?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: Abap internal table declaration. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-internal-table-declaration/m-p/736017#M34898</link>
    <description>&lt;P&gt;Great stuff.Thanks.&lt;/P&gt;</description>
    <pubDate>Thu, 25 Oct 2018 12:11:44 GMT</pubDate>
    <dc:creator>former_member197870</dc:creator>
    <dc:date>2018-10-25T12:11:44Z</dc:date>
    <item>
      <title>Abap internal table declaration.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-internal-table-declaration/m-p/736001#M34882</link>
      <description>&lt;P&gt;I am in program A and calls a routine in program B (in this case ZMOD_EMAIL_REPORT TABLES) like&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt; PERFORM SEND_EMAIL IN PROGRAM ZMOD_EMAIL_REPORT TABLES it_alvt using SITID TITLE excel_heading attch_subject .&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;Suppose it_alvt in program A has data type sequence as&lt;/P&gt;
  &lt;P&gt;F1 TYPE kna1-kunnr,&lt;/P&gt;
  &lt;P&gt;F2 TYPE knvv-vkorg,&lt;/P&gt;
  &lt;P&gt;F3 type vbrk-wrbtr.&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;I want that in program B i must be able to dynamically declare an internal table with reference to internal table in program A&lt;/P&gt;
  &lt;P&gt;F1(20) TYPE C,&lt;/P&gt;
  &lt;P&gt;F2(20) TYPE C,&lt;/P&gt;
  &lt;P&gt;F3(20) TYPE C.&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;The field declaration should happen with exact field name but only difference being maintaining char datatypes.&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Oct 2018 12:42:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-internal-table-declaration/m-p/736001#M34882</guid>
      <dc:creator>former_member197870</dc:creator>
      <dc:date>2018-10-10T12:42:00Z</dc:date>
    </item>
    <item>
      <title>Re: Abap internal table declaration.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-internal-table-declaration/m-p/736002#M34883</link>
      <description>&lt;P&gt;The question is.. why?&lt;BR /&gt;Really, what's the final goal? Reusing the code? what?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Oct 2018 15:21:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-internal-table-declaration/m-p/736002#M34883</guid>
      <dc:creator>SimoneMilesi</dc:creator>
      <dc:date>2018-10-10T15:21:07Z</dc:date>
    </item>
    <item>
      <title>Re: Abap internal table declaration.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-internal-table-declaration/m-p/736003#M34884</link>
      <description>&lt;P&gt;This will work. Not sure this is a good idea.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FORM send_email TABLES it_alvt TYPE STANDARD TABLE
                 USING sitid
                       title
                       excel_heading
                       attch_subject.


  DATA:
    tab_ref    TYPE REF TO cl_abap_tabledescr,
    struc_ref  TYPE REF TO cl_abap_structdescr,
    lt_columns TYPE lvc_t_fcat,
    lv_column  TYPE lvc_s_fcat,
    t_data     TYPE STANDARD TABLE OF vbap,
    type_alv   TYPE REF TO data,
    type_row   TYPE REF TO data.


  FIELD-SYMBOLS: &amp;lt;alv&amp;gt;         TYPE STANDARD TABLE.
  FIELD-SYMBOLS: &amp;lt;dynamic_row&amp;gt; TYPE any.
  FIELD-SYMBOLS: &amp;lt;field&amp;gt;       TYPE any.
  FIELD-SYMBOLS: &amp;lt;f&amp;gt;           TYPE abap_compdescr.


* Reference internal table definition
  tab_ref ?= cl_abap_tabledescr=&amp;gt;describe_by_data( it_alvt[] ).
  struc_ref ?= tab_ref-&amp;gt;get_table_line_type( ).


* For each field of internal table...
  LOOP AT struc_ref-&amp;gt;components ASSIGNING &amp;lt;f&amp;gt;.

    CLEAR: lv_column.

    lv_column-fieldname = &amp;lt;f&amp;gt;-name.
    lv_column-tabname   = 'T_DATA'.
    lv_column-col_pos   = sy-tabix.
    lv_column-outputlen = &amp;lt;f&amp;gt;-length.
    lv_column-datatype  = 'CHAR'.

*   Add a field with matching definition to dynamic table definition
    APPEND lv_column TO lt_columns.

  ENDLOOP.


* Create dynamic table
  CALL METHOD cl_alv_table_create=&amp;gt;create_dynamic_table
    EXPORTING
      it_fieldcatalog           = lt_columns
    IMPORTING
      ep_table                  = type_alv
    EXCEPTIONS
      generate_subpool_dir_full = 1
      OTHERS                    = 2.
  IF sy-subrc EQ 0.
    ASSIGN type_alv-&amp;gt;* TO &amp;lt;alv&amp;gt;.              "Get reference to dynamic table
    CREATE DATA type_row LIKE LINE OF &amp;lt;alv&amp;gt;.  "Create work area for dynamic table
    ASSIGN type_row-&amp;gt;* TO &amp;lt;dynamic_row&amp;gt;.      "Get reference to work area of dynamic table
  ENDIF.


* Do this to add rows to dynamic table
  APPEND &amp;lt;dynamic_row&amp;gt; TO &amp;lt;alv&amp;gt;.


* Do this to use rows and fields of dynamic table
  LOOP AT &amp;lt;alv&amp;gt; ASSIGNING &amp;lt;dynamic_row&amp;gt;.

*    &amp;lt;dynamic_row&amp;gt;-vbeln = 'a'.  "&amp;lt;== THIS DOES NOT WORK !!!

    ASSIGN COMPONENT 'F1' OF STRUCTURE &amp;lt;dynamic_row&amp;gt; TO &amp;lt;field&amp;gt;.
    &amp;lt;field&amp;gt; = 'this works'.

  ENDLOOP.

ENDFORM.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Oct 2018 18:26:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-internal-table-declaration/m-p/736003#M34884</guid>
      <dc:creator>juan_suros</dc:creator>
      <dc:date>2018-10-10T18:26:53Z</dc:date>
    </item>
    <item>
      <title>Re: Abap internal table declaration.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-internal-table-declaration/m-p/736004#M34885</link>
      <description>&lt;P&gt;Forgot to remove the T_DATA reference. Also, you will probably want this bit:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;* Copy content of passed table to new iTab
  LOOP AT it_alvt ASSIGNING FIELD-SYMBOL(&amp;lt;this&amp;gt;).
    MOVE-CORRESPONDING &amp;lt;this&amp;gt; TO &amp;lt;dynamic_row&amp;gt;.
    APPEND &amp;lt;dynamic_row&amp;gt; TO &amp;lt;alv&amp;gt;.
  ENDLOOP.


&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Oct 2018 18:41:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-internal-table-declaration/m-p/736004#M34885</guid>
      <dc:creator>juan_suros</dc:creator>
      <dc:date>2018-10-10T18:41:09Z</dc:date>
    </item>
    <item>
      <title>Re: Abap internal table declaration.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-internal-table-declaration/m-p/736005#M34886</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;P&gt;you should move the common code into function module or class, it would be better. to dynamic table structure you can use RTTS, read more here:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://blogs.sap.com/2014/04/03/create-dynamic-table-using-rtts-and-display-in-alv/" target="test_blank"&gt;https://blogs.sap.com/2014/04/03/create-dynamic-table-using-rtts-and-display-in-alv/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2018 03:05:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-internal-table-declaration/m-p/736005#M34886</guid>
      <dc:creator>DoanManhQuynh</dc:creator>
      <dc:date>2018-10-11T03:05:51Z</dc:date>
    </item>
    <item>
      <title>Re: Abap internal table declaration.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-internal-table-declaration/m-p/736006#M34887</link>
      <description>&lt;P&gt;Thanks for your great support.I will give this a try and post the final code.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2018 05:22:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-internal-table-declaration/m-p/736006#M34887</guid>
      <dc:creator>former_member197870</dc:creator>
      <dc:date>2018-10-11T05:22:06Z</dc:date>
    </item>
    <item>
      <title>Re: Abap internal table declaration.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-internal-table-declaration/m-p/736007#M34888</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;cl_alv_table_create=&amp;gt;create_dynamic_table&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Really? It was a useful trick in the past, but it shouldn't be part of modern code. With RTTS you don't need to use this. &lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2018 07:38:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-internal-table-declaration/m-p/736007#M34888</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2018-10-11T07:38:48Z</dc:date>
    </item>
    <item>
      <title>Re: Abap internal table declaration.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-internal-table-declaration/m-p/736008#M34889</link>
      <description>&lt;P&gt;Please use comments to comment on answers - don't add another answer.&lt;/P&gt;&lt;P&gt;If you're using Juan Suros' answer, be aware that he's using cl_alv_table_create=&amp;gt;create_dynamic_table and that's really not best practice.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2018 07:39:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-internal-table-declaration/m-p/736008#M34889</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2018-10-11T07:39:57Z</dc:date>
    </item>
    <item>
      <title>Re: Abap internal table declaration.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-internal-table-declaration/m-p/736009#M34890</link>
      <description>&lt;P&gt;I was expressing doubt as to the design. Not relevant for this sort of message board, I suppose.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2018 21:49:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-internal-table-declaration/m-p/736009#M34890</guid>
      <dc:creator>juan_suros</dc:creator>
      <dc:date>2018-10-11T21:49:21Z</dc:date>
    </item>
    <item>
      <title>Re: Abap internal table declaration.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-internal-table-declaration/m-p/736010#M34891</link>
      <description>&lt;P&gt;Thank you so much !. I guessed the latter part.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2018 09:40:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-internal-table-declaration/m-p/736010#M34891</guid>
      <dc:creator>former_member197870</dc:creator>
      <dc:date>2018-10-16T09:40:43Z</dc:date>
    </item>
    <item>
      <title>Re: Abap internal table declaration.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-internal-table-declaration/m-p/736011#M34892</link>
      <description>&lt;P&gt;Please use comments to comment on answers - don't add another answer.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2018 09:58:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-internal-table-declaration/m-p/736011#M34892</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2018-10-16T09:58:04Z</dc:date>
    </item>
    <item>
      <title>Re: Abap internal table declaration.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-internal-table-declaration/m-p/736012#M34893</link>
      <description>&lt;P&gt;Please use comments to comment on answers - don't add another answer.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2018 09:58:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-internal-table-declaration/m-p/736012#M34893</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2018-10-16T09:58:21Z</dc:date>
    </item>
    <item>
      <title>Re: Abap internal table declaration.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-internal-table-declaration/m-p/736013#M34894</link>
      <description>&lt;P&gt;  &lt;SPAN class="mention-scrubbed"&gt;matthew.billingham&lt;/SPAN&gt; is it possible to ask the SCN team to name the button "Propose your Solution" instead of "Answer"? because many people think that "answer" means "reply to someone" (which is right, but only outside SCN).&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2018 17:56:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-internal-table-declaration/m-p/736013#M34894</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2018-10-16T17:56:01Z</dc:date>
    </item>
    <item>
      <title>Re: Abap internal table declaration.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-internal-table-declaration/m-p/736014#M34895</link>
      <description>&lt;P&gt;Good idea Sandra - you should propose it to the powers that be. &lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 14:14:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-internal-table-declaration/m-p/736014#M34895</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2018-10-19T14:14:52Z</dc:date>
    </item>
    <item>
      <title>Re: Abap internal table declaration.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-internal-table-declaration/m-p/736015#M34896</link>
      <description>&lt;P&gt;Whats the flaw Mathew ?.What can be done alternate to it ?&lt;/P&gt;</description>
      <pubDate>Tue, 23 Oct 2018 10:46:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-internal-table-declaration/m-p/736015#M34896</guid>
      <dc:creator>former_member197870</dc:creator>
      <dc:date>2018-10-23T10:46:48Z</dc:date>
    </item>
    <item>
      <title>Re: Abap internal table declaration.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-internal-table-declaration/m-p/736016#M34897</link>
      <description>&lt;P&gt;As Quynh Doan Manh said.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;It would be better. to ... use RTTS, read more here:
&lt;A href="https://blogs.sap.com/2014/04/03/create-dynamic-table-using-rtts-and-display-in-alv/" target="test_blank"&gt;https://blogs.sap.com/2014/04/03/create-dynamic-table-using-rtts-and-display-in-alv/&lt;/A&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;RTTS is the proper way to do it. cl_alv_table_create=&amp;gt;create_dynamic_table generates a subroutine pool, so there's a limit on how many tables you can create and it wasn't really designed for general use. But the main reason is that RTTS is worth learning as it is very powerful.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Oct 2018 11:30:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-internal-table-declaration/m-p/736016#M34897</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2018-10-23T11:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: Abap internal table declaration.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-internal-table-declaration/m-p/736017#M34898</link>
      <description>&lt;P&gt;Great stuff.Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Oct 2018 12:11:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-internal-table-declaration/m-p/736017#M34898</guid>
      <dc:creator>former_member197870</dc:creator>
      <dc:date>2018-10-25T12:11:44Z</dc:date>
    </item>
  </channel>
</rss>

