<?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: Passing values to dynamically created internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-values-to-dynamically-created-internal-table/m-p/5096944#M1182945</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Parvatha Reddy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use SPLIT command to get the individual values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;  BEGIN OF ITAB OCCURS 0,&lt;/P&gt;&lt;P&gt;     F1 TYPE WHAT EVER U USED,&lt;/P&gt;&lt;P&gt;     F2 TYPE WHAT EVER U USED,&lt;/P&gt;&lt;P&gt;     .&lt;/P&gt;&lt;P&gt;     .&lt;/P&gt;&lt;P&gt;     .&lt;/P&gt;&lt;P&gt;     Fn TYPE WHAT EVER U USED,&lt;/P&gt;&lt;P&gt;  END OF ITAB.&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.&lt;/P&gt;&lt;P&gt;LOOP AT ITAB.&lt;/P&gt;&lt;P&gt;  ASSIGN ITAB TO &amp;lt;FS&amp;gt;.&lt;/P&gt;&lt;P&gt;  SPLIT &amp;lt;FS&amp;gt; AT '  ' INTO V1,V2, ....Vn.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Where V1,V2 ....Vn are same type like F!,F2,...Fn.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Do What ever u want with the individual values u got in V!,V2,...,Vn.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps u.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rama.Pammi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Jan 2009 12:34:12 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-01-22T12:34:12Z</dc:date>
    <item>
      <title>Passing values to dynamically created internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-values-to-dynamically-created-internal-table/m-p/5096941#M1182942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have the flat file data as &lt;/P&gt;&lt;P&gt;f1,f2,f3........so on&lt;/P&gt;&lt;P&gt;where f1 f2 and f3 are field names.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a variable var which contains the data &lt;/P&gt;&lt;P&gt;V1,0001,0002.........so on&lt;/P&gt;&lt;P&gt;data: var type string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The value of field f1 is v1&lt;/P&gt;&lt;P&gt;The value of field f2 is 0001&lt;/P&gt;&lt;P&gt;The value of field f3 is 0002.......so on&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS:     &amp;lt;fs_1&amp;gt; TYPE STANDARD TABLE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have dynamically created an internal table for fields f1  f2 f3 ...... using  &lt;/P&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_fieldcatalog&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      ep_table                  = &amp;lt;fs_data&amp;gt;&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      generate_subpool_dir_full = 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;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt; ASSIGN &amp;lt;fs_data&amp;gt;-&amp;gt;* TO &amp;lt;fs_1&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now for &amp;lt;fs_1&amp;gt; I have to pass the corresponding values of the fields f1 f2 f3 .&lt;/P&gt;&lt;P&gt;How can i solve this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards ,&lt;/P&gt;&lt;P&gt;Parvatha Reddy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jan 2009 12:17:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-values-to-dynamically-created-internal-table/m-p/5096941#M1182942</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-22T12:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: Passing values to dynamically created internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-values-to-dynamically-created-internal-table/m-p/5096942#M1182943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: new_line TYPE REF TO data.

CREATE DATA new_line LIKE LINE OF &amp;lt;fs_1&amp;gt;. 
ASSIGN new_line-&amp;gt;*  TO &amp;lt;fs_2&amp;gt;.

ASSIGN COMPONENT 1 OF STRUCTURE &amp;lt;fs_2&amp;gt; TO &amp;lt;fs_3&amp;gt;.
&amp;lt;fs_3&amp;gt; = f1 .

ASSIGN COMPONENT 2 OF STRUCTURE &amp;lt;fs_2&amp;gt; TO &amp;lt;fs_3&amp;gt;.
&amp;lt;fs_3&amp;gt; =f2.

