cancel
Showing results for 
Search instead for 
Did you mean: 

BPMon - User exit monitoring

Former Member
0 Kudos

Hi there!

can anyone help me on the user exit monintoring - meaning using developed application monitoring functions?

i know that you have to do some customizing on the monitoring objects, but how do you set up the data collection?

thanks in advance

Accepted Solutions (0)

Answers (3)

Answers (3)

0 Kudos

Hi Szilvia,

did you already check the dedicated "Setup Guide - Customer Exit" under https://service.sap.com/bpm --> Media Library --> Technical Information?

There are even two coding examples in there.

Best Regards

Volker

Former Member
0 Kudos

Hi Szilvia,

You got me on the air with the question, since I just made tailored suited BP Monitoring for a customer.

I will trace you the general idea that involves a simple abap program for the Z__Bpm_Ecu_Collector, if any other questions, feel free to ask....

Lets try this:

This report is created in the satellite system (eg. PRO). The report must have the name Z_BPM_ECU_COLLECTOR, else, Solution Manager would not recognize it. Atributes for the program Z_BPM_ECU_COLLECTOR:

orig lang. EN

type. Excecutable program

status. Customer production program

App. Cross App.

Package. your own Z - name

Checkmark the "Unicode checks active" and "Fixed point arithmetic"

The collector program will bring the contents to the key figures in solution manager, the data collectors are subroutines written within this report.

For each monitoring object created a data collector (subroutine) must be written. The collectors are named:

DC_CUCUSTXX, where 'CUSTXX' is the name of the monitoring object, eg. DC_CUCUST00.

&----


*& Report Z_BPM_ECU_COLLECTOR

*&

&----


*&

*&

&----


REPORT z_bpm_ecu_collector.

INCLUDE /ssa/iet.

DATA: fec_ini LIKE ekko-bedat,

fec_fin LIKE ekko-bedat,

reswk LIKE ekko-reswk,

ekorg LIKE ekko-ekorg,

bstyp LIKE ekko-bstyp,

p_soc LIKE febko-bukrs.

&~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

*& FORM DC_CUCUST00

&~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  • TEMPLATE FOR A DATA COLLECTOR

  • EACH MONITORING OBJECT HAS TO HAVE ITS OWN FORMROUTINE

  • WITH NAME CONVENTION DC_CUCUST00 AND WITH FOLLOWING

  • INTERFACE.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  • ~~>PT_INPUTTAB

  • ~~>PT_CUSTTABC

  • ~~>PT_CUSTTABL

  • ~~>PT_CUSTTABM

  • ~~>PT_CUSTTABO

  • ~~>PT_CUSTTABA

  • ~~>PT_OUTPUTTA

  • ~~>PF_SOLUTION

  • ~~>PF_PARAMETE

  • ~~>PF_SUBRC

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

FORM dc_cucust00

TABLES pt_inputtab TYPE tt_inputtab

pt_custtabc TYPE tt_appmonc

pt_custtabl TYPE tt_appmonl

pt_custtabm TYPE tt_appmonm

pt_custtabo TYPE tt_appmono

pt_custtaba TYPE tt_appmona

pt_outputtab TYPE tt_outputtab

USING pf_solution TYPE tf_solution

pf_parameter TYPE tf_parameter

CHANGING pf_subrc LIKE sy-subrc.

DATA:

lf_subroutine(30),

ls_input TYPE ts_appmona,

ls_output TYPE ts_appmoni.

*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  • SORT TABLE PT_CUSTTABA BY KEYFIGURE TO MAKE SURE FORM FOR MONITORING

  • OBJECT IS CALLED FIRST BECAUSE MONITORING OBJECT HAS

  • ALWAYS KEYFIG = 00.

*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

SORT pt_custtaba BY keyfig.

LOOP AT pt_custtaba INTO ls_input.

  • CREATE FORM NAME:

  • MONITORING OBJECT (CUCUST00)

  • FOR EACH KEYFIGURES( 00 LS_INPUT-KEYFIG)

