cancel
Showing results for 
Search instead for 
Did you mean: 

CX_AI_SYSTEM_FAULT

Former Member
0 Kudos

Hi,

There is an interface between SRM BOX and legacy system thoriugh XI.

I had a scenario that if the XI Box is Down,i must trgger an email. So iam catching the exception in the class CX_AI_SYSTEM_FAULT and iam triggering an email.

But the mail is not getting triggered,here iam psting my code.

Constants: c_dflt3(30) TYPE c

VALUE 'XYZ',

c_dflt4(40) TYPE c

VALUE 'XYZ'.

data: l_lines type i,

lx_ai_system_fault TYPE REF TO cx_ai_system_fault,

objpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,

l_order type bbpx_order-body-order_header-order_id.

clear: ls_message, objpack, l_order.

refresh objpack.

move lsx_order-body-order_header-order_id to l_order.

IF v_synch = 'X'.

TRY.

CALL METHOD zpoco_order_sync_out=>execute_synchronous

EXPORTING

output = lsx_order

IMPORTING

input = l_input.

CATCH cx_ai_system_fault INTO lx_ai_system_fault.

ls_message = lx_ai_system_fault->if_message~get_text( ).

  • IF not ls_message is initial.

*Body of Mail.

objtxt = 'No Connection between SRM and XI,'.

concatenate objtxt 'PO :' l_order 'Failed due to Connection'

into objtxt separated by Space.

append objtxt.

clear objtxt.

*Subject for email.

l_lines = LINES( OBJTXT ).

doc_chng-obj_descr = 'P1X is Down'.

doc_chng-sensitivty = 'F'.

objpack-head_start = 1.

objpack-head_num = 0.

objpack-body_start = 1.

objpack-head_num = l_lines.

objpack-doc_type = 'RAW'.

Append objpack.

  • Mail List

reclist-receiver = c_dflt3.

reclist-rec_type = c_internet.

APPEND reclist.

reclist-receiver = c_dflt4.

reclist-rec_type = c_internet.

APPEND reclist.

doc_chng-obj_descr = 'P1X Box is Down -


Please Check'.

CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'

EXPORTING

document_data = doc_chng

DOCUMENT_TYPE = 'RAW'

PUT_IN_OUTBOX = ' '

tables

OBJECT_CONTENT = objtxt

receivers = reclist

EXCEPTIONS

TOO_MANY_RECEIVERS = 1

DOCUMENT_NOT_SENT = 2

DOCUMENT_TYPE_NOT_EXIST = 3

OPERATION_NO_AUTHORIZATION = 4

PARAMETER_ERROR = 5

X_ERROR = 6

ENQUEUE_ERROR = 7

OTHERS = 8

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

  • ENDIF.

ENDTRY.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks for your reply

Former Member
0 Kudos

hi

ensure that the email(SCOT) configurations are done properly.

refer these for sample code

rgds

Arun