Skip to Content
0
Former Member
Oct 25, 2006 at 10:56 AM

Trap FM Exception Error MEssage

19 Views

Can anyone tell me how I can trap an error message

which is triggered in a fm I am calling.

e.g.

CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'

EXPORTING

SRC_SPOOLID = spoolno

NO_DIALOG = ' '

  • DST_DEVICE =

  • PDF_DESTINATION =

IMPORTING

PDF_BYTECOUNT = numbytes

PDF_SPOOLID = pdfspoolid

  • LIST_PAGECOUNT =

BTC_JOBNAME = jobname

BTC_JOBCOUNT = jobcount

TABLES

PDF = pdf

EXCEPTIONS

ERR_NO_ABAP_SPOOLJOB = 1

ERR_NO_SPOOLJOB = 2

ERR_NO_PERMISSION = 3

ERR_CONV_NOT_POSSIBLE = 4

ERR_BAD_DESTDEVICE = 5

USER_CANCELLED = 6

ERR_SPOOLERROR = 7

ERR_TEMSEERROR = 8

ERR_BTCJOB_OPEN_FAILED = 9

ERR_BTCJOB_SUBMIT_FAILED = 10

ERR_BTCJOB_CLOSE_FAILED = 11.

case sy-subrc.

when 0.

WRITE: / 'Error 0'(006) COLOR COL_POSITIVE.

when 1.

WRITE: / 'Error 1'(002) COLOR COL_negative.

when 2.

WRITE: / 'Error 2'(003) COLOR COL_negative.

The error is occuring in the actual FM itself. My program

does not reach the case sy-subrc statement above. Can

this be forced in anyway???

Cheers