<?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: Displaying Error while uploading Excel Sheets in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/displaying-error-while-uploading-excel-sheets/m-p/1371259#M182750</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;instead of FM &lt;/P&gt;&lt;P&gt;'KD_GET_FILENAME_ON_F4'&lt;/P&gt;&lt;P&gt;Use this code&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CALL FUNCTION 'F4_FILENAME'
      EXPORTING
        PROGRAM_NAME  = SYST-CPROG
        DYNPRO_NUMBER = SYST-DYNNR
        FIELD_NAME    = 'P_UNIX'
      IMPORTING
        FILE_NAME     = P_HEADER.

if p_header is initial 
message e000 with 'erroe file doesn't exist'.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 May 2006 12:12:11 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-05-11T12:12:11Z</dc:date>
    <item>
      <title>Displaying Error while uploading Excel Sheets</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/displaying-error-while-uploading-excel-sheets/m-p/1371256#M182747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we are uploading excel sheets into SAP Tables. While uploading we are specifying the location/path in the selection screen. Then we are displaying the message that 'All Files Loaded Successfully'. But if the files are not existing then also it is showing the same message. Plz help me in throwing the error message &amp;amp; screen shuld return to the selection screen again so that the user can enter the correct file.&lt;/P&gt;&lt;P&gt;I am enclosing the code for reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance,&lt;/P&gt;&lt;P&gt;nishu&lt;/P&gt;&lt;P&gt;********************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables: bseg, zfi_tbl_qty, t001, tgsb.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:&lt;/P&gt;&lt;P&gt;        t_excel like alsmex_tabline occurs 0 with header line,&lt;/P&gt;&lt;P&gt;        l_excelfile(128)  type c,&lt;/P&gt;&lt;P&gt;        l_excelfile1(128) type c,&lt;/P&gt;&lt;P&gt;        l_excelfile2(128) type c,&lt;/P&gt;&lt;P&gt;        l_excelfile3(128) type c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of t_bukrs_tmp occurs 0,&lt;/P&gt;&lt;P&gt;         bukrs like t001-bukrs,&lt;/P&gt;&lt;P&gt;      end of t_bukrs_tmp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of t_gsber_tmp occurs 0,&lt;/P&gt;&lt;P&gt;         gsber like tgsb-gsber,&lt;/P&gt;&lt;P&gt;      end of t_gsber_tmp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ranges: r_bukrs_tmp for t001-bukrs,&lt;/P&gt;&lt;P&gt;        r_gsber_tmp for tgsb-gsber.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of t_type,&lt;/P&gt;&lt;P&gt;       bukrs like bseg-bukrs,&lt;/P&gt;&lt;P&gt;       gsber like bseg-gsber,&lt;/P&gt;&lt;P&gt;       count type i,&lt;/P&gt;&lt;P&gt;     end of t_type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: l_charlen1 type i,&lt;/P&gt;&lt;P&gt;      l_charlen2 type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:  t_type2 like t_type occurs 0 with header line,&lt;/P&gt;&lt;P&gt;       t_type2_tmp like t_type occurs 0 with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:  l_end_row type i,&lt;/P&gt;&lt;P&gt;       l_endrow1 type i,&lt;/P&gt;&lt;P&gt;       l_count type i,&lt;/P&gt;&lt;P&gt;       v_bukrs like bseg-bukrs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : q_count type i value 1,&lt;/P&gt;&lt;P&gt;       v_flag  type i value 0,&lt;/P&gt;&lt;P&gt;       v_gsber like t_type2-gsber.&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 :  p_file1  type rlgrap-filename obligatory,&lt;/P&gt;&lt;P&gt;             p_file2  type rlgrap-filename obligatory,&lt;/P&gt;&lt;P&gt;             p_file3  type rlgrap-filename obligatory,&lt;/P&gt;&lt;P&gt;             p_file4  type rlgrap-filename obligatory.&lt;/P&gt;&lt;P&gt;selection-screen end of block b1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*clearing the contents of database table before uploading a new file everytime&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;delete from zfi_tbl_qty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*selection-screen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at selection-screen on value-request for p_file1.&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;      field_name = p_file1&lt;/P&gt;&lt;P&gt;    changing&lt;/P&gt;&lt;P&gt;      file_name  = p_file1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at selection-screen on value-request for p_file2.&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;      field_name = p_file2&lt;/P&gt;&lt;P&gt;    changing&lt;/P&gt;&lt;P&gt;      file_name  = p_file2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at selection-screen on value-request for p_file3.&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;      field_name = p_file3&lt;/P&gt;&lt;P&gt;    changing&lt;/P&gt;&lt;P&gt;      file_name  = p_file3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at selection-screen on value-request for p_file4.&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;      field_name = p_file4&lt;/P&gt;&lt;P&gt;    changing&lt;/P&gt;&lt;P&gt;      file_name  = p_file4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at selection-screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  l_excelfile  = p_file1.&lt;/P&gt;&lt;P&gt;  l_excelfile1 = p_file2.&lt;/P&gt;&lt;P&gt;  l_excelfile2 = p_file3.&lt;/P&gt;&lt;P&gt;  l_excelfile3 = p_file4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if l_excelfile = l_excelfile1 or l_excelfile = l_excelfile2 or l_excelfile = l_excelfile3&lt;/P&gt;&lt;P&gt;    or l_excelfile1 = l_excelfile2 or l_excelfile1 = l_excelfile3 or l_excelfile2 = l_excelfile3.&lt;/P&gt;&lt;P&gt;        message e010(zn) with 'Files with the same name found Please enter again. '.&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;start-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    select bukrs&lt;/P&gt;&lt;P&gt;           from t001&lt;/P&gt;&lt;P&gt;           into corresponding fields of table t_bukrs_tmp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    loop at t_bukrs_tmp.&lt;/P&gt;&lt;P&gt;       r_bukrs_tmp-sign = 'I'.&lt;/P&gt;&lt;P&gt;       r_bukrs_tmp-option = 'EQ'.&lt;/P&gt;&lt;P&gt;       r_bukrs_tmp-low = t_bukrs_tmp-bukrs.&lt;/P&gt;&lt;P&gt;       append r_bukrs_tmp.&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;    select gsber&lt;/P&gt;&lt;P&gt;           from tgsb&lt;/P&gt;&lt;P&gt;           into corresponding fields of table t_gsber_tmp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    loop at t_gsber_tmp.&lt;/P&gt;&lt;P&gt;       r_gsber_tmp-sign = 'I'.&lt;/P&gt;&lt;P&gt;       r_gsber_tmp-option = 'EQ'.&lt;/P&gt;&lt;P&gt;       r_gsber_tmp-low = t_gsber_tmp-gsber.&lt;/P&gt;&lt;P&gt;       append r_gsber_tmp.&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;/P&gt;&lt;P&gt;  perform upload_table using l_excelfile   5 2 6 4000.&lt;/P&gt;&lt;P&gt;  perform upload_table using l_excelfile1  5 2 6 4000.&lt;/P&gt;&lt;P&gt;  perform upload_table using l_excelfile2  5 2 6 4000.&lt;/P&gt;&lt;P&gt;  perform upload_table using l_excelfile3  5 2 6 4000.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  message i010(zn) with 'Files Uploaded Successfully.'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*****************Calling the subroutine &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form upload_table using filename&lt;/P&gt;&lt;P&gt;                       i_begin_col type i&lt;/P&gt;&lt;P&gt;                       i_begin_row type i&lt;/P&gt;&lt;P&gt;                       i_end_col type i&lt;/P&gt;&lt;P&gt;                       i_end_row type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  clear   : t_excel.&lt;/P&gt;&lt;P&gt;  refresh : t_excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  v_flag = v_flag + 1.&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             = 5&lt;/P&gt;&lt;P&gt;      i_begin_row             = 2&lt;/P&gt;&lt;P&gt;      i_end_col               = 6&lt;/P&gt;&lt;P&gt;      i_end_row               = 4000&lt;/P&gt;&lt;P&gt;    tables&lt;/P&gt;&lt;P&gt;      intern                  = t_excel&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;  case v_flag.&lt;/P&gt;&lt;P&gt;    when '1'.&lt;/P&gt;&lt;P&gt;      perform fill_int_tab.&lt;/P&gt;&lt;P&gt;    when '2'.&lt;/P&gt;&lt;P&gt;      perform fill_int_tab.&lt;/P&gt;&lt;P&gt;    when '3'.&lt;/P&gt;&lt;P&gt;      perform fill_int_tab.&lt;/P&gt;&lt;P&gt;    when '4'.&lt;/P&gt;&lt;P&gt;      perform fill_int_tab.&lt;/P&gt;&lt;P&gt;  endcase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    "upload_table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*uploading data from internal table into database table&lt;/P&gt;&lt;P&gt;&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  fill_int_tab&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 fill_int_tab .&lt;/P&gt;&lt;P&gt;  clear   : t_type2, q_count.&lt;/P&gt;&lt;P&gt;  refresh : t_type2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  describe table t_excel lines l_endrow1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  l_endrow1 = l_endrow1 / 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  do.&lt;/P&gt;&lt;P&gt;    loop at t_excel where row = q_count.&lt;/P&gt;&lt;P&gt;      if t_excel-col = 1.&lt;/P&gt;&lt;P&gt;        t_type2-gsber = t_excel-value.&lt;/P&gt;&lt;P&gt;      elseif t_excel-col = 2.&lt;/P&gt;&lt;P&gt;        t_type2-bukrs = t_excel-value.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    l_charlen1 = strlen( t_type2-bukrs ).&lt;/P&gt;&lt;P&gt;    l_charlen2 = strlen( t_type2-gsber ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if ( t_type2-bukrs &amp;lt;&amp;gt; ' ' and t_type2-gsber &amp;lt;&amp;gt; ' ' ).&lt;/P&gt;&lt;P&gt;      if ( l_charlen1 = 4 and l_charlen2 = 4 ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        append t_type2. clear t_type2.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;    q_count = q_count + 1.&lt;/P&gt;&lt;P&gt;    if q_count &amp;gt; l_endrow1.&lt;/P&gt;&lt;P&gt;      exit.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  enddo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;t_type2_tmp[] = t_type2[].&lt;/P&gt;&lt;P&gt;clear t_type2.&lt;/P&gt;&lt;P&gt;refresh t_type2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at t_type2_tmp where bukrs in r_bukrs_tmp&lt;/P&gt;&lt;P&gt;                  and gsber in r_gsber_tmp.&lt;/P&gt;&lt;P&gt;  move-corresponding t_type2_tmp to t_type2.&lt;/P&gt;&lt;P&gt;  append t_type2.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  sort t_type2 by bukrs gsber.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  loop at t_type2.&lt;/P&gt;&lt;P&gt;    clear v_gsber.&lt;/P&gt;&lt;P&gt;    l_count = l_count + 1 .&lt;/P&gt;&lt;P&gt;    v_gsber = t_type2-gsber.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    at end of gsber.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        zfi_tbl_qty-company_code = t_type2-bukrs.&lt;/P&gt;&lt;P&gt;        zfi_tbl_qty-barea = v_gsber.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        zfi_tbl_qty-comb = l_count.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        if v_flag = 1.&lt;/P&gt;&lt;P&gt;          zfi_tbl_qty-type = 'A'.    " Item 1&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        if v_flag = 2.&lt;/P&gt;&lt;P&gt;          zfi_tbl_qty-type = 'B'.    "  Item 2&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        if v_flag = 3.&lt;/P&gt;&lt;P&gt;          zfi_tbl_qty-type = 'C'.     " Item 3&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        if v_flag = 4.&lt;/P&gt;&lt;P&gt;          zfi_tbl_qty-type = 'D'.     " Item 4&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     insert  zfi_tbl_qty from zfi_tbl_qty.&lt;/P&gt;&lt;P&gt;      clear l_count.&lt;/P&gt;&lt;P&gt;     endat.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    " fill_int_tab&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 May 2006 12:02:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/displaying-error-while-uploading-excel-sheets/m-p/1371256#M182747</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-11T12:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying Error while uploading Excel Sheets</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/displaying-error-while-uploading-excel-sheets/m-p/1371257#M182748</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hope this is what u are looking for... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the other case if the files are not existing on the system then automatically a message is displayed that &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'GUI_UPLOAD'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      FILENAME                = V_FILE&lt;/P&gt;&lt;P&gt;      FILETYPE                = 'ASC'&lt;/P&gt;&lt;P&gt;      HAS_FIELD_SEPARATOR     = 'X'&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      DATA_TAB                = IT_SALES&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      FILE_OPEN_ERROR         = 1&lt;/P&gt;&lt;P&gt;      FILE_READ_ERROR         = 2&lt;/P&gt;&lt;P&gt;      NO_BATCH                = 3&lt;/P&gt;&lt;P&gt;      GUI_REFUSE_FILETRANSFER = 4&lt;/P&gt;&lt;P&gt;      INVALID_TYPE            = 5&lt;/P&gt;&lt;P&gt;      NO_AUTHORITY            = 6&lt;/P&gt;&lt;P&gt;      UNKNOWN_ERROR           = 7&lt;/P&gt;&lt;P&gt;      BAD_DATA_FORMAT         = 8&lt;/P&gt;&lt;P&gt;      HEADER_NOT_ALLOWED      = 9&lt;/P&gt;&lt;P&gt;      SEPARATOR_NOT_ALLOWED   = 10&lt;/P&gt;&lt;P&gt;      HEADER_TOO_LONG         = 11&lt;/P&gt;&lt;P&gt;      UNKNOWN_DP_ERROR        = 12&lt;/P&gt;&lt;P&gt;      ACCESS_DENIED           = 13&lt;/P&gt;&lt;P&gt;      DP_OUT_OF_MEMORY        = 14&lt;/P&gt;&lt;P&gt;      DISK_FULL               = 15&lt;/P&gt;&lt;P&gt;      DP_TIMEOUT              = 16&lt;/P&gt;&lt;P&gt;      OTHERS                  = 17.&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;use &amp;lt;b&amp;gt;format_message&amp;lt;/b&amp;gt; function module to get errors if there are any while uploading the records in excel sheet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 May 2006 12:05:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/displaying-error-while-uploading-excel-sheets/m-p/1371257#M182748</guid>
      <dc:creator>rahulkavuri</dc:creator>
      <dc:date>2006-05-11T12:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying Error while uploading Excel Sheets</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/displaying-error-while-uploading-excel-sheets/m-p/1371258#M182749</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nishu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After using the perform statements, check the no. of records in the tables using sy-dbcnt. if it matches the no. of records loaded from excel sheet , give success message ,in the else part u can give the failure message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps. Award points if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;keerthi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 May 2006 12:11:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/displaying-error-while-uploading-excel-sheets/m-p/1371258#M182749</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-11T12:11:55Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying Error while uploading Excel Sheets</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/displaying-error-while-uploading-excel-sheets/m-p/1371259#M182750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;instead of FM &lt;/P&gt;&lt;P&gt;'KD_GET_FILENAME_ON_F4'&lt;/P&gt;&lt;P&gt;Use this code&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CALL FUNCTION 'F4_FILENAME'
      EXPORTING
        PROGRAM_NAME  = SYST-CPROG
        DYNPRO_NUMBER = SYST-DYNNR
        FIELD_NAME    = 'P_UNIX'
      IMPORTING
        FILE_NAME     = P_HEADER.

