<?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: Upload file with dynamic columns in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-file-with-dynamic-columns/m-p/7760604#M1583596</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 way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;               text(3000),&lt;/P&gt;&lt;P&gt;         end of Itab.&lt;/P&gt;&lt;P&gt;data : begin of t_fiields occurs 0,&lt;/P&gt;&lt;P&gt;               text(3000),&lt;/P&gt;&lt;P&gt;         end of t_fiields .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try to save the excel file in CSV(Comma Seprate value) Format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and use GUI_UPLOAD ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;next all data in itab .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now split the First  line into column into Number of columns&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Split itab-text into table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now create a Dynamic internal table With t_fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and next processs the Dynamic internal table table..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PrabhuD@s&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Mar 2011 12:15:26 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-03-18T12:15:26Z</dc:date>
    <item>
      <title>Upload file with dynamic columns</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-file-with-dynamic-columns/m-p/7760601#M1583593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;My requirement is, I have to upload a file with number of columns being dynamic.&lt;/P&gt;&lt;P&gt;My Input file column number can vary based on the input data. For one entry it can have 10 columns of input and for another entry it can have just 5. First few columns are common for all entries and then from one particular column the next columns can vary based on the input data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have come across FM 'ALSM_EXCEL_TO_INTERNAL_TABLE' , but for this FM we have to pass the scope of the excel, like the column and row details which is not the required thing in my case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know as to how to achieve the requirement of uploading a file with he number of columns varying.&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;Regards,&lt;/P&gt;&lt;P&gt;Dedeepya Thota&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Mar 2011 11:16:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-file-with-dynamic-columns/m-p/7760601#M1583593</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-03-18T11:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Upload file with dynamic columns</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-file-with-dynamic-columns/m-p/7760602#M1583594</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 the below FM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TEXT_CONVERT_XLS_TO_SAP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~~~Ganesh Kumar K.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Mar 2011 11:29:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-file-with-dynamic-columns/m-p/7760602#M1583594</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-03-18T11:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: Upload file with dynamic columns</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-file-with-dynamic-columns/m-p/7760603#M1583595</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;Your saying in you excel sheet your entering the details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you said, Suppose your data is 5 columns. And each entry various &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there are 3 records in excel sheet&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;one entry contains 5 columns of data&lt;/P&gt;&lt;P&gt;second entry contains only 2 columns of data&lt;/P&gt;&lt;P&gt;third entry contains 4 columns of data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As shown below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
Column1   Column2   Column3  Column4  Column5
  100       AA      AA1         AA2        AA3
  200       BB       BB2       
  300       CC       CC2           CC3

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;              &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Now your excel sheet contains data as shown above.

When you upload this file to your internal table 3 entries will be uploaded and every column contains according to that column value in itab.

In this case record second entry column3 contains value BB2 will store in itab-column3, But as per our requirement it should store in itab-column4. Same will happen for third entry also.

In above case you report will not work.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;So wat you have to do is, definatly we know there is some maximum colums in entries.
You fix for that maximum no.columns in excel and declare your itab.

In excel you maintian the values according to the columns value which has to maintian.

For example like below.


Column1   Column2   Column3  Column4  Column5
  100        AA       AA1         AA2        AA3
  200        BB                        BB2
  300        CC                        CC2        CC3

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If some columns are not having data that will be empty. It wont be any problem. Just you have to maintain your template for data&lt;/P&gt;&lt;P&gt;and according to your template you have declare itab in your report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Shankar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Mar 2011 12:07:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-file-with-dynamic-columns/m-p/7760603#M1583595</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-03-18T12:07:38Z</dc:date>
    </item>
    <item>
      <title>Re: Upload file with dynamic columns</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-file-with-dynamic-columns/m-p/7760604#M1583596</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 way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;               text(3000),&lt;/P&gt;&lt;P&gt;         end of Itab.&lt;/P&gt;&lt;P&gt;data : begin of t_fiields occurs 0,&lt;/P&gt;&lt;P&gt;               text(3000),&lt;/P&gt;&lt;P&gt;         end of t_fiields .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try to save the excel file in CSV(Comma Seprate value) Format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and use GUI_UPLOAD ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;next all data in itab .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now split the First  line into column into Number of columns&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Split itab-text into table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now create a Dynamic internal table With t_fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and next processs the Dynamic internal table table..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PrabhuD@s&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Mar 2011 12:15:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-file-with-dynamic-columns/m-p/7760604#M1583596</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-03-18T12:15:26Z</dc:date>
    </item>
  </channel>
</rss>

