<?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 excel file with function 'WS_UPLOAD' has error in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-excel-file-with-function-ws-upload-has-error/m-p/3256628#M777733</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nguyen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use FM ALSM_EXCEL_TO_INTERNAL_TABLE&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;TYPES:&lt;/P&gt;&lt;P&gt;BEGIN OF ty_upload,&lt;/P&gt;&lt;P&gt;field1 TYPE c length 12,&lt;/P&gt;&lt;P&gt;field2 TYPE c length 12,&lt;/P&gt;&lt;P&gt;field3 TYPE c length 12,&lt;/P&gt;&lt;P&gt;END OF ty_upload.&lt;/P&gt;&lt;P&gt;DATA it_upload TYPE STANDARD TABLE OF ty_upload WITH DEFAULT KEY.&lt;/P&gt;&lt;P&gt;DATA wa_upload TYPE ty_upload.&lt;/P&gt;&lt;P&gt;DATA itab TYPE STANDARD TABLE OF alsmex_tabline WITH DEFAULT KEY.&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;wa&amp;gt; type alsmex_tabline.&lt;/P&gt;&lt;P&gt; &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 = filename&lt;/P&gt;&lt;P&gt;i_begin_col = 1&lt;/P&gt;&lt;P&gt;i_begin_row = 1&lt;/P&gt;&lt;P&gt;i_end_col = 3&lt;/P&gt;&lt;P&gt;i_end_row = 65535&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;intern = itab.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;LOOP AT itab ASSIGNING &amp;lt;wa&amp;gt;.&lt;/P&gt;&lt;P&gt;CASE &amp;lt;wa&amp;gt;-col.&lt;/P&gt;&lt;P&gt;WHEN '0001'.&lt;/P&gt;&lt;P&gt;wa_upload-field1 = &amp;lt;wa&amp;gt;-value.&lt;/P&gt;&lt;P&gt;WHEN '0002'.&lt;/P&gt;&lt;P&gt;wa_upload-field2 = &amp;lt;wa&amp;gt;-value.&lt;/P&gt;&lt;P&gt;WHEN '0003'.&lt;/P&gt;&lt;P&gt;wa_upload-field3 = &amp;lt;wa&amp;gt;-value.&lt;/P&gt;&lt;P&gt;ENDCASE.&lt;/P&gt;&lt;P&gt;APPEND wa_upload TO it_upload.&lt;/P&gt;&lt;P&gt;CLEAR wa_upload.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**********&lt;STRONG&gt;another way&lt;/STRONG&gt;*******&lt;/P&gt;&lt;P&gt;TYPE-POOLS truxs.&lt;/P&gt;&lt;P&gt;tables : ztable.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;types: begin of t_tab,&lt;/P&gt;&lt;P&gt;col1(5) type c,&lt;/P&gt;&lt;P&gt;col2(5) type c,&lt;/P&gt;&lt;P&gt;col3(5) type c,&lt;/P&gt;&lt;P&gt;end of t_tab.&lt;/P&gt;&lt;P&gt;data : itab type standard table of t_tab,&lt;/P&gt;&lt;P&gt;wa type t_tab.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;data it_type type truxs_t_text_data.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;parameter p_file type rlgrap-filename.&lt;/P&gt;&lt;P&gt;data ttab type tabname.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;at selection-screen on value-request for p_file.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'F4_FILENAME'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;UL&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;/UL&gt;&lt;P&gt;FIELD_NAME = 'P_FILE'&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;FILE_NAME = p_file&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;I_FIELD_SEPERATOR =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;I_LINE_HEADER = 'X'&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;i_tab_raw_data = it_type&lt;/P&gt;&lt;P&gt;i_filename = p_file&lt;/P&gt;&lt;P&gt;tables&lt;/P&gt;&lt;P&gt;i_tab_converted_data = itab[]&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;CONVERSION_FAILED = 1&lt;/P&gt;&lt;P&gt;OTHERS = 2&lt;/P&gt;&lt;P&gt;.&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;P&gt;end-of-selection.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;loop at itab into wa.&lt;/P&gt;&lt;P&gt;ztable-col1 = wa-col1.&lt;/P&gt;&lt;P&gt;ztable-col2 = wa-col2.&lt;/P&gt;&lt;P&gt;ztable-col3 = wa-col3.&lt;/P&gt;&lt;P&gt;modify ztable.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward points if this helps.&lt;/P&gt;&lt;P&gt;Manish&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 Jan 2008 03:30:36 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-01-16T03:30:36Z</dc:date>
    <item>
      <title>upload excel file with function 'WS_UPLOAD' has error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-excel-file-with-function-ws-upload-has-error/m-p/3256627#M777732</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;PARAMETERS: p_file LIKE rlgrap-filename.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my program use CALL FUNCTION 'WS_UPLOAD'&lt;/P&gt;&lt;P&gt; EXPORTING&lt;/P&gt;&lt;P&gt;   FILENAME                      = p_file&lt;/P&gt;&lt;P&gt;   FILETYPE                      = 'BIN'&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;    DATA_TAB                      = i_upload&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But i_upload out have data can not read &lt;/P&gt;&lt;P&gt;ex: ÐÏ#à¡±#á##########&lt;/P&gt;&lt;P&gt;#¤####mm/dd##8#¥#3&lt;/P&gt;&lt;P&gt; à######### ##x##@&lt;/P&gt;&lt;P&gt;######Sheet1&amp;#133;###@#&lt;/P&gt;&lt;P&gt;Actual are date and qty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;03122008	04122008&lt;/P&gt;&lt;P&gt;111	            120&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how solve this.......&lt;/P&gt;&lt;P&gt;thanks so much....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jan 2008 03:27:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-excel-file-with-function-ws-upload-has-error/m-p/3256627#M777732</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-16T03:27:11Z</dc:date>
    </item>
    <item>
      <title>Re: upload excel file with function 'WS_UPLOAD' has error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-excel-file-with-function-ws-upload-has-error/m-p/3256628#M777733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nguyen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use FM ALSM_EXCEL_TO_INTERNAL_TABLE&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;TYPES:&lt;/P&gt;&lt;P&gt;BEGIN OF ty_upload,&lt;/P&gt;&lt;P&gt;field1 TYPE c length 12,&lt;/P&gt;&lt;P&gt;field2 TYPE c length 12,&lt;/P&gt;&lt;P&gt;field3 TYPE c length 12,&lt;/P&gt;&lt;P&gt;END OF ty_upload.&lt;/P&gt;&lt;P&gt;DATA it_upload TYPE STANDARD TABLE OF ty_upload WITH DEFAULT KEY.&lt;/P&gt;&lt;P&gt;DATA wa_upload TYPE ty_upload.&lt;/P&gt;&lt;P&gt;DATA itab TYPE STANDARD TABLE OF alsmex_tabline WITH DEFAULT KEY.&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;wa&amp;gt; type alsmex_tabline.&lt;/P&gt;&lt;P&gt; &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 = filename&lt;/P&gt;&lt;P&gt;i_begin_col = 1&lt;/P&gt;&lt;P&gt;i_begin_row = 1&lt;/P&gt;&lt;P&gt;i_end_col = 3&lt;/P&gt;&lt;P&gt;i_end_row = 65535&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;intern = itab.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;LOOP AT itab ASSIGNING &amp;lt;wa&amp;gt;.&lt;/P&gt;&lt;P&gt;CASE &amp;lt;wa&amp;gt;-col.&lt;/P&gt;&lt;P&gt;WHEN '0001'.&lt;/P&gt;&lt;P&gt;wa_upload-field1 = &amp;lt;wa&amp;gt;-value.&lt;/P&gt;&lt;P&gt;WHEN '0002'.&lt;/P&gt;&lt;P&gt;wa_upload-field2 = &amp;lt;wa&amp;gt;-value.&lt;/P&gt;&lt;P&gt;WHEN '0003'.&lt;/P&gt;&lt;P&gt;wa_upload-field3 = &amp;lt;wa&amp;gt;-value.&lt;/P&gt;&lt;P&gt;ENDCASE.&lt;/P&gt;&lt;P&gt;APPEND wa_upload TO it_upload.&lt;/P&gt;&lt;P&gt;CLEAR wa_upload.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**********&lt;STRONG&gt;another way&lt;/STRONG&gt;*******&lt;/P&gt;&lt;P&gt;TYPE-POOLS truxs.&lt;/P&gt;&lt;P&gt;tables : ztable.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;types: begin of t_tab,&lt;/P&gt;&lt;P&gt;col1(5) type c,&lt;/P&gt;&lt;P&gt;col2(5) type c,&lt;/P&gt;&lt;P&gt;col3(5) type c,&lt;/P&gt;&lt;P&gt;end of t_tab.&lt;/P&gt;&lt;P&gt;data : itab type standard table of t_tab,&lt;/P&gt;&lt;P&gt;wa type t_tab.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;data it_type type truxs_t_text_data.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;parameter p_file type rlgrap-filename.&lt;/P&gt;&lt;P&gt;data ttab type tabname.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;at selection-screen on value-request for p_file.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'F4_FILENAME'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;UL&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;/UL&gt;&lt;P&gt;FIELD_NAME = 'P_FILE'&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;FILE_NAME = p_file&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;I_FIELD_SEPERATOR =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;I_LINE_HEADER = 'X'&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;i_tab_raw_data = it_type&lt;/P&gt;&lt;P&gt;i_filename = p_file&lt;/P&gt;&lt;P&gt;tables&lt;/P&gt;&lt;P&gt;i_tab_converted_data = itab[]&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;CONVERSION_FAILED = 1&lt;/P&gt;&lt;P&gt;OTHERS = 2&lt;/P&gt;&lt;P&gt;.&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;P&gt;end-of-selection.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;loop at itab into wa.&lt;/P&gt;&lt;P&gt;ztable-col1 = wa-col1.&lt;/P&gt;&lt;P&gt;ztable-col2 = wa-col2.&lt;/P&gt;&lt;P&gt;ztable-col3 = wa-col3.&lt;/P&gt;&lt;P&gt;modify ztable.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward points if this helps.&lt;/P&gt;&lt;P&gt;Manish&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jan 2008 03:30:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-excel-file-with-function-ws-upload-has-error/m-p/3256628#M777733</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-16T03:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: upload excel file with function 'WS_UPLOAD' has error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-excel-file-with-function-ws-upload-has-error/m-p/3256629#M777734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tham,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is to upload one excel file in CSV format to database table which i have created.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT ZSDCCDTGTUPD .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES: ZCCD_TGT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF itab OCCURS 0,&lt;/P&gt;&lt;P&gt;kunnr TYPE zccd_tgt-kunnr,&lt;/P&gt;&lt;P&gt;FSCAL_YEAR TYPE zccd_tgt-FSCAL_YEAR,&lt;/P&gt;&lt;P&gt;VALUE(14) type c, "TYPE zccd_tgt-VALUE,&lt;/P&gt;&lt;P&gt;date1 TYPE zccd_tgt-date1,&lt;/P&gt;&lt;P&gt;END OF itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : l_flnm type rlgrap-filename.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;selection-screen begin of block bk1 with frame title text-001.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;selection-screen skip 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;parameters: p_flnm like rlgrap-filename obligatory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;selection-screen skip 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;selection-screen end of block bk1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at selection-screen on value-request for p_flnm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call function 'F4_FILENAME'&lt;/P&gt;&lt;P&gt;exporting&lt;/P&gt;&lt;P&gt;program_name = syst-cprog&lt;/P&gt;&lt;P&gt;dynpro_number = syst-dynnr&lt;/P&gt;&lt;P&gt;importing&lt;/P&gt;&lt;P&gt;file_name = p_flnm.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear l_flnm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l_flnm = p_flnm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call function 'WS_UPLOAD'&lt;/P&gt;&lt;P&gt;exporting&lt;/P&gt;&lt;P&gt;filename = l_flnm&lt;/P&gt;&lt;P&gt;filetype = 'dat'&lt;/P&gt;&lt;P&gt;tables&lt;/P&gt;&lt;P&gt;data_tab = ITAB&lt;/P&gt;&lt;P&gt;exceptions&lt;/P&gt;&lt;P&gt;conversion_error = 1&lt;/P&gt;&lt;P&gt;file_open_error = 2&lt;/P&gt;&lt;P&gt;file_read_error = 3&lt;/P&gt;&lt;P&gt;invalid_table_width = 4&lt;/P&gt;&lt;P&gt;invalid_type = 5&lt;/P&gt;&lt;P&gt;no_batch = 6&lt;/P&gt;&lt;P&gt;unknown_error = 7&lt;/P&gt;&lt;P&gt;gui_refuse_filetransfer = 8&lt;/P&gt;&lt;P&gt;others = 9.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;zccd_tgt-kunnr = ITAB-kunnr.&lt;/P&gt;&lt;P&gt;zccd_tgt-FSCAL_YEAR = ITAB-FSCAL_YEAR.&lt;/P&gt;&lt;P&gt;zccd_tgt-VALUE = ITAB-VALUE.&lt;/P&gt;&lt;P&gt;zccd_tgt-date1 = ITAB-DATE1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODIFY ZCCD_TGT.&lt;/P&gt;&lt;P&gt;commit work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;REPORT ZSDCCDTGTUPD .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES: ZCCD_TGT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF itab OCCURS 0,&lt;/P&gt;&lt;P&gt;kunnr TYPE zccd_tgt-kunnr,&lt;/P&gt;&lt;P&gt;FSCAL_YEAR TYPE zccd_tgt-FSCAL_YEAR,&lt;/P&gt;&lt;P&gt;VALUE(14) type c, "TYPE zccd_tgt-VALUE,&lt;/P&gt;&lt;P&gt;date1 TYPE zccd_tgt-date1,&lt;/P&gt;&lt;P&gt;END OF itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : l_flnm type rlgrap-filename.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;selection-screen begin of block bk1 with frame title text-001.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;selection-screen skip 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;parameters: p_flnm like rlgrap-filename obligatory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;selection-screen skip 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;selection-screen end of block bk1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at selection-screen on value-request for p_flnm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call function 'F4_FILENAME'&lt;/P&gt;&lt;P&gt;exporting&lt;/P&gt;&lt;P&gt;program_name = syst-cprog&lt;/P&gt;&lt;P&gt;dynpro_number = syst-dynnr&lt;/P&gt;&lt;P&gt;importing&lt;/P&gt;&lt;P&gt;file_name = p_flnm.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear l_flnm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l_flnm = p_flnm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call function 'WS_UPLOAD'&lt;/P&gt;&lt;P&gt;exporting&lt;/P&gt;&lt;P&gt;filename = l_flnm&lt;/P&gt;&lt;P&gt;filetype = 'dat'&lt;/P&gt;&lt;P&gt;tables&lt;/P&gt;&lt;P&gt;data_tab = ITAB&lt;/P&gt;&lt;P&gt;exceptions&lt;/P&gt;&lt;P&gt;conversion_error = 1&lt;/P&gt;&lt;P&gt;file_open_error = 2&lt;/P&gt;&lt;P&gt;file_read_error = 3&lt;/P&gt;&lt;P&gt;invalid_table_width = 4&lt;/P&gt;&lt;P&gt;invalid_type = 5&lt;/P&gt;&lt;P&gt;no_batch = 6&lt;/P&gt;&lt;P&gt;unknown_error = 7&lt;/P&gt;&lt;P&gt;gui_refuse_filetransfer = 8&lt;/P&gt;&lt;P&gt;others = 9.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;zccd_tgt-kunnr = ITAB-kunnr.&lt;/P&gt;&lt;P&gt;zccd_tgt-FSCAL_YEAR = ITAB-FSCAL_YEAR.&lt;/P&gt;&lt;P&gt;zccd_tgt-VALUE = ITAB-VALUE.&lt;/P&gt;&lt;P&gt;zccd_tgt-date1 = ITAB-DATE1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODIFY ZCCD_TGT.&lt;/P&gt;&lt;P&gt;commit work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kindly reward if found helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;Hema.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jan 2008 03:32:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-excel-file-with-function-ws-upload-has-error/m-p/3256629#M777734</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-16T03:32:04Z</dc:date>
    </item>
    <item>
      <title>Re: upload excel file with function 'WS_UPLOAD' has error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-excel-file-with-function-ws-upload-has-error/m-p/3256630#M777735</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;use  'ALSM_EXCEL_TO_INTERNAL_TABLE' function module to upload excel to internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this function module uploads data from excel to internal table,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check this sample code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPE-POOLS truxs.&lt;/P&gt;&lt;P&gt;TABLES:zmatnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : itab LIKE alsmex_tabline OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;DATA row LIKE alsmex_tabline-row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : g_matnr like mara-matnr.&lt;/P&gt;&lt;P&gt;data : count type i.&lt;/P&gt;&lt;P&gt;data : itab_count type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : gi_final like zmatnr occurs 0 with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*data : begin of gi_final occurs 0,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mat_old like mara-matnr, &lt;/P&gt;&lt;P&gt;mat_new like mara-matnr, &lt;/P&gt;&lt;P&gt;end of gi_final. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***********************&lt;STRONG&gt;Selection Screen&lt;/STRONG&gt;*************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.&lt;/P&gt;&lt;P&gt;PARAMETER : pfname LIKE rlgrap-filename OBLIGATORY.&lt;/P&gt;&lt;P&gt;select-options : records for count.&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN END OF BLOCK b1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*******************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*********************&lt;STRONG&gt;At Selection Screen&lt;/STRONG&gt;*************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT SELECTION-SCREEN ON VALUE-REQUEST FOR pfname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PERFORM search.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*******************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform process.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form process.&lt;/P&gt;&lt;P&gt;&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 = pfname&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 = 12&lt;/P&gt;&lt;P&gt;i_end_row = 65000&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;intern = itab&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;&lt;/P&gt;&lt;P&gt;IF sy-subrc 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&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;P&gt;describe table itab lines itab_count.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;row = 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if itab-row row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append gi_final.&lt;/P&gt;&lt;P&gt;clear gi_final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;case itab-col.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when '1'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR G_MATNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gi_final-OLD_MATNR = itab-value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONCATENATE 'NEW' gi_final-old_matnr INTO itab-value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gi_final-new_MATNR = itab-value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endcase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;row = itab-row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append gi_final.&lt;/P&gt;&lt;P&gt;clear gi_final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'PROGRESS_INDICATOR' &lt;/P&gt;&lt;P&gt;EXPORTING &lt;/P&gt;&lt;P&gt;I_TEXT = 'File Has Been Successfully Uploaded from Workstation ' . &lt;/P&gt;&lt;P&gt;if not gi_final[] is initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if not records-low is initial .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if not records-high is initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;records-high = records-high + 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DESCRIBE TABLE gi_final LINES count.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF records-high &amp;lt; count.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE gi_final FROM records-high TO count.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF records-low &amp;lt;&amp;gt; 1.&lt;/P&gt;&lt;P&gt;IF records-low 0.&lt;/P&gt;&lt;P&gt;DELETE gi_final FROM 1 TO records-low.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF NOT GI_FINAL[] IS INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'PROGRESS_INDICATOR'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;I_TEXT = 'Processing zmatnr table'&lt;/P&gt;&lt;P&gt;I_OUTPUT_IMMEDIATELY = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if itab_count count. &lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;message i000 with 'records are not matching'. &lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;exit. &lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;else. &lt;/P&gt;&lt;P&gt;modify zmatnr from table gi_final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;message i000 with 'data base table modified successfully'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif. &lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;*&amp;amp; Form search&lt;/P&gt;&lt;P&gt;&amp;amp;----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;text &lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--&amp;gt; p1 text &lt;/P&gt;&lt;P&gt;&amp;lt;-- p2 text &lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------------" /&gt;&lt;P&gt;FORM search .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'KD_GET_FILENAME_ON_F4'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;static = 'X'&lt;/P&gt;&lt;P&gt;CHANGING&lt;/P&gt;&lt;P&gt;file_name = pfname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM. " search&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;siva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jan 2008 03:35:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-excel-file-with-function-ws-upload-has-error/m-p/3256630#M777735</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-16T03:35:05Z</dc:date>
    </item>
    <item>
      <title>Re: upload excel file with function 'WS_UPLOAD' has error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-excel-file-with-function-ws-upload-has-error/m-p/3256631#M777736</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;   If you are looking to upload an Excel file (data existing in different columns of excel) GUI_UPLOAD will not work.&lt;/P&gt;&lt;P&gt;use FM :  ALSM_EXCEL_TO_INTERNAL_TABLE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are using CSV format excel file (this is basically comma seperated format), GUI_UPLOAD can be used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Decide the logic based on ur excel file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jan 2008 03:39:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-excel-file-with-function-ws-upload-has-error/m-p/3256631#M777736</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-16T03:39:15Z</dc:date>
    </item>
  </channel>
</rss>

