cancel
Showing results for 
Search instead for 
Did you mean: 

Simple Alerts question

Former Member
0 Kudos

Hello gurus,

I have a question about alert mechanism in PI. I have sender & receiver SAP systems using proxies. Can I throw any alerts on PI server when an error happens in these proxy systems? Or do I need to define seperate alerts in those systems and make the settings seperately there?

If central alerting is possible and those systems will raise the alert and throw it there, how can I set it?

Thanks,

Gökhan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Well, it is bad new then. What is the use of the "central monitoring" features of PI if I cannot see what's happening even in other SAP systems? Yes, I know I can monitor the messages, but as long as I can't define alerts, that doesn't help much.

How do you monitor your sender/receiver systems then? How do you get notified when a message fails at those systems?

Former Member
0 Kudos

Gökhan,

There is one simple way to do this. If you want to send an alert message in PI in case of error on Sender / receiver R/3 system.

Alert system indirectly using function module "SALERT_CREATE_API" or "SALERT_CREATE_LOCAL" to raise an alert. You can call this function module using RFC destination pointing towards your XI system in sender / receiver system in proxy code. This way you can capture errors.

You do not need to create separate alert category. You can used same alert category and rules.

Let me know if you need more details.

Thanks & Rgds,

Nilesh

Former Member
0 Kudos

Thank you Nilesh for the useful information. I'm not an ABAP'er and I would really appreciate it if you could write some sample code to call that alerts API if it is possible.

Regards,

Gökhan

Former Member
0 Kudos

Follow the below steps for alert configuration:-

By Michal Krawczyk

/people/michal.krawczyk2/blog/2005/09/09/xi-alerts--step-by-step

Triggering by Calling a Function Module Directly.

/people/bhavesh.kantilal/blog/2006/07/25/triggering-xi-alerts-from-a-user-defined-function

chirag

Former Member
0 Kudos

Hi,

Check out this RFC wrapper function module...which you can call in proxy for validations/ errors.

FUNCTION z_fi_raise_alert.

*"----


""Local Interface:

*" IMPORTING

*" VALUE(I_INTERFACE_ID) TYPE STRING

*" VALUE(I_ERROR) TYPE STRING

*" VALUE(I_ALERTCAT) TYPE STRING

*"----


----


  • Work area declaration

----


DATA : gwa_container TYPE swcont,

gwa_latest_file TYPE ztab_latest_file.

----


  • Internal Table Declaration

----


DATA : gi_container TYPE STANDARD TABLE OF swcont.

----


  • Global Variable declaration

----


DATA : gv_latest_filename TYPE char100,

gv_alertcategory TYPE salrtdcat,

gv_tab_index TYPE swc_index VALUE '000000',

gv_error TYPE char100,

gv_interface_id TYPE char50.

----


  • Constants declaration

----


CONSTANTS : gc_interfaceid TYPE swc_elem VALUE 'INTERFACE_ID',

gc_fieldnames TYPE swc_elem VALUE 'FIELD_NAMES',

gc_filename TYPE swc_elem VALUE 'FILE_NAME',

gc_interfaceid_len TYPE swc_length VALUE '50',

gc_fieldnames_len TYPE swc_length VALUE '255',

gc_filename_len TYPE swc_length VALUE '100',

gc_type TYPE swc_type VALUE 'C',

gc_file_duplicate TYPE string VALUE 'FILE_DUPLICATE_ALERT'.

gv_error = i_error.

gv_alertcategory = i_alertcat.

gv_interface_id = i_interface_id.

IF gv_alertcategory EQ gc_file_duplicate.

SELECT SINGLE latest_filename

FROM ztab_latest_file

INTO gv_latest_filename

WHERE interface_id EQ gv_interface_id

AND latest_filename EQ gv_error.

  • If filename is present in Table ZTAB_LATEST_FILE then file has been read already.

  • Raise alert for Duplicate file is read.

IF sy-subrc EQ 0.

  • Create global_container variable for Interface Id

gwa_container-element = gc_interfaceid.

gwa_container-tab_index = gv_tab_index.

gwa_container-elemlength = gc_interfaceid_len.

gwa_container-type = gc_type.

gwa_container-value = gv_interface_id.

APPEND gwa_container TO gi_container.

CLEAR : gwa_container.

  • gv_tab_index = gv_tab_index + 1.

  • Create global_container variable for File Name

gwa_container-element = gc_filename.

gwa_container-tab_index = gv_tab_index.

gwa_container-elemlength = gc_filename_len.

gwa_container-type = gc_type.

gwa_container-value = gv_error.

APPEND gwa_container TO gi_container.

ELSE.

  • Update Table with the latest read filename.

gwa_latest_file-interface_id = gv_interface_id.

gwa_latest_file-latest_filename = gv_error.

MODIFY ztab_latest_file FROM gwa_latest_file.

ENDIF.

ELSE.

  • Raise alert for mandatory field validation

  • Create global_container variable for Interface Id

gwa_container-element = gc_interfaceid.

gwa_container-tab_index = gv_tab_index.

gwa_container-elemlength = gc_interfaceid_len.

gwa_container-type = gc_type.

gwa_container-value = gv_interface_id.

APPEND gwa_container TO gi_container.

CLEAR : gwa_container.

  • gv_tab_index = gv_tab_index + 1.

  • Create global_container variable for Field Names

gwa_container-element = gc_fieldnames.

gwa_container-tab_index = gv_tab_index.

gwa_container-elemlength = gc_fieldnames_len.

gwa_container-type = gc_type.

gwa_container-value = gv_error.

APPEND gwa_container TO gi_container.

ENDIF.

  • Raise Alert with the error description

IF NOT gi_container[] IS INITIAL.

CALL FUNCTION 'SALERT_CREATE'

EXPORTING

ip_cat = gv_alertcategory

TABLES

it_container = gi_container

EXCEPTIONS

alert_category_unknown = 1

alert_no_recipients = 2

alert_error_unknown = 3

OTHERS = 4.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

REFRESH : gi_container.

CLEAR : gwa_container.

ENDIF.

ENDFUNCTION.

Hope this will help.

Nilesh

Former Member
0 Kudos

Thank you everybody, especially Nilesh for your inputs. I really appreciate it.

Kind regards,

Gökhan

Answers (3)

Answers (3)

former_member206760
Active Contributor
0 Kudos

dear gokhan,

if you are using a sender / receiver abap proxy.

and if it fails then you can use a standard function module that would send e-mails to any person mentioned in that proxy.

u can easily find any std Fm that sends e-mails

i think this would help

Former Member
0 Kudos

I have sender & receiver SAP systems using proxies. Can I throw any alerts on PI server when an error happens in these proxy systems?

It depends, if your application system is the system where server proxy (based on inbound message interface) is created, you can have your ABAP program to call exception class in the application system, to send application error to local integration engine,the alert can be triggered.

I need to define seperate alerts in those systems and make the settings seperately there?

In above case, you do not need to, you just define your alert in your PI system.

Regards.

Liang

Former Member
0 Kudos

Hi,

Can I throw any alerts on PI server when an error happens in these proxy systems? - No it is not possible.......in PI you will get alerts of errors occuring on PI system and not on other systems....

Or do I need to define seperate alerts in those systems and make the settings seperately there? - You can define alert categories in your other SAP systems but in order to call those alerts, you will have to code it in your ABAP proxy.

Regards,

Rajeev Gupta