cancel
Showing results for 
Search instead for 
Did you mean: 

Counting Entries in SXMSPMAST via UDF

Former Member
0 Kudos

Hi All,

The requirement is to count number of messages passed in a day through PI and trigger an email.

Idea is to count number of message entries for a day(based on time perioed) in table SXMSPMAST.

How can we count the number of entries in this table using UDF??

Idea is to create File to Email interface.

Trigger FIle adapter at certain interval daily and in message mapping using an UDF count number of messages in in this table and pass it onto target interface which will trigger email...

Any inputs on this UDF please.

Thank you.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Chaitainya,

It would be advisable to send the emaiil from ABAP Stack only, If anyhow you to send it through XI using UDF, then in that case you have to use RFC lookup, for that first create RFC FM in XI ABAP stack and then from XI create a RFC channel and call this FM to fetch the records, Furhter as per your requirement you can mail it using mail adapter.

Former Member
0 Kudos

Hi,

In order to achieve this either need to generate the ABAP mapping and use it in Operation/Interface mapping

or generate RFC and do a lokkup of the same using message mapping or udf....

but the necessity here is to generate either ABAP Report mapping or RFC FM for the same...

as the data /table resides in ABAP u cannot go for UDF directly...

HTH

Rajesh

Former Member
0 Kudos

Hi,

Why do you want to do this in a XI/PI scenario ? Is that for monitoring purpose ? If so, why not coding it directly in XI/PI ? You can easily access SXMS* tables, create (plain or even nice HTML) emails from the ABAP stack ...

Rgds

Chris

Edited by: Christophe PFERTZEL on Nov 10, 2009 12:18 PM

Former Member
0 Kudos

Hi Chris,

Yes,this is for monitoring purpose only...

can you please elaborate your idea plz.

if this requirement can be achieved without an interface also fine.

Please elaborate.

Thank you.

Former Member
0 Kudos

Depending on your ABAP coding level, this could be "easy" to do ... I think the most difficult task is the email creation, but SAP has a couple of classes that are easy to use for such purpose. So, your ABAP proggy could be a very simple one :

1 - SELECT count(*) from SXMSPMAST WHERE (condition)

2 - get this count value and use it to build the email body

3 - send this body as a BCS object to the recipient

Chris