Skip to Content
0
Former Member
Jul 15, 2012 at 02:14 PM

Getting exception short text using FM name and sy-subrc value

249 Views

Dear All,

I am struck up with I guess a basic issue in exception handling.

Is there a simple way to obtain the exception short text(maintained in Table FUNCT) after a function module call.

I would prefer not to use any CASE statements after the FM call.

ex : If my FM call returns a sy-subrc 6, I would need to get the corresponding short text for the exception "No Payroll Result Found".

If I can just pass the function module name and the sy-subrc value to some FM,

could I possible get the exception text?

CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT'
EXPORTING
* CLUSTERID =
employeenumber = peras-pernr
sequencenumber = gs_rgdir-seqnr
read_only_international = 'X'
* CHECK_READ_AUTHORITY = 'X'
CHANGING
payroll_result = gt_result
EXCEPTIONS
illegal_isocode_or_clusterid = 1
error_generating_import = 2
import_mismatch_error = 3
subpool_dir_full = 4
no_read_authority = 5
no_record_found = 6
versions_do_not_match = 7
error_reading_archive = 8
error_reading_relid = 9
OTHERS = 10.

Thanks & Regards,

Rijuraj