Skip to Content

This is a program that I wrote to list out an Event Handlers Expected event table (/SAPTRX/EH_EXPEV), the events posted to that EH (/SAPTRX/EH_EVMSG), the Expected Event Modify entries for each event posted (/SAPTRX/EVM_EEM) and a list of the parameter changes made to the EH (/SAPTRX/EVM_PAR).

You will often need to look at these tables to see why your event handlers aren’t updating correctly. This program greatly reduces the errors and guesswork out of trying to find out what went wrong. 


REPORT  z_list_events_eem LINE-SIZE 178.

TABLES: /saptrx/eh_evmsg,

   WITH FRAME TITLE text002.
SELECT-OPTIONS: s_system FOR /saptrx/eh_hdr-ao_system,
                s_aoid FOR /saptrx/eh_hdr-ao_id,
                s_aotype FOR /saptrx/eh_hdr-ao_type.

  REFRESH s_system.
  s_system-low = ‘SAPECC’.
  s_system-option = ‘EQ’.
  s_system-sign = ‘I’.
  APPEND s_system.

  SELECT * FROM /saptrx/eh_hdr
    WHERE ao_system IN s_system AND
          ao_type   IN s_aotype AND
          ao_id     IN s_aoid.

*** EH Header Detail
    IF /saptrx/eh_hdr-eh_active = ‘X’.
    WRITE:/ ‘Order:  ‘, s_aoid-low(10), 


            ‘ Line’, s_aoid-low+10(6),

              ‘ EH GUID:’, /saptrx/eh_hdr-eh_guid.

*** EH Expected Events
    SELECT * FROM /saptrx/eh_expev
      WHERE eh_guid = /saptrx/eh_hdr-eh_guid.

      WRITE: /5 /saptrx/eh_expev-event_code,
              (20) /saptrx/eh_expev-event_exp_date,
              (20) /saptrx/eh_expev-event_date.
      CASE /saptrx/eh_expev-event_status.
        WHEN ‘ ‘ OR ‘N’.
          WRITE: ‘Not expected’.
        WHEN ‘R’.
          WRITE: ‘Reported    ‘.
        WHEN ‘O’.
          WRITE: ‘Overdue     ‘.
        WHEN ‘E’.
          WRITE: ‘Expected    ‘.
      WRITE: ‘ Msg:’,
          (20) /saptrx/eh_expev-msg_exp_date,
          (20) /saptrx/eh_expev-msg_rcvd_date.


*** EH Event Messages
    SELECT * FROM /saptrx/eh_evmsg
      WHERE eh_guid = /saptrx/eh_hdr-eh_guid
      ORDER BY event_date_utc.

      IF /saptrx/eh_evmsg-not_relevant = ‘X’.
      WRITE: /(20) /saptrx/eh_evmsg-event_code,
              (22) /saptrx/eh_evmsg-msg_guid,
              (20) /saptrx/eh_evmsg-event_date,
              (20) /saptrx/eh_evmsg-proc_date,
              ‘Msg Rec:’,
              (20) /saptrx/eh_evmsg-msg_rcvd_date.

*** Expected Event Modify Entries
      SELECT * FROM /saptrx/evm_eem
         WHERE evt_guid = /saptrx/eh_evmsg-msg_guid.

        WRITE: /5 /saptrx/evm_eem-evtid(20),
                (1)  /saptrx/evm_eem-evtact,
                (20) /saptrx/evm_eem-etxdat,
                (20) /saptrx/evm_eem-etxtim,
                (20) /saptrx/evm_eem-msgdat,
                (20) /saptrx/evm_eem-msgtim.

*** Parameter Changes
      SELECT * FROM /saptrx/evm_par
         WHERE evt_guid = /saptrx/eh_evmsg-msg_guid.

        WRITE: /5  .

        CASE /saptrx/evm_par-partyp.
          WHEN ‘I’.
            WRITE ‘Info   ‘.
          WHEN ‘C’.
            WRITE ‘Control’.

        WRITE:  (20) /saptrx/evm_par-param_name,
                (20) /saptrx/evm_par-param_value.
        CASE /saptrx/evm_par-action.
          WHEN ‘S’.
            WRITE ‘Insert’.
          WHEN ‘C’.
            WRITE ‘Change’.
          WHEN ‘D’.
            WRITE ‘Delete’.






To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply