<?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: Dynamically fetching first column in internal table based on flat file in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-fetching-first-column-in-internal-table-based-on-flat-file/m-p/10809817#M1881724</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Swarna,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you try this solution?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Jan 2015 06:41:38 GMT</pubDate>
    <dc:creator>archanapawar</dc:creator>
    <dc:date>2015-01-20T06:41:38Z</dc:date>
    <item>
      <title>Dynamically fetching first column in internal table based on flat file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-fetching-first-column-in-internal-table-based-on-flat-file/m-p/10809808#M1881715</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;Let me explain this scenario.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a flat file which will be uploaded for a BDC. Based on which type pf business is operating we have two types of flat file template -&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Business 1 : Template&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Land1&lt;/P&gt;&lt;P&gt;LIFNR&lt;/P&gt;&lt;P&gt;Bank details&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Business 2 Template&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LIFNR&lt;/P&gt;&lt;P&gt;BANK DETAILS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In any case for further processing , I need the first column to be there which is LAND1. How do in create column 1 to my internal table at runtime and proceed.Also the other columns are fixed and will not change.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;AS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Jan 2015 05:42:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-fetching-first-column-in-internal-table-based-on-flat-file/m-p/10809808#M1881715</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-01-18T05:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically fetching first column in internal table based on flat file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-fetching-first-column-in-internal-table-based-on-flat-file/m-p/10809809#M1881716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Swarna,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think it is difficult to generate LAND1 column at runtime while reading dataset into internal table.&lt;/P&gt;&lt;P&gt;Did you try offset method to determin whether your first column is LAND1 or LIFNR?&lt;/P&gt;&lt;P&gt;May be based on that you can pass you record into respective internal table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Jan 2015 06:42:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-fetching-first-column-in-internal-table-based-on-flat-file/m-p/10809809#M1881716</guid>
      <dc:creator>archanapawar</dc:creator>
      <dc:date>2015-01-18T06:42:23Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically fetching first column in internal table based on flat file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-fetching-first-column-in-internal-table-based-on-flat-file/m-p/10809810#M1881717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please clarify and give example to your Flat file records&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Jan 2015 09:04:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-fetching-first-column-in-internal-table-based-on-flat-file/m-p/10809810#M1881717</guid>
      <dc:creator>former_member182888</dc:creator>
      <dc:date>2015-01-18T09:04:40Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically fetching first column in internal table based on flat file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-fetching-first-column-in-internal-table-based-on-flat-file/m-p/10809811#M1881718</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;In case of Business 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LAND1 LIFNR TAXID NAME1 SORT1 etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In case of Business 2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LIFNR TAXID NAME1 SORT1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here in case of business 2 i need to add a column LAND1 at run time after uploading the flat file and set it to a specific country value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please help,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;AS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Jan 2015 10:11:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-fetching-first-column-in-internal-table-based-on-flat-file/m-p/10809811#M1881718</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-01-18T10:11:30Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically fetching first column in internal table based on flat file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-fetching-first-column-in-internal-table-based-on-flat-file/m-p/10809812#M1881719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi swarna,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you try offset method? You can get the content of read dataset into a string type first and check the first field whether it is LAND1 or LIFNR. Further you can divide it as per your requirement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Jan 2015 10:26:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-fetching-first-column-in-internal-table-based-on-flat-file/m-p/10809812#M1881719</guid>
      <dc:creator>archanapawar</dc:creator>
      <dc:date>2015-01-18T10:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically fetching first column in internal table based on flat file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-fetching-first-column-in-internal-table-based-on-flat-file/m-p/10809813#M1881720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thank you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ok,&lt;/P&gt;&lt;P&gt;you will &lt;STRONG&gt;concatenate&lt;/STRONG&gt; the desired value to the beginning of the record&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Jan 2015 10:39:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-fetching-first-column-in-internal-table-based-on-flat-file/m-p/10809813#M1881720</guid>
      <dc:creator>former_member182888</dc:creator>
      <dc:date>2015-01-18T10:39:45Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically fetching first column in internal table based on flat file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-fetching-first-column-in-internal-table-based-on-flat-file/m-p/10809814#M1881721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Archana,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please explain as im a bit confused here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;AS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Jan 2015 11:55:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-fetching-first-column-in-internal-table-based-on-flat-file/m-p/10809814#M1881721</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-01-18T11:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically fetching first column in internal table based on flat file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-fetching-first-column-in-internal-table-based-on-flat-file/m-p/10809815#M1881722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Swarna,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data element LIFNR is char10 and LAND1 is char3. So, define a work area type string.&lt;/P&gt;&lt;P&gt;Then read dataset into work area.&lt;/P&gt;&lt;P&gt;After reading into work area, split your work area at your file separator e.g. ' '(space) into 2 variables.&lt;/P&gt;&lt;P&gt;Read the length of first variable, if its 3, then it is LAND1 field and if it is more than 3 that means field is LIFNR.&lt;/P&gt;&lt;P&gt;Below is sample code.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P&gt;&lt;SPAN class="L0S52"&gt;DATA&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;: &lt;/SPAN&gt;wa_text &lt;SPAN class="L0S52"&gt;TYPE &lt;/SPAN&gt;string&lt;SPAN class="L0S55"&gt;,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lv_text1 &lt;SPAN class="L0S52"&gt;TYPE &lt;/SPAN&gt;char10&lt;SPAN class="L0S55"&gt;,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lv_text2 &lt;SPAN class="L0S52"&gt;TYPE &lt;/SPAN&gt;char10&lt;SPAN class="L0S55"&gt;,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lv_count &lt;SPAN class="L0S52"&gt;TYPE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;i&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;SPAN class="L0S52"&gt;READ &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;DATASET &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;lv_path &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;INTO &lt;/SPAN&gt;wa_text&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;SPAN class="L0S55"&gt;split wa_text &lt;SPAN style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif;"&gt;at ' '&lt;/SPAN&gt; into lv_text1 lv_text2.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;SPAN class="L0S55"&gt;lv_count = strlen( &lt;SPAN style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif;"&gt;lv_text1 ).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif;"&gt;if lv_count eq 3.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;SPAN class="L0S55"&gt;*- read dataset again to internal table with LAND1 and remaining columns.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;SPAN class="L0S55"&gt;else.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;SPAN class="L0S55"&gt;*- &lt;SPAN style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif;"&gt;read dataset again to internal table for LIFNR.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="L0S55"&gt;&lt;SPAN class="L0S55"&gt;&lt;SPAN style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif;"&gt;ENDIF.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hope it helps. It should work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Jan 2015 12:12:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-fetching-first-column-in-internal-table-based-on-flat-file/m-p/10809815#M1881722</guid>
      <dc:creator>archanapawar</dc:creator>
      <dc:date>2015-01-18T12:12:08Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically fetching first column in internal table based on flat file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-fetching-first-column-in-internal-table-based-on-flat-file/m-p/10809816#M1881723</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 with the&amp;nbsp; Excel format&amp;nbsp; using&amp;nbsp; FM &lt;SPAN style="color: #333333; font-size: 12px;"&gt;&lt;STRONG&gt;ALSM_EXCEL_TO_INTERNAL_TABLE . &lt;/STRONG&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helpful.&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;Venkat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Jan 2015 17:07:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-fetching-first-column-in-internal-table-based-on-flat-file/m-p/10809816#M1881723</guid>
      <dc:creator>VenkatRamesh_V</dc:creator>
      <dc:date>2015-01-18T17:07:08Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically fetching first column in internal table based on flat file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-fetching-first-column-in-internal-table-based-on-flat-file/m-p/10809817#M1881724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Swarna,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you try this solution?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jan 2015 06:41:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-fetching-first-column-in-internal-table-based-on-flat-file/m-p/10809817#M1881724</guid>
      <dc:creator>archanapawar</dc:creator>
      <dc:date>2015-01-20T06:41:38Z</dc:date>
    </item>
  </channel>
</rss>

