Skip to Content
author's profile photo Former Member
Former Member

Counting Entries in SXMSPMAST via UDF

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Nov 10, 2009 at 11:16 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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

  • author's profile photo Former Member
    Former Member
    Posted on Nov 10, 2009 at 11:42 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 10, 2009 at 11:56 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.