Skip to Content
0
Former Member
Oct 30, 2009 at 03:42 AM

Handling 2 messages in a function module

82 Views

Hi ,

I have a requirement where I need to trigger 2 messages if sy-subrc fails in a Function Module.

-


Function module GET_JOB_RUNTIME_INFO

IMPORTING

JOB名(JOBNAME)= P_WK_JOBNM

Error(SY-SUBRC <> 0)

Result message output

(EN) Total : &1, Success : &2, Error : &3

Type: u2019Su2019

&1:u20190u2019 &2:u20190u2019 &3:u20190u2019

Perform error handling(->Error Handling:030)

-


Error Handling 30: Error Handling as ABEND

Show message (message type u2018Eu2019)

(EN)Error was found in function module. Function module: &1 Returned value: &2 &3

&1:'GET_JOB_RUNTIME_INFO'

&2: Exception No

I have written the code in the following way.

CALL FUNCTION 'GET_JOB_RUNTIME_INFO'

IMPORTING

  • EVENTID =

  • EVENTPARM =

  • EXTERNAL_PROGRAM_ACTIVE =

  • JOBCOUNT =

JOBNAME = l_job_name

  • STEPCOUNT =

EXCEPTIONS

NO_RUNTIME_INFO = 1

OTHERS = 2

.

IF sy-subrc <> 0.

message s010(zmm) with c_zero c_zero c_zero.

message e001(zmm) display like 'A'.

ENDIF.

But the above code is not working fine. Only the second message ie [message e001(zmm) display like 'A' ] is being displayed.

In debugging mode the cursor is passing to the first message but still it is not being displayed.

Can any one help me in solving this problem

Thanks in advance,

Indira