<?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: dynamic internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/4768561#M1117769</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;   issue :&lt;/P&gt;&lt;P&gt;       i have created a dynamic internal table(dyn_tab) and a dynamic work area (dyn_wa).&lt;/P&gt;&lt;P&gt;       1. actually i have to calculate some data and then insert the same in to the dynamic table .&lt;/P&gt;&lt;P&gt;       ex:&lt;/P&gt;&lt;P&gt;          if suppose i have 10 fields in my dynamic table.&lt;/P&gt;&lt;P&gt;          and my field names are suppose from 0 to 10 .(wil be created at run time)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          iam not able to write "  &amp;lt;dyn_wa&amp;gt;-0 = 'help'. " (it is showing an syntax error because the structure  is  created dynamically which does not have that field name befor the program is executed )&lt;/P&gt;&lt;P&gt;          &lt;/P&gt;&lt;P&gt; ("I WANT TO APPEND A RECORD IN TO DYNAMIC INTERNAL TABLE ")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"PLEASE HELP ME "&lt;/P&gt;&lt;P&gt;    please help me out regarding this issue i hope u can do this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WATING.&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;shivkanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Jan 2009 04:15:31 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-01-22T04:15:31Z</dc:date>
    <item>
      <title>dynamic internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/4768559#M1117767</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;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am writing code like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Type pools declaration for ALV&lt;/P&gt;&lt;P&gt;TYPE-POOLS: SLIS.                    " ALV Global Types&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*data declaration for dynamic internal table and alv&lt;/P&gt;&lt;P&gt;DATA:     L_STRUCTURE   TYPE REF TO DATA,&lt;/P&gt;&lt;P&gt;          L_TABLE    TYPE REF TO DATA,&lt;/P&gt;&lt;P&gt;          STRUC_DESC   TYPE REF TO CL_ABAP_STRUCTDESCR,&lt;/P&gt;&lt;P&gt;          LT_LAYOUT   TYPE SLIS_LAYOUT_ALV,&lt;/P&gt;&lt;P&gt;          LS_LVC_FIELDCATALOGUE  TYPE LVC_S_FCAT,&lt;/P&gt;&lt;P&gt;          LT_LVC_FIELDCATALOGUE  TYPE LVC_T_FCAT,&lt;/P&gt;&lt;P&gt;          LS_FIELDCATALOGUE TYPE SLIS_FIELDCAT_ALV,&lt;/P&gt;&lt;P&gt;          LT_FIELDCATALOGUE TYPE SLIS_T_FIELDCAT_ALV.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*field symbols declaration&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS :&lt;/P&gt;&lt;P&gt;  &amp;lt;IT_TABLE&amp;gt;    TYPE STANDARD TABLE,&lt;/P&gt;&lt;P&gt;  &amp;lt;DYN_STR&amp;gt;         TYPE ANY,&lt;/P&gt;&lt;P&gt;  &amp;lt;STR_COMP&amp;gt; TYPE ABAP_COMPDESCR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*declarations for grid title&lt;/P&gt;&lt;P&gt;DATA : T1(30),&lt;/P&gt;&lt;P&gt;       T2(10),&lt;/P&gt;&lt;P&gt;       T3(50).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*selection screen declaration for table input&lt;/P&gt;&lt;P&gt;PARAMETERS : P_bukrs LIKE  bukrs,&lt;/P&gt;&lt;P&gt;             p_belnr like belnr,&lt;/P&gt;&lt;P&gt;             p_gjahr like gjahr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*initialization event&lt;/P&gt;&lt;P&gt;INITIALIZATION.&lt;/P&gt;&lt;P&gt;p_table = 'BSEG'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*start of selection event&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*texts for grid title&lt;/P&gt;&lt;P&gt;  T1 = 'Dynamic ALV display for table'.&lt;/P&gt;&lt;P&gt;  T2 = P_TABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CONCATENATE T1 T2 INTO T3 SEPARATED BY SPACE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Dynamic creation of a structure&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CREATE DATA L_STRUCTURE TYPE (P_TABLE).&lt;/P&gt;&lt;P&gt;  ASSIGN L_STRUCTURE-&amp;gt;* TO &amp;lt;DYN_STR&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Fields Structure&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  STRUC_DESC ?= CL_ABAP_TYPEDESCR=&amp;gt;DESCRIBE_BY_DATA( &amp;lt;DYN_STR&amp;gt; ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT STRUC_DESC-&amp;gt;COMPONENTS ASSIGNING &amp;lt;STR_COMP&amp;gt;.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Build Fieldcatalog&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    LS_LVC_FIELDCATALOGUE-FIELDNAME = &amp;lt;STR_COMP&amp;gt;-NAME.&lt;/P&gt;&lt;P&gt;    LS_LVC_FIELDCATALOGUE-REF_TABLE = P_TABLE.&lt;/P&gt;&lt;P&gt;    APPEND LS_LVC_FIELDCATALOGUE TO LT_LVC_FIELDCATALOGUE.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Build Fieldcatalog&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    LS_FIELDCATALOGUE-FIELDNAME = &amp;lt;STR_COMP&amp;gt;-NAME.&lt;/P&gt;&lt;P&gt;    LS_FIELDCATALOGUE-REF_TABNAME = P_TABLE.&lt;/P&gt;&lt;P&gt;    APPEND LS_FIELDCATALOGUE TO LT_FIELDCATALOGUE.&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 internal table dynamic&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 = LT_LVC_FIELDCATALOGUE&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      EP_TABLE        = L_TABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ASSIGN L_TABLE-&amp;gt;* TO &amp;lt;IT_TABLE&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Read data from the table selected.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT * FROM (P_TABLE)&lt;/P&gt;&lt;P&gt;    INTO CORRESPONDING FIELDS OF TABLE &amp;lt;IT_TABLE&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          where bukrs = p_bukrs&lt;/P&gt;&lt;P&gt;            and belnr = p_belnr&lt;/P&gt;&lt;P&gt;                gjahr = gjahr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ALV Layout&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  LT_LAYOUT-ZEBRA = 'X'.&lt;/P&gt;&lt;P&gt;  LT_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.&lt;/P&gt;&lt;P&gt;  LT_LAYOUT-WINDOW_TITLEBAR = T3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*ALV  output&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      IS_LAYOUT     = LT_LAYOUT&lt;/P&gt;&lt;P&gt;      IT_FIELDCAT   = LT_FIELDCATALOGUE&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      T_OUTTAB      = &amp;lt;IT_TABLE&amp;gt;&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      PROGRAM_ERROR = 1&lt;/P&gt;&lt;P&gt;      OTHERS        = 2.&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here i am getting all the data from the BSEG table based on the condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I want only date ,account and amount field,here i am using dynamic internal table,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want data like below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATE             account                      amount&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2008/12            A                            1000&lt;/P&gt;&lt;P&gt;2008/12            b                            2000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after that in displaying(in alv) time I need like below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATE            account &lt;/P&gt;&lt;P&gt;2008/12           A               B         &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                     1000             2000&lt;/P&gt;&lt;P&gt;                &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please tell me how to do that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Rakesh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Nov 2008 04:19:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/4768559#M1117767</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-07T04:19:29Z</dc:date>
    </item>
    <item>
      <title>Re: dynamic internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/4768560#M1117768</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;First fetch all the data in the dynamic internal table then loop the internal tabl with required condition then move all the data to final internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your final internal table take only those records which need to be displayed in ALV&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS : &lt;/P&gt;&lt;P&gt;&amp;lt;y_i_table&amp;gt;  TYPE STANDARD TABLE,&lt;/P&gt;&lt;P&gt;                &amp;lt;y_wa_table&amp;gt; TYPE ANY,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT &amp;lt;y_i_table&amp;gt; ASSIGNING &amp;lt;y_wa_table&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    MOVE-CORRESPONDING &amp;lt;y_wa_table&amp;gt; TO y_wa_vfscaid.&lt;/P&gt;&lt;P&gt;    APPEND y_wa_vfscaid TO y_i_vfscaid.&lt;/P&gt;&lt;P&gt;    CLEAR y_wa_vfscaid.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Nov 2008 04:24:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/4768560#M1117768</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-07T04:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: dynamic internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/4768561#M1117769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;   issue :&lt;/P&gt;&lt;P&gt;       i have created a dynamic internal table(dyn_tab) and a dynamic work area (dyn_wa).&lt;/P&gt;&lt;P&gt;       1. actually i have to calculate some data and then insert the same in to the dynamic table .&lt;/P&gt;&lt;P&gt;       ex:&lt;/P&gt;&lt;P&gt;          if suppose i have 10 fields in my dynamic table.&lt;/P&gt;&lt;P&gt;          and my field names are suppose from 0 to 10 .(wil be created at run time)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          iam not able to write "  &amp;lt;dyn_wa&amp;gt;-0 = 'help'. " (it is showing an syntax error because the structure  is  created dynamically which does not have that field name befor the program is executed )&lt;/P&gt;&lt;P&gt;          &lt;/P&gt;&lt;P&gt; ("I WANT TO APPEND A RECORD IN TO DYNAMIC INTERNAL TABLE ")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"PLEASE HELP ME "&lt;/P&gt;&lt;P&gt;    please help me out regarding this issue i hope u can do this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WATING.&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;shivkanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jan 2009 04:15:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/4768561#M1117769</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-22T04:15:31Z</dc:date>
    </item>
  </channel>
</rss>

