0% found this document useful (0 votes)
65 views2 pages

Avoiding Dumps in A Program

This document discusses avoiding dumps in a program by converting exceptions into error messages. It provides an example program that calls a function module, receives results, and uses the return code to set an error message variable. The error message variable is then displayed instead of producing a dump.

Uploaded by

Md Saif
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
65 views2 pages

Avoiding Dumps in A Program

This document discusses avoiding dumps in a program by converting exceptions into error messages. It provides an example program that calls a function module, receives results, and uses the return code to set an error message variable. The error message variable is then displayed instead of producing a dump.

Uploaded by

Md Saif
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Avoiding dumps in a program

Skip to end of metadata

Added by Venkateswararao Appikonda, last edited by Venkateswararao Appikonda on Nov 13, 2008 (view
change)

show comment
Go to start of metadata
Generally if any exception occurred it will go to dump immediately in a program,
then we will process this through the tcode ST22(dump analysis). Here I am trying to convert this dump into an
error message or some text statement.
For this you need to call this statement...
RECEIVE RESULTS FROM FUNCTION 'function module'
Check this example program....
REPORT ztests.
PARAMETERS: p_file LIKE rlgrap-filename .
DATA: v_file TYPE string.
DATA: BEGIN OF itab OCCURS 0,
name(23) TYPE c,
END OF itab.
DATA: errormessage TYPE char50.
v_file = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename
= v_file
filetype
= 'ASC'
has_field_separator = ' '
TABLES
data_tab
= itab.
RECEIVE RESULTS FROM FUNCTION 'GUI_UPLOAD'
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 .
.

CASE sy-subrc.
WHEN 0.
errormessage = 'Data Loaded'.
WHEN 1.
errormessage = 'FILE_OPEN_ERROR'.
WHEN 2.
errormessage = 'FILE_READ_ERROR'.
WHEN 3.
errormessage = 'NO_BATCH'.
WHEN 4.
errormessage = 'GUI_REFUSE_FILETRANSFER'.
WHEN 5.
errormessage = 'INVALID_TYPE'.
WHEN 6.
errormessage = 'NO_AUTHORITY'.
WHEN 7.
errormessage = 'UNKNOWN_ERROR'.
WHEN 8.
errormessage = 'BAD_DATA_FORMAT'.
WHEN 9.
errormessage = 'HEADER_NOT_ALLOWED'.
WHEN 10.
errormessage = 'SEPARATOR_NOT_ALLOWED'.
WHEN 11.
errormessage = 'HEADER_TOO_LONG'.
WHEN 12.
errormessage = 'UNKNOWN_DP_ERROR'.
WHEN 13.
errormessage = 'ACCESS_DENIED'.
WHEN 14.
errormessage = 'DP_OUT_OF_MEMORY'.
WHEN 15.
errormessage = 'DISK_FULL'.
WHEN 16.
errormessage = 'DP_TIMEOUT'.
WHEN 17.
errormessage = 'OTHERS'.
ENDCASE.
MESSAGE e000(00) WITH errormessage .
With this in the report program we will get an error message instead of a dump

You might also like