<?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: uploading excel data to database table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-excel-data-to-database-table/m-p/6011360#M1346097</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;Well pack statement can be used only for numbers though. Since you can declared the field as type char you are getting that message. In that case you can just delete the leading and trailing space &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

shift  itab-menge left   deleting leading space.
shift  itab-menge right deleting trailing space.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Aug 2009 05:54:46 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-08-11T05:54:46Z</dc:date>
    <item>
      <title>uploading excel data to database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-excel-data-to-database-table/m-p/6011356#M1346093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Experts,&lt;/P&gt;&lt;P&gt;                 &lt;/P&gt;&lt;P&gt;                     I have an Excel file which was downloaded from SQL database, now I need to export this data into my 'ztable', for this first I created an internal table of ztable structure and tried to upload into this table through ''TEXT_CONVERT_XLS_TO_SAP".&lt;/P&gt;&lt;P&gt;But I was unable to get data into the internal table(incompatible type), so now I created an internal table of character type fileds now I able to get data to this internal table, but to put this internal table data to actual database table it gives error, here the actual problem is the fields of internal table are getting concated with blank spaces(observed through debug), I unable to condense these blanks also, (&lt;STRONG&gt;I have created an Excel of my own and put data into it and uploaded that data there is no problem working fine but this problem occurs only for the excel downloaded from SQL db&lt;/STRONG&gt;)&lt;/P&gt;&lt;P&gt;                   The problem occurs for quantity and currency fields(I tried through standard FMs also to convert data types ), Could plz suggest something..........&lt;/P&gt;&lt;P&gt;                                                                                Thank you&lt;/P&gt;&lt;P&gt;                                                                                Regards&lt;/P&gt;&lt;P&gt;                                                                                Srinivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Aug 2009 04:58:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-excel-data-to-database-table/m-p/6011356#M1346093</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-11T04:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: uploading excel data to database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-excel-data-to-database-table/m-p/6011357#M1346094</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 using pack and shift delete to remove the extra spaces for the quantity and currency fields and then try to upload into the Ztable&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

loop at itab.
pack itab-menge to itab-menge.
shift itab-menge left deleting leading space.

pack itab-wears to itab-wears.
shift itab-weards left deleting leading space.

modify itab transpoting menge wears.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Aug 2009 05:09:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-excel-data-to-database-table/m-p/6011357#M1346094</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-11T05:09:07Z</dc:date>
    </item>
    <item>
      <title>Re: uploading excel data to database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-excel-data-to-database-table/m-p/6011358#M1346095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hai,&lt;/P&gt;&lt;P&gt;    Thank you for ur response, eventhough I used the code as you said I'm getting the same problem while executing the pack statement, the error is &lt;STRONG&gt;Unable to interpret "2101 &amp;nbsp;&amp;nbsp;&amp;nbsp;" as a number&lt;/STRONG&gt;, here have u observed the blanks are getting added right side of the value and for some fields it gets added left side..........&lt;/P&gt;&lt;P&gt;           thank you.................&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Aug 2009 05:48:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-excel-data-to-database-table/m-p/6011358#M1346095</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-11T05:48:35Z</dc:date>
    </item>
    <item>
      <title>Re: uploading excel data to database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-excel-data-to-database-table/m-p/6011359#M1346096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi sri!&lt;/P&gt;&lt;P&gt;can you paste your code here..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sumit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Aug 2009 05:50:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-excel-data-to-database-table/m-p/6011359#M1346096</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-11T05:50:18Z</dc:date>
    </item>
    <item>
      <title>Re: uploading excel data to database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-excel-data-to-database-table/m-p/6011360#M1346097</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;Well pack statement can be used only for numbers though. Since you can declared the field as type char you are getting that message. In that case you can just delete the leading and trailing space &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

shift  itab-menge left   deleting leading space.
shift  itab-menge right deleting trailing space.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Aug 2009 05:54:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-excel-data-to-database-table/m-p/6011360#M1346097</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-11T05:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: uploading excel data to database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-excel-data-to-database-table/m-p/6011361#M1346098</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;To upload excel sheet into database table, define a types which is of same as table fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and try it with the function module  &lt;STRONG&gt;TEXT_CONVERT_XLS_TO_SAP&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a sample code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
        EXPORTING
         I_FIELD_SEPERATOR          ='X'    
          i_tab_raw_data             = fs_truxs( TYPE of  truxs_t_text_data.)
          i_filename                 = '&amp;lt;FILE-PATH&amp;gt;'
      tables
          i_tab_converted_data       = &amp;lt;Internal Table&amp;gt;
       EXCEPTIONS
         CONVERSION_FAILED          = 1
         OTHERS                     = 2
                .
      IF sy-subrc &amp;lt;&amp;gt; 0.
 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.

LOOP AT &amp;lt;internal-table&amp;gt; INTO field string.
 INSERT &amp;lt;DATABASE- TABLE&amp;gt; FROM &amp;lt;field string&amp;gt;.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this solves the issue.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rajani&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Aug 2009 06:07:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-excel-data-to-database-table/m-p/6011361#M1346098</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-11T06:07:26Z</dc:date>
    </item>
    <item>
      <title>Re: uploading excel data to database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-excel-data-to-database-table/m-p/6011362#M1346099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hai,&lt;/P&gt;&lt;P&gt;   I already used shift also, but there is no use.......,it works for split statement but I have large no.of records in my excel, it is hard to write split statement in loop for every fields of 54 fields...........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Sri on Aug 11, 2009 11:37 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Aug 2009 06:07:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-excel-data-to-database-table/m-p/6011362#M1346099</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-11T06:07:30Z</dc:date>
    </item>
    <item>
      <title>Re: uploading excel data to database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-excel-data-to-database-table/m-p/6011363#M1346100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How did you get blanks if you are using FM "text_convert.."&lt;/P&gt;&lt;P&gt;Instead of makin all the fields of type char in your int tab, make only the quant and curr fields(those that are giving error) of type char in you itab. Then in your code copy them into quant and currency variables manually.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sumit&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Sumit Nene on Aug 11, 2009 8:19 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Aug 2009 06:13:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-excel-data-to-database-table/m-p/6011363#M1346100</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-11T06:13:47Z</dc:date>
    </item>
  </channel>
</rss>