ASSIGN COMPONENT 3 OF STRUCTURE &amp;lt;fs_2&amp;gt; TO &amp;lt;fs_3&amp;gt;.
&amp;lt;fs_3&amp;gt; =f3.&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jan 2009 12:24:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-values-to-dynamically-created-internal-table/m-p/5096942#M1182943</guid>
      <dc:creator>Pawan_Kesari</dc:creator>
      <dc:date>2009-01-22T12:24:43Z</dc:date>
    </item>
    <item>
      <title>Re: Passing values to dynamically created internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-values-to-dynamically-created-internal-table/m-p/5096943#M1182944</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;There is no data in &amp;lt;fs_1&amp;gt;.&lt;/P&gt;&lt;P&gt;I need to pass the data form the string var to the fields of &amp;lt;fs_1&amp;gt;..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jan 2009 12:31:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-values-to-dynamically-created-internal-table/m-p/5096943#M1182944</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-22T12:31:36Z</dc:date>
    </item>
    <item>
      <title>Re: Passing values to dynamically created internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-values-to-dynamically-created-internal-table/m-p/5096944#M1182945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Parvatha Reddy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use SPLIT command to get the individual values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;  BEGIN OF ITAB OCCURS 0,&lt;/P&gt;&lt;P&gt;     F1 TYPE WHAT EVER U USED,&lt;/P&gt;&lt;P&gt;     F2 TYPE WHAT EVER U USED,&lt;/P&gt;&lt;P&gt;     .&lt;/P&gt;&lt;P&gt;     .&lt;/P&gt;&lt;P&gt;     .&lt;/P&gt;&lt;P&gt;     Fn TYPE WHAT EVER U USED,&lt;/P&gt;&lt;P&gt;  END OF ITAB.&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.&lt;/P&gt;&lt;P&gt;LOOP AT ITAB.&lt;/P&gt;&lt;P&gt;  ASSIGN ITAB TO &amp;lt;FS&amp;gt;.&lt;/P&gt;&lt;P&gt;  SPLIT &amp;lt;FS&amp;gt; AT '  ' INTO V1,V2, ....Vn.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Where V1,V2 ....Vn are same type like F!,F2,...Fn.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Do What ever u want with the individual values u got in V!,V2,...,Vn.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps u.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rama.Pammi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jan 2009 12:34:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-values-to-dynamically-created-internal-table/m-p/5096944#M1182945</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-22T12:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: Passing values to dynamically created internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-values-to-dynamically-created-internal-table/m-p/5096945#M1182946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no data in &amp;lt;fs_1&amp;gt;.&lt;/P&gt;&lt;P&gt;I need to pass the data form the string var to the fields of &amp;lt;fs_1&amp;gt;..&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand that you want to populate the internal table &amp;lt;fs_1&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for that you fist need work area.. use below statement to create work area..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: new_line TYPE REF TO data.
 
CREATE DATA new_line LIKE LINE OF &amp;lt;fs_1&amp;gt;. 
ASSIGN new_line-&amp;gt;*  TO &amp;lt;fs_2&amp;gt;.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;fs_2&amp;gt; is not your work aread...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to assign value to each field of you work aread &amp;lt;fs_2&amp;gt;. use statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;ASSIGN COMPONENT 1 OF STRUCTURE &amp;lt;fs_2&amp;gt; TO &amp;lt;fs_3&amp;gt;.
&amp;lt;fs_3&amp;gt; = f1 .&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now &amp;lt;fs_3&amp;gt; will point to the first field of work area &amp;lt;fs_2&amp;gt;, f1 is value from your string .. repeat above for each field in workarea, by increasing the component number. Once your work area is filled&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append it to table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;append &amp;lt;fs_2&amp;gt; to &amp;lt;fs_1&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;apologies if I am not getting the requiremnt correctly..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jan 2009 12:37:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-values-to-dynamically-created-internal-table/m-p/5096945#M1182946</guid>
      <dc:creator>Pawan_Kesari</dc:creator>
      <dc:date>2009-01-22T12:37:51Z</dc:date>
    </item>
    <item>
      <title>Re: Passing values to dynamically created internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-values-to-dynamically-created-internal-table/m-p/5096946#M1182947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;    I will not know the no of fields  f1, f2 ,......... This list of fields may be extended &lt;/P&gt;&lt;P&gt;So, I can not declare the exact no of variables that can be used in split command&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jan 2009 12:42:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-values-to-dynamically-created-internal-table/m-p/5096946#M1182947</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-22T12:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: Passing values to dynamically created internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-values-to-dynamically-created-internal-table/m-p/5096947#M1182948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First use SPIT command and get the result in table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SPLIT dobj AT sep INTO TABLE result_tab.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;by counting the number of lines in result_tab, you can determine how many fields you need in internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Second, populate the fieldcatelog with those many fields and create your dynamic internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: &lt;/P&gt;&lt;P&gt;You can use SPLIT command and get result in internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Pawan Kesari on Jan 22, 2009 6:30 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jan 2009 13:00:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-values-to-dynamically-created-internal-table/m-p/5096947#M1182948</guid>
      <dc:creator>Pawan_Kesari</dc:creator>
      <dc:date>2009-01-22T13:00:08Z</dc:date>
    </item>
  </channel>
</rss>

