<?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: GUI_UPLOAD Exception in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/gui-upload-exception/m-p/2986387#M705201</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All corresponding error code will be stored in SY-SUBRC in following exceptions..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;either you can use IF statement or CASE structure to display appropriate message to user...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
* EXCEPTIONS
*   FILE_OPEN_ERROR               = 1
*   FILE_READ_ERROR               = 2
*   NO_BATCH                      = 3
*   GUI_REFUSE_FILETRANSFER       = 4
*   INVALID_TYPE                  = 5
*   NO_AUTHORITY                  = 6
*   UNKNOWN_ERROR                 = 7
*   BAD_DATA_FORMAT               = 8
*   HEADER_NOT_ALLOWED            = 9
*   SEPARATOR_NOT_ALLOWED         = 10
*   HEADER_TOO_LONG               = 11
*   UNKNOWN_DP_ERROR              = 12
*   ACCESS_DENIED                 = 13
*   DP_OUT_OF_MEMORY              = 14
*   DISK_FULL                     = 15
*   DP_TIMEOUT                    = 16
*   OTHERS                        = 17

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Nov 2007 09:09:57 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-11-09T09:09:57Z</dc:date>
    <item>
      <title>GUI_UPLOAD Exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/gui-upload-exception/m-p/2986384#M705198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  I'm using the GUI_UPLOAD function to read a file and found that there are lot of exception defined in this FM.  How can catch it and display a proper error to user?? Is it possible to handle it without specifically define which exception hit??&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;  Pls give me some reference code.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Nov 2007 08:33:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/gui-upload-exception/m-p/2986384#M705198</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-09T08:33:02Z</dc:date>
    </item>
    <item>
      <title>Re: GUI_UPLOAD Exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/gui-upload-exception/m-p/2986385#M705199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI &lt;/P&gt;&lt;P&gt;if you want to catch it then try this coding &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TRY/CATCH it's not applicable in case of Function Module, to use TRY you need class-based exceptions.&lt;/P&gt;&lt;P&gt;Use only CATCH:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CATCH.&lt;/P&gt;&lt;P&gt; CALL FUNCTION "Function_1".&lt;/P&gt;&lt;P&gt;   IF sy-subrc NE 0.&lt;/P&gt;&lt;P&gt;    do_something.&lt;/P&gt;&lt;P&gt;   ENDIF.&lt;/P&gt;&lt;P&gt;ENDCATCH.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, you can add the "EXCEPTIONS" statement to the first CALL FUNCTION, catching a particular value of sy-subrc, like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXCEPTIONS others = 20.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, check subrc:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CATCH.&lt;/P&gt;&lt;P&gt; CALL FUNCTION "Function_1"&lt;/P&gt;&lt;P&gt;   EXCEPTIONS others = 20.&lt;/P&gt;&lt;P&gt;   IF sy-subrc = 20.&lt;/P&gt;&lt;P&gt;     do_something.&lt;/P&gt;&lt;P&gt;   ENDIF.&lt;/P&gt;&lt;P&gt;ENDCATCH.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Rewar if usefull&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Nov 2007 08:38:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/gui-upload-exception/m-p/2986385#M705199</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-09T08:38:49Z</dc:date>
    </item>
    <item>
      <title>Re: GUI_UPLOAD Exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/gui-upload-exception/m-p/2986386#M705200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kit,&lt;/P&gt;&lt;P&gt;At the end of the FM try using case statements to catch the SY-SUBRC value. If you want to specific processing then you can do so by defining a soubroutine. If you want to display only an error message you can go ahead with 'WRITE' Statement or 'Message' Statement. &lt;/P&gt;&lt;P&gt;Take a look at the code below:&lt;/P&gt;&lt;P&gt;CASE sy-subrc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  WHEN '1'.&lt;/P&gt;&lt;P&gt;    WRITE : 'error opening file'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  WHEN '2'.&lt;/P&gt;&lt;P&gt;    WRITE : 'file read error'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  WHEN '3'.&lt;/P&gt;&lt;P&gt;    PERFORM displayerrormessage.&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;Hope this is of help to you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;pavithra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Nov 2007 09:07:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/gui-upload-exception/m-p/2986386#M705200</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-09T09:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: GUI_UPLOAD Exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/gui-upload-exception/m-p/2986387#M705201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All corresponding error code will be stored in SY-SUBRC in following exceptions..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;either you can use IF statement or CASE structure to display appropriate message to user...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
* EXCEPTIONS
*   FILE_OPEN_ERROR               = 1
*   FILE_READ_ERROR               = 2
*   NO_BATCH                      = 3
*   GUI_REFUSE_FILETRANSFER       = 4
*   INVALID_TYPE                  = 5
*   NO_AUTHORITY                  = 6
*   UNKNOWN_ERROR                 = 7
*   BAD_DATA_FORMAT               = 8
*   HEADER_NOT_ALLOWED            = 9
*   SEPARATOR_NOT_ALLOWED         = 10
*   HEADER_TOO_LONG               = 11
*   UNKNOWN_DP_ERROR              = 12
*   ACCESS_DENIED                 = 13
*   DP_OUT_OF_MEMORY              = 14
*   DISK_FULL                     = 15
*   DP_TIMEOUT                    = 16
*   OTHERS                        = 17

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Nov 2007 09:09:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/gui-upload-exception/m-p/2986387#M705201</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-09T09:09:57Z</dc:date>
    </item>
  </channel>
</rss>