if p_header is initial 
message e000 with 'erroe file doesn't exist'.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 May 2006 12:12:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/displaying-error-while-uploading-excel-sheets/m-p/1371259#M182750</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-11T12:12:11Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying Error while uploading Excel Sheets</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/displaying-error-while-uploading-excel-sheets/m-p/1371260#M182751</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi nishu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use FM F4_filename for getting the file name and dont forget to set the filter to *.xls. it will solve your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sumit Bhutani&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ps reward points if helpful&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 May 2006 12:18:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/displaying-error-while-uploading-excel-sheets/m-p/1371260#M182751</guid>
      <dc:creator>sbhutani1</dc:creator>
      <dc:date>2006-05-11T12:18:43Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying Error while uploading Excel Sheets</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/displaying-error-while-uploading-excel-sheets/m-p/1371261#M182752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;After calling the Fn.module 'ALSM_EXCEL_TO_INTERNAL_TABLE'&lt;/P&gt;&lt;P&gt;Check if sy-subrc = '2'.&lt;/P&gt;&lt;P&gt;    Message  'File not Found Message'.&lt;/P&gt;&lt;P&gt;     endif.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kalyan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 May 2006 12:25:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/displaying-error-while-uploading-excel-sheets/m-p/1371261#M182752</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-11T12:25:20Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying Error while uploading Excel Sheets</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/displaying-error-while-uploading-excel-sheets/m-p/1371262#M182753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt; as you are updating from 4 different files, it would be good to inform the user each file upload status. &lt;/P&gt;&lt;P&gt;i mean success or failure in uploading the each file status.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for that instead of using MESSAGE for all the files one time, its better to use WRITE statement to display the message to the user.&lt;/P&gt;&lt;P&gt;here i noticed few places where error can occur&lt;/P&gt;&lt;P&gt; 1) uploading the excel data into your internal table.&lt;/P&gt;&lt;P&gt;    after the function module call,&lt;/P&gt;&lt;P&gt;    if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;     based on the V_FLAG , we know which file this error happened. accordingly display the error message&lt;/P&gt;&lt;P&gt;   like &lt;/P&gt;&lt;P&gt;   if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;     WRITE : 'Error occurred in Uploading the data from the file'.&lt;/P&gt;&lt;P&gt;     if v_Flag = 1.&lt;/P&gt;&lt;P&gt;       write &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; l_excelfile. "here give some color to notice error occurred&lt;/P&gt;&lt;P&gt;     elseif v_flag = 2.&lt;/P&gt;&lt;P&gt;       write &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; l_excelfile1.&lt;/P&gt;&lt;P&gt;     and so on..&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;this way we can display the user what happened to each file if upload is went wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) insert..&lt;/P&gt;&lt;P&gt;     if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    again by using V_FLAG display the error/success message to the user for each file insert.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;one more change you have to do in the program is :&lt;/P&gt;&lt;P&gt;at selection-screen on value-request for p_file1.&lt;/P&gt;&lt;P&gt;   in this event you are calling the function module for F4 help 4 times. instead you can write a FORM &amp;amp; call that form in all these 4 events.&lt;/P&gt;&lt;P&gt;as below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at selection-screen on value-request for p_file1.&lt;/P&gt;&lt;P&gt;  perform provide_f4_help chaning p_file1.  &lt;/P&gt;&lt;P&gt;at selection-screen on value-request for p_file2.&lt;/P&gt;&lt;P&gt;  perform provide_f4_help chaning p_file2.&lt;/P&gt;&lt;P&gt;at selection-screen on value-request for p_file3.&lt;/P&gt;&lt;P&gt;  perform provide_f4_help chaning p_file3.&lt;/P&gt;&lt;P&gt;at selection-screen on value-request for p_file4.&lt;/P&gt;&lt;P&gt;  perform provide_f4_help chaning p_file4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form provide_f4_help changing p_filename.&lt;/P&gt;&lt;P&gt;*--here call that F4 help function module.&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Srikanth&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Srikanth Kidambi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 May 2006 12:25:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/displaying-error-while-uploading-excel-sheets/m-p/1371262#M182753</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-11T12:25:30Z</dc:date>
    </item>
  </channel>
</rss>

