<?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: PROBLEM DURING UPLOADING FILE TO INTERNAL TABLE in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-during-uploading-file-to-internal-table/m-p/2768159#M644811</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;IS THERE ANY FUNCTION MODULE THAT UPLOADS ALL TYPES OF FILE????&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Sep 2007 04:42:26 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-18T04:42:26Z</dc:date>
    <item>
      <title>PROBLEM DURING UPLOADING FILE TO INTERNAL TABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-during-uploading-file-to-internal-table/m-p/2768155#M644807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI EVERYBODY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IAM FACING PROBLEMS WHILE UPLOADING MY EXCEL FLAT FILE TO INTERNAL TABLE.&lt;/P&gt;&lt;P&gt;MY REQUIREMENT IS TO UPLOAD ANY TYPE OF FLAT FILE (EITHER TXT OR XLS OR ANY FORMAT)&lt;/P&gt;&lt;P&gt;CAN ANYONE HELP IN THIS ASAP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Sep 2007 04:18:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-during-uploading-file-to-internal-table/m-p/2768155#M644807</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-18T04:18:47Z</dc:date>
    </item>
    <item>
      <title>Re: PROBLEM DURING UPLOADING FILE TO INTERNAL TABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-during-uploading-file-to-internal-table/m-p/2768156#M644808</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use either GUI_UPLOAD or ALSM_EXCEL_TO_INTERNAL_TABLE functions to upload data to internal table.&lt;/P&gt;&lt;P&gt;See the sample code below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data : it_data type standard table of alsmex_tabline initial size 0,
       is_data type alsmex_tabline.

* Start of selection
start-of-selection.

* Upload data from Excel to internal table format
  call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
       exporting
            filename                = p_ifname
            i_begin_col             = 1
            i_begin_row             = 1
            i_end_col               = 256
            i_end_row               = 65356
       tables
            intern                  = it_data
       exceptions
            inconsistent_parameters = 1
            upload_ole              = 2
            others                  = 3.
  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.

* Delete the heading if exists
  delete it_data where row = '001'.

