10-30-2009 3:42 AM
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
10-30-2009 4:00 AM
First message is getting overlapped with the second message.
Try to combine the two messages into one.
10-30-2009 4:05 AM
Hi Harsh,
Thanks for replying. But I can not concatenate the two messages. Both the messages are to be displayed individually.
10-30-2009 5:27 AM
10-30-2009 5:34 AM
Hi,
As you need to display multiple messages, declare a table parameters of type BAPIRET2 and append the messages to this table parameter.
Regards,
Swarna Munukoti.
10-30-2009 9:38 AM
Hi,
Thanks for the reply.
But how can I pass the place holders to Bapiret2 structure
10-30-2009 9:48 AM
Hi,
Use this function Module:
CALL FUNCTION 'BALW_BAPIRETURN_GET2'
EXPORTING
TYPE = <Message Type - E or S>
CL = <Mesage Class>
NUMBER = <Message Number>
PAR1 = <variable1>
PAR2 = <variable2>
PAR3 = <variable3>
PAR4 = <variable4>
IMPORTING
RETURN = return_msg
.
return_msg is of type BAPIRET2
Regards,
Swarna Munukoti
10-30-2009 5:32 AM
Hi,
Change the first message type from S to I.
IF sy-subrc 0.
message i010(zmm) with c_zero c_zero c_zero.
message e001(zmm) display like 'A'.
ENDIF.
Regards,
Ginu
10-30-2009 9:51 AM
check this sample code
here gt_return is of type bapiret2_t
MOVE <fs_bank_details>-bankkey TO gv_msg_par1.
MOVE <fs_bank_details>-bankname TO gv_msg_par2.
PERFORM fm_format_message USING gc_msgno083
gc_e.
FORM fm_format_message USING pv_msgno TYPE sy-msgno
pv_type TYPE bapi_mtype.
DATA:ls_return TYPE bapiret2.
CLEAR: ls_return.
CALL FUNCTION 'BALW_BAPIRETURN_GET2'
EXPORTING
type = pv_type "Message type
cl = gc_bp "Message class
number = pv_msgno "Message No
par1 = gv_msg_par1 "value for place holder1
par2 = gv_msg_par2 "value for place holder2
IMPORTING
return = ls_return.
IF ls_return IS NOT INITIAL.
APPEND ls_return TO gt_return.
ENDIF.
ENDFORM. " FM_FORMAT_MESSAGE