CONCATENATE 'KEYFIG_SUBROUTINECUCUST00_'

ls_input-keyfig INTO lf_subroutine.

PERFORM (lf_subroutine) IN PROGRAM (sy-repid)

USING ls_input "input

CHANGING ls_output "output

pf_subrc IF FOUND.

IF pf_subrc = 0.

  • STORE RESULT

APPEND ls_output TO pt_outputtab.

CLEAR ls_output.

ENDIF.

ENDLOOP.

ENDFORM. "DC_CUCUST00

&~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

*& FORM KEYFIG_SUBROUTINECUCUST00_00

&~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  • FORM FOR MONITORING OBJECT CUCUST00 KEYFIGURE 00

*

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

FORM keyfig_subroutinecucust00_00

USING ps_input TYPE ts_appmona

CHANGING ps_output TYPE ts_appmoni

pf_subrc LIKE sy-subrc.

*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  • FORM FOR MONITORING OBJECT ITSELF

  • Example: INITIALIZE SOME VALUES

*

ENDFORM. " KEYFIG_SUBROUTINECUCUST00_00

&~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

*& FORM KEYFIG_SUBROUTINECUCUST00_02

&~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  • FORM FOR MONITORING OBJECT CUCUST00 KEYFIGURE 02

  • IAMSA SO/Stock

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

FORM keyfig_subroutinecucust00_02

USING ps_input TYPE ts_appmona

CHANGING ps_output TYPE ts_appmoni

pf_subrc LIKE sy-subrc.

*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**tables mara.

**data: lt_mara type standard table of mara with header line,

    • lf_total type mard-labst.

**data: wa_matnr like mara-matnr.

**data: begin of lt_vbeln occurs 0,

    • ls_vbeln like vbak-vbeln.

**data: end of lt_vbeln.

**data: begin of lt_labst occurs 0,

    • ls_labst type mard-labst.

**data: end of lt_labst.

**data: date type d.

**data: cp_date type d.

**data: days_1 like T5A4A-DLYDY.

**

**wa_matnr = ps_input-para1.

**********************************

  • A L E R T A #1

**********************************

  • Cesar Aranda - Begin

  • Declaracion de variables

DATA: BEGIN OF it_ekko OCCURS 0,

ebeln LIKE ekko-ebeln,

END OF it_ekko.

DATA: BEGIN OF it_ekpo OCCURS 0,

ebeln LIKE ekpo-ebeln,

ebelp LIKE ekpo-ebelp,

END OF it_ekpo.

DATA: BEGIN OF it_ekbe OCCURS 0,

ebeln LIKE ekbe-ebeln,

ebelp LIKE ekbe-ebelp,

END OF it_ekbe.

DATA: v_npedidos_stock TYPE i,

v_npedidos TYPE i,

v_npedidos_total TYPE i.

  • Cesar Aranda - End

  • PREPARE OUTPUT

  • TO MAKE MAPPING BETWEEN INPUT AND OUTPUT POSSIBLE

  • MANDATORY FIELDS OF OUTPUT TABLE

CONCATENATE ps_input-monobj

ps_input-keyfig

INTO ps_output-alerttype.

  • Cesar Aranda - Begin

  • Inicializar variables

fec_ini = ps_input-para1.

fec_fin = ps_input-para2.

reswk = ps_input-para3.

ekorg = ps_input-para4.

bstyp = ps_input-para5.

  • Seleccionar pedidos de cabecera

SELECT ebeln

INTO TABLE it_ekko

FROM ekko

WHERE

  • reswk = reswk AND

  • ekorg = ekorg AND

bstyp IN ('F' , 'L' ) AND

bedat BETWEEN fec_ini AND fec_fin .

IF sy-subrc = 0.

SORT it_ekko

BY ebeln.

IF NOT it_ekko[] IS INITIAL.

  • Seleccionar pedidos detalle

SELECT ebeln

ebelp

INTO TABLE it_ekpo

FROM ekpo

FOR ALL ENTRIES IN it_ekko

WHERE ebeln = it_ekko-ebeln.

IF sy-subrc = 0.

DESCRIBE TABLE it_ekpo

LINES v_npedidos_total.

IF NOT it_ekpo[] IS INITIAL.

  • Determinar si pedido esta en almacen

SELECT ebeln

ebelp

INTO TABLE it_ekbe

FROM ekbe

FOR ALL ENTRIES IN it_ekpo

WHERE ebeln = it_ekpo-ebeln AND

ebelp = it_ekpo-ebelp.

IF sy-subrc = 0.

DESCRIBE TABLE it_ekpo

LINES v_npedidos_stock.

v_npedidos = v_npedidos_total - v_npedidos_stock.

ENDIF.

ENDIF.

ENDIF.

ENDIF.

ENDIF.

  • Cesar Aranda - End

      • Calculate Date to check in past

**date = sy-datum.

**days_1 = days_past.

**

**CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'

    • EXPORTING

    • DATE = date

    • DAYS = days_1

    • MONTHS = 0

    • SIGNUM = '-'

    • YEARS = 0

    • IMPORTING

    • CALC_DATE = cp_date.

**

**

      • Data Collection

      • Number SO

**

**Select VBELN from VBAK

    • into lt_VBELN-ls_vbeln

    • where BUKRS_VF = COMP_CODE and ERDAT gt CP_DATE.

    • append lt_VBELN.

**Endselect.

**

**PS_OUTPUT-OBJECT1 = 0.

**Loop at lt_VBELN.

    • SELECT COUNT(*) FROM VBAP where matnr = wa_matnr and VBELN = LT_VBELN-ls_vbeln.

    • PS_OUTPUT-OBJECT1 = PS_OUTPUT-OBJECT1 + SY-DBCNT.

**ENDLOOP.

**

**PS_OUTPUT-OBJECT2 = 0.

      • Number of Stock

**select labst from mard

    • into lt_labst

    • where matnr = wa_matnr.

    • append lt_labst.

**endselect.

**

**Loop at lt_labst.

    • PS_OUTPUT-OBJECT2 = PS_OUTPUT-OBJECT2 + LT_labst-ls_labst.

**ENDLOOP.

**

**if PS_OUTPUT-OBJECT2 = 0.

    • PS_OUTPUT-AL_MEAS_VALUE = 0.

**else.

    • PS_OUTPUT-AL_MEAS_VALUE = 100 * PS_OUTPUT-OBJECT1 / PS_OUTPUT-OBJECT2.

**endif.

ps_output-object1 = v_npedidos.

ps_output-object2 = v_npedidos_stock.

ps_output-al_meas_value = v_npedidos_stock.

  • ALert Determination

IF ps_output-al_meas_value < ps_input-thres_yellow.

ps_output-rating = 'Green'. "#EC NOTEXT

ps_output-alert = 1.

ps_output-atext = 'No alert'. "#EC NOTEXT

ELSEIF ps_output-al_meas_value < ps_input-thres_red.

ps_output-rating = 'Yellow'. "#EC NOTEXT

ps_output-alert = 2.

ps_output-atext = 'Warning'. "#EC NOTEXT

ELSE.

ps_output-rating = 'Red'. "#EC NOTEXT

ps_output-alert = 3.

ps_output-atext = 'Alert'. "#EC NOTEXT

ENDIF.

ENDFORM. " KEYFIG_SUBROUTINECUCUST00_02

&~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

*& FORM KEYFIG_SUBROUTINECUCUST00_03

&~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  • FORM FOR MONITORING OBJECT CUCUST00 KEYFIGURE 03

  • IAMSA SO/Stock

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

FORM keyfig_subroutinecucust00_03

USING ps_input TYPE ts_appmona

CHANGING ps_output TYPE ts_appmoni

pf_subrc LIKE sy-subrc.

*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**********************************

  • A L E R T A #2

**********************************

  • Cesar Aranda - Begin

  • Declaracion de variables

DATA: l_fecha_prev TYPE sy-datum,

l_existe_extracto TYPE c.

DATA: BEGIN OF it_febko OCCURS 0,

anwnd LIKE febko-anwnd,

absnd LIKE febko-absnd,

azidt LIKE febko-azidt,

emkey LIKE febko-emkey,

END OF it_febko.

  • Cesar Aranda - End

  • PREPARE OUTPUT

  • TO MAKE MAPPING BETWEEN INPUT AND OUTPUT POSSIBLE

  • MANDATORY FIELDS OF OUTPUT TABLE

CONCATENATE ps_input-monobj

ps_input-keyfig

INTO ps_output-alerttype.

  • Cesar Aranda - Begin

  • Inicializar variables

p_soc = ps_input-para1.

l_fecha_prev = sy-datum - 1.

  • Seleccionar extracto

SELECT anwnd

absnd

azidt

emkey

INTO TABLE it_febko

FROM febko

WHERE azdat = l_fecha_prev AND

bukrs = p_soc .

IF sy-subrc = 0.

l_existe_extracto = 'X'.

ENDIF.

  • Cesar Aranda - End

IF l_existe_extracto = 'X'.

ps_output-object1 = 1. " Verde

ELSE.

ps_output-object1 = 0. " Amarillo

ENDIF.

ps_output-al_meas_value = ps_output-object1.

  • ALert Determination

IF ps_output-al_meas_value = ps_input-thres_yellow.

ps_output-rating = 'Green'. "#EC NOTEXT

ps_output-alert = 1.

ps_output-atext = 'No alert'. "#EC NOTEXT

ELSEIF ps_output-al_meas_value = ps_input-thres_red.

ps_output-rating = 'Yellow'. "#EC NOTEXT

ps_output-alert = 2.

ps_output-atext = 'Warning'. "#EC NOTEXT

ELSE.

ps_output-rating = 'Red'. "#EC NOTEXT

ps_output-alert = 3.

ps_output-atext = 'Alert'. "#EC NOTEXT

ENDIF.

ENDFORM. " KEYFIG_SUBROUTINECUCUST00_03

Cheers,

Cesar Aranda

Former Member
0 Kudos

Hi, Cesar!

Thanks a lot for your help! I knew about this Z program, just was not really sure about how to really write it. I will try this out now and let you know. It is great help, thanks again.

If it is not a too big question can you please send me some info how did you set up your objects in the /SSA/EXM program?

Cheers,

Szilvia

Edited by: Szilvia Reichfeld on Oct 31, 2008 1:46 PM

Former Member
0 Kudos

Hi Cesar,

You save my day!!!, I was going crazy because I could not actívate the program because it did not recognize the tables that I am using.

Now that I understand that this program needs to be created in the satellite system I am relieved.

Thanks a lot,

Eric

Former Member
0 Kudos

Hi Szilvia,

You got me on the air with the question, since I just made tailored suited BP Monitoring for a customer.

I will trace you the general idea that involves a simple abap program for the Z__Bpm_Ecu_Collector, if any other questions, feel free to ask....

Lets try this:

This report is created in the satellite system (eg. PRO). The report must have the name Z_BP M_EC U_COLLECTOR, else, Solution Manager would not recognize it. Atributes for the program Z_BP M_EC U_COLLECTOR:

orig lang. EN

type. Excecutable program

status. Customer production program

App. Cross App.

Package. your own Z - name

Checkmark the "Unicode checks active" and "Fixed point arithmetic"

The collector program will bring the contents to the key figures in solution manager, the data collectors are subroutines written within this report.

For each monitoring object created a data collector (subroutine) must be written. The collectors are named:

DC_CUCUSTXX, where 'CUSTXX' is the name of the monitoring object, eg. DC_CUCUST00.

I tried placing a program, but it doesnt me let it post it.

Cheers,

Cesar Aranda