cancel
Showing results for 
Search instead for 
Did you mean: 

SAP EM 7.0 Ehp1 New Archiving Objects

Former Member
0 Kudos

Hello Everyone,

I have quick question on SAP EM7.0 EhP 1 New Archiving Objects

SAPTRX_EH and SAPTRX_EVM: 

As suggested by SAP, Business Function SCM_HIGHVOL was enabled.

All Config is completed including Customizing Sequence (Event Handler, Event Messages) and also Residence time.

For new archiving

SAPTRX_EH  object, we have Preprocessing (/SAPTRX/ARCHIVE_EH_PREPROCESS)  before Writing and deleting Event Handlers.

In Preprocess Program  (/SAPTRX/ARCHIVE_EH_PREPROCESS), we have following code:

  

*--------------------------------------------------------------------
* -> check if Sets used
*--------------------------------------------------------------------
  SELECT SINGLE eh_guid FROM /saptrx/eh_seteh INTO lv_eh_guid. "#EC WARNOK


*--------------------------------------------------------------------
* -> if sets used exclude EH which belong to sets with subquery
*--------------------------------------------------------------------
  IF sy-dbcnt > 0.
    SELECT eh_guid FROM /saptrx/eh_hdr INTO TABLE lt_eh_hdr_key
      WHERE
        ao_system     IN so_ao_sy AND
        ao_type       IN so_ao_tp AND
        ao_id         IN so_ao_id AND
        eh_active     = abap_false AND
        eh_archived   = abap_false AND
        active_date   IN lt_act_tstmp_range AND
        inactive_date IN lt_inact_tstmp_range AND
        created_by    IN p_crby AND
        created_date  IN lt_create_tstmp_range AND
        updated_by    IN p_upby AND
        updated_date  IN lt_update_tstmp_range AND
        eh_guid <> ANY ( SELECT eh_guid FROM /saptrx/eh_seteh ). "#EC CI_NOWHERE
    lv_total_of_objects = sy-dbcnt.
    IF sy-subrc <> 0.
      MESSAGE ID '/SAPTRX/ADM_MSG' TYPE 'I' NUMBER '000'.
      EXIT.
    ENDIF.

*--------------------------------------------------------------------
* -> if no sets used: select without subquery for better performance
*--------------------------------------------------------------------
  ELSE.
    SELECT eh_guid FROM /saptrx/eh_hdr INTO TABLE lt_eh_hdr_key
      WHERE
        ao_system     IN so_ao_sy AND
        ao_type       IN so_ao_tp AND
        ao_id         IN so_ao_id AND
        eh_active     = abap_false AND
        eh_archived   = abap_false AND
        active_date   IN lt_act_tstmp_range AND
        inactive_date IN lt_inact_tstmp_range AND
        created_by    IN p_crby AND
        created_date  IN lt_create_tstmp_range AND
        updated_by    IN p_upby AND
        updated_date  IN lt_update_tstmp_range.
    lv_total_of_objects = sy-dbcnt.
    IF sy-subrc <> 0.
      MESSAGE ID '/SAPTRX/ADM_MSG' TYPE 'I' NUMBER '000'.
      EXIT.
    ENDIF.
  ENDIF.

My Question:

  1. In our business process, we have defined Event Handler Sets - for PO and Inbound Delivery Process based on PO_NO.
  2. We are planning to Delete PO Event Handlers and corresponding Event Messages
  3. Where as for Inbound Delivery Event Handlers, we are planning to Archive both EH and Event Messages
  4. For the same, if I am trying to use new Archiving Objects, Preprocessing Program Excluding All Inbound Delivery Event Handlers due Event Handler Set criteria (above SQL).
  5. I know SAP clearly specified NOT to use new archiving objects for Event Handler Sets.
  6. But for High Volume Processing and for different criteria conditions, we are planning to use archiving objects by copying Preprocessing Progam and create Y Program and comment  following code:
    

*--------------------------------------------------------------------

* -> if sets used exclude EH which belong to sets with subquery

*--------------------------------------------------------------------

  IF sy-dbcnt > 0.

    SELECT eh_guid FROM /saptrx/eh_hdr INTO TABLE lt_eh_hdr_key

      WHERE

        ao_system     IN so_ao_sy AND

        ao_type       IN so_ao_tp AND

        ao_id         IN so_ao_id AND

        eh_active     = abap_false AND

        eh_archived   = abap_false AND

        active_date   IN lt_act_tstmp_range AND

        inactive_date IN lt_inact_tstmp_range AND

        created_by    IN p_crby AND

        created_date  IN lt_create_tstmp_range AND

        updated_by    IN p_upby AND

        updated_date  IN lt_update_tstmp_range AND

        eh_guid <> ANY ( SELECT eh_guid FROM /saptrx/eh_seteh ). "#EC CI_NOWHERE

    lv_total_of_objects = sy-dbcnt.

    IF sy-subrc <> 0.

      MESSAGE ID '/SAPTRX/ADM_MSG' TYPE 'I' NUMBER '000'.

      EXIT.

    ENDIF.

*--------------------------------------------------------------------

* -> if no sets used: select without subquery for better performance

*--------------------------------------------------------------------

  ELSE.

  • By commenting the code, we were able to achieve desried results.
  • By doing this process, is any concerns? I believe there is should be some reason why SAP recommended NOT to use new Archiving objects for EH Sets?  Please provide if you have any inputs on this process.

Thank you

Susheel Mamidala

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member190756
Active Contributor
0 Kudos

Hello Susheel,

in the standard sets are only archived together i.e. all EH included in the set. Therefore also the Set has an inactive flag. If you just use the new archiving objects without checking this you could run in the situation that one EH of a set is archived and another one not. Depends on your scenario if you can live with that or not. If you would check this it should work when you adapt the new archiving reports (don't forget the EH Sets tables).

Best regards,

Steffen