* Append EXCEL Data into a internal table
  loop at it_data into is_data.
    at new row.
      clear it_tab.
    endat.
    if is_data-col = '001'.
      move is_data-value to it_tab-bukrs.
    endif.
    if is_data-col = '002'.
      move is_data-value to it_tab-anln1.
    endif.
    if is_data-col = '003'.
      move is_data-value to it_tab-anln2.
    endif.
    if is_data-col = '004'.
        call function 'CONVERSION_EXIT_IDATE_INPUT'
             exporting
                  input  = is_data-value
             importing
                  output = it_tab-leabg.
    endif.
    IF is_data-col = '005'.
      CALL FUNCTION 'CONVERSION_EXIT_IDATE_INPUT'
           EXPORTING
                input  = is_data-value
           IMPORTING
                output = it_tab-leabg.
    ENDIF.

    at end of row.
      append it_tab.
      clear it_tab.
    endat.
    clear : is_data.
  endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Gopi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Sep 2007 04:22:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-during-uploading-file-to-internal-table/m-p/2768156#M644808</guid>
      <dc:creator>gopi_narendra</dc:creator>
      <dc:date>2007-09-18T04:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: PROBLEM DURING UPLOADING FILE TO INTERNAL TABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-during-uploading-file-to-internal-table/m-p/2768157#M644809</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Naveen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            What 's your problem when you upload the file ? &lt;/P&gt;&lt;P&gt;you can upload any type of file by checking the type of file before you use function upload .Then you use 'if ' statement to  choose the correct function for each type of flat file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Find type of flat file.&lt;/P&gt;&lt;P&gt;1. find length of path of file .&lt;/P&gt;&lt;P&gt;2. search "." in your path file for position.&lt;/P&gt;&lt;P&gt;3. move the type of file to variable (type of flat file is follow "." )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after that&lt;/P&gt;&lt;P&gt;1.if x_type = 'txt'.&lt;/P&gt;&lt;P&gt;  call ...&lt;/P&gt;&lt;P&gt;elesif x_type = 'xls'.&lt;/P&gt;&lt;P&gt;  call ...&lt;/P&gt;&lt;P&gt;end if.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Wiboon&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;Wiboon&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Wiboon Chaiyabutsakul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Sep 2007 04:25:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-during-uploading-file-to-internal-table/m-p/2768157#M644809</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-18T04:25:42Z</dc:date>
    </item>
    <item>
      <title>Re: PROBLEM DURING UPLOADING FILE TO INTERNAL TABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-during-uploading-file-to-internal-table/m-p/2768158#M644810</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;*--&lt;DEL&gt;&lt;/DEL&gt;&lt;/P&gt;&lt;HR originaltext="----" /&gt;INTERNAL  TABEL  DECLARATION--&lt;P&gt;&lt;/P&gt;&lt;HR originaltext="----" /&gt;&lt;P&gt;TYPES: BEGIN OF ts_data,&lt;/P&gt;&lt;P&gt;         mandt    TYPE mandt,&lt;/P&gt;&lt;P&gt;         user_id  TYPE user_id,&lt;/P&gt;&lt;P&gt;         group TYPE zgroup,&lt;/P&gt;&lt;P&gt;       END OF ts_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--&lt;DEL&gt;&lt;/DEL&gt;&lt;/P&gt;&lt;HR originaltext="---" /&gt;SELECTION  SCREEN--&lt;P&gt;&lt;/P&gt;&lt;HR originaltext="-----" /&gt;&lt;P&gt;SELECTION-SCREEN BEGIN OF BLOCK map WITH FRAME TITLE text-001.&lt;/P&gt;&lt;P&gt;PARAMETERS: pa_file TYPE rlgrap-filename OBLIGATORY.&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN END OF BLOCK map.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--&lt;DEL&gt;&lt;/DEL&gt;&lt;/P&gt;&lt;HR originaltext="----" /&gt;AT  SELECTION  SCREEN--&lt;P&gt;&lt;/P&gt;&lt;HR originaltext="------" /&gt;&lt;P&gt;AT SELECTION-SCREEN ON VALUE-REQUEST FOR pa_file.&lt;/P&gt;&lt;P&gt;*Get the file path&lt;/P&gt;&lt;P&gt;  PERFORM get_path.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--&lt;DEL&gt;&lt;/DEL&gt;&lt;/P&gt;&lt;HR originaltext="----" /&gt;START  OF  SELECTION--&lt;P&gt;&lt;/P&gt;&lt;HR originaltext="--------" /&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;*Process the data&lt;/P&gt;&lt;P&gt;  PERFORM process_data USING pa_file.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  get_path&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; --&amp;gt;  p1        text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; &amp;lt;--  p2        text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM get_path .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'F4_FILENAME'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  PROGRAM_NAME        = SYST-CPROG&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  DYNPRO_NUMBER       = SYST-DYNNR&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  FIELD_NAME          = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;     IMPORTING&lt;/P&gt;&lt;P&gt;          file_name = pa_file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " get_path&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  process_data&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     --&amp;gt;P_PA_FILE  text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM process_data  USING    p_pa_file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: lt_data TYPE TABLE OF ts_data WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;        ls_data TYPE ts_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: xcel TYPE TABLE OF alsmex_tabline WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  REFRESH: xcel,lt_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Get the records from EXCEL sheet to internal table.&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      filename                = pa_file&lt;/P&gt;&lt;P&gt;      i_begin_col             = 1&lt;/P&gt;&lt;P&gt;      i_begin_row             = 2&lt;/P&gt;&lt;P&gt;      i_end_col               = 200&lt;/P&gt;&lt;P&gt;      i_end_row               = 5000&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      intern                  = xcel&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      inconsistent_parameters = 1&lt;/P&gt;&lt;P&gt;      upload_ole              = 2&lt;/P&gt;&lt;P&gt;      OTHERS                  = 3.&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; Fill the internal table with the values&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  LOOP AT xcel.&lt;/P&gt;&lt;P&gt;    lt_data-mandt        = sy-mandt.&lt;/P&gt;&lt;P&gt;    CASE xcel-col.&lt;/P&gt;&lt;P&gt;      WHEN '0001'.&lt;/P&gt;&lt;P&gt;        lt_data-user_id  = xcel-value.&lt;/P&gt;&lt;P&gt;      WHEN '0002'.&lt;/P&gt;&lt;P&gt;        lt_data-ah_group = xcel-value.&lt;/P&gt;&lt;P&gt;    ENDCASE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward if useful&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Sep 2007 04:30:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-during-uploading-file-to-internal-table/m-p/2768158#M644810</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-18T04:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: PROBLEM DURING UPLOADING FILE TO INTERNAL TABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-during-uploading-file-to-internal-table/m-p/2768159#M644811</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;IS THERE ANY FUNCTION MODULE THAT UPLOADS ALL TYPES OF FILE????&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Sep 2007 04:42:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-during-uploading-file-to-internal-table/m-p/2768159#M644811</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-18T04:42:26Z</dc:date>
    </item>
    <item>
      <title>Re: PROBLEM DURING UPLOADING FILE TO INTERNAL TABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-during-uploading-file-to-internal-table/m-p/2768160#M644812</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Dec 2007 06:18:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-during-uploading-file-to-internal-table/m-p/2768160#M644812</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-20T06:18:21Z</dc:date>
    </item>
  </channel>
</rss>

