Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Handling of messages for FM GUI_UPLOAD

Former Member
0 Kudos

Hi All..

1) Iam using the FM GUI_UPLOAD for uploading a tab delimited file from the desktop/presentation server.

if the FM returns sy-subrc<> 0, i wanted to display the relevant error message. I would appreciate if any one could help me on how to handle these error messages display for different types of errors.

2) Also i got all the required records into an internal table itab and using a modify command to update the records to database table.

Modify dbtab from table itab.

If for some reason any errors occured in modify statement, please let me know how to handle those errors.

Thanks and will reward helpful answers.

1 REPLY 1

Former Member
0 Kudos

Hi,

Use the EXCEPTIONS when calling the function module


CALL FUNCTION 'GUI_UPLOAD'
  EXPORTING
    filename                      =
  tables
    data_tab                      =
 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
          .
   IF SY-SUBRC <> 0.
     MESSAGE E208(00) WITH 'Error in uploading file'.
   ENDIF.
  

For modify use the sy-subrc for errors..


MODIFY dbtab FROM TABLE itab.

IF SY-SUBRC <> 0.
  MESSAGE E208(00) WITH 'Error in modifying the table'.
ENDIF.

COMMIT WORK.  " Update the changes

Thanks

Naren