cancel
Showing results for 
Search instead for 
Did you mean: 

Report to show Number of sent and received messages

Former Member
0 Kudos

Hi,

We are on PI 7.1 EHP 1.

I'm wondering if there is a way to set up a daily report that will output the number of inbound and outbound messages by message type?

I know this can be done manually in the RWB but is there a way to automate it?

Thanks,

Gareth

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Yes, is possible using standard AbapStack function & tables.

Check in SDN Forum, this is an old 3D.

&----


*& Report ZPI_MESSAGES_COUNT

*&

&----


*&

*&

&----


REPORT zpi_messages_count.

TYPES : BEGIN OF gty_filter_t,

ob_system TYPE ait_sndr,

ob_name TYPE rm_oifname,

END OF gty_filter_t.

DATA : im_filter TYPE sxi_msg_select,

pids TYPE sxms_sel_options,

pid TYPE sxmsselopt,

gt_msg TYPE sxmsmsgtab,

gt_fil TYPE TABLE OF gty_filter_t,

gs_fil TYPE gty_filter_t,

gs_fil_t TYPE gty_filter_t,

gs_msg TYPE SXMSMSGLST,

gv_lines TYPE int4,

cnt TYPE i.

PARAMETERS : s_st_dat TYPE sxi_msg_select-exedate OBLIGATORY,

s_ed_dat TYPE sxi_msg_select-exe2date OBLIGATORY,

n_hits TYPE int4 OBLIGATORY.

START-OF-SELECTION.

im_filter-exedate = s_st_dat.

im_filter-exe2date = s_ed_dat.

pid-sign = 'E' .

pid-option = 'EQ'.

pid-low = 'CENTRAL_BACK'.

APPEND pid TO pids.

CLEAR pid.

pid-sign = 'E' .

pid-option = 'EQ'.

pid-low = 'RECEIVER_BACK'.

APPEND pid TO pids.

CLEAR pid.

pid-sign = 'E' .

pid-option = 'EQ'.

pid-low = 'SENDER_BACK'.

APPEND pid TO pids.

CLEAR pid.

pid-sign = 'E' .

pid-option = 'EQ'.

pid-low = 'PE_ADAPTER'.

APPEND pid TO pids.

CLEAR pid.

pid-sign = 'E' .

pid-option = 'EQ'.

pid-low = 'PE_PROCESS'.

APPEND pid TO pids.

CLEAR pid.

im_filter-pids = pids.

CALL FUNCTION 'SXMB_SELECT_MESSAGES_NEW'

EXPORTING

im_filter = im_filter

im_number = n_hits

im_adapter_or = '0'

im_process_mode = '0'

IMPORTING

ex_msgtab = gt_msg

  • EX_RESULT =

  • EX_FIRST_TS =

EXCEPTIONS

persist_error = 1

missing_parameter = 2

negative_time_range = 3

too_many_parameters = 4

OTHERS = 5.

IF sy-subrc 0.

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

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

ENDIF.

DESCRIBE TABLE gt_msg LINES gv_lines.

SORT gt_msg BY ob_system.

LOOP AT gt_msg INTO gs_msg.

MOVE-CORRESPONDING gs_msg TO gs_fil.

APPEND gs_fil TO gt_fil.

CLEAR gs_fil.

ENDLOOP.

LOOP AT gt_fil INTO gs_fil.

gs_fil_t = gs_fil.

cnt = cnt + 1 .

AT END OF OB_SYSTEM .

WRITE 😕 cnt, gs_fil_t-ob_name .

CLEAR cnt.

ENDAT.

ENDLOOP.

WRITE 😕 gv_lines, 'Records Received'.

baskar_gopalakrishnan2
Active Contributor
0 Kudos

You can run similar to this report specified in this link.