cancel
Showing results for 
Search instead for 
Did you mean: 

SAP TM documents without SAP EM acknowledged EH GUID

Former Member
0 Kudos

Hi, I have a question regarding the table /SAPTRX/AOTREF in TM and entries with empty TRXOBJECT fields.


This is my scenario (two servers):

SAP TM 9.0 Support package 12

SAP EM 9.0 Support package 5


There has been configuration changes in Direct Output Agents, were initially both agents, SEND_EM_DATA_FROM_TOR_ASYNC and SEND_EM_DATA_FROM_TOR were marked as active, and for the SEND_EM_DATA_FROM_TOR, the 'Has Critical o/p: Process during Save - before Commit' mode was selected.

The current configuration is SEND_EM_DATA_FROM_TOR and 'Has Uncritical o/p: Process after Commit (background)' for Synch/Asynch.


In SAP EM, the Application Systems configuration view ( /SAPTRX/V_APPSYS ) hasn't got the acknowledgment option selected for the TM system and are marked as Synch. I will change this configuration later.


Also all entries in the incoming TRFC queues in SAP TM related to EM ( EM*) have been deleted.


So the current situation is that there are thousands of TM documents ( FUs ) that have corresponding entries in table /SAPTRX/AOTREF but with an empty Event Handler GUID in field TRXOBJECT. The Event Handlers exist in EM.


If there were just a few TM documents, I could delete the entries in /SAPTRX/AOTREF and the corresponding Event Handler in EM ( with a custom program that deletes specific entries in all the relevant EM tables, both in TM and in EM  ), as there has not been any event activity yet, modify ( some information not affecting the business process ) and save the TM document, which would create a new entry in /SAPTRX/AOTREF, and a new corresponding Event Handler in EM, and the newly created Event Handler GUID in TRXOBJECT.


But as there are thousands of TM documents, I would need some program that I could run for all those Event Handlers ( it would be a different topic how to select them out of all the existing Event Handlers in EM ) and resend the acknowledgement to SAP TM, so the field TRXOBECT and the statuses fields would be updated with the Event Handler GUID and correct values.


I know that there exists a function module ( /SAPTRX/SEND_ACKNOWLEDGE_ASYNC ) and a class instance method ( /SAPTRX/CL_EN_POST_CNTRL->SEND_ACKNOLEDGE ) that use the function module BAPI_TRKOBJ_ACKNSTATUS to send the acknowledgement to TM.


So my questions are:


1 - Is there any standard program that I could run, or procedure that I could follow, that would resend acknowledgements to TM out of existing Event Handlers?


2 - Would invoking the BAPI_TRKOBJ_ACKNSTATUS function module from a custom program the "right" way to resend the acknowledgment?

Thanks for any help on this issue.

Rafael.

Accepted Solutions (1)

Accepted Solutions (1)

former_member186607
Active Contributor
0 Kudos

Hi Rafael,

do you have any custom functionality in SAP TM that relies on having the field TRXOBJECT populated in table /SAPTRX/AOTREF? The standard functionality does not rely anymore in this field if certain prerequisites are fulfilled. Please check the troubleshooting guide: - chapter "Define Application System" or note 2235954 for details.

Therefore my recommendation for you would be to implement the missing notes, disable the acknowledgement in general and do not try to get the missing acknowledgement.

Best regards, Daniel

Former Member
0 Kudos

Hi Daniel, thanks for helping me.

The problem is that to disable acknowledgement, as suggested on those SAP notes, it is required a level of TM ( at least ) support packages which is above the one the system has, and I can not expect the administrators to install any support packages right now.

So I have a question. If I want the TM UI ( execution tab ) to show the actual events reported in EM, can this be working without the EH GUID in /SAPTRX/AOTREF ?

Best regards, Rafael.

Former Member
0 Kudos

Hi Rafael,

If you report in EM, the events should get propagated automatically to your TM docs if you are using the ruleset function TM_MAINTAIN_EXEC_INF which in turn call FM = /SCMTMS/EXECINFO_PROCESS.

Make sure your EH_HDR has correct AO System pointing to your TM.

SELECT SINGLE * FROM /saptrx/appsyst INTO ls_appsyst
     WHERE app_system_id = ls_eh_hdr-ao_system.


Thanks,

Vishnu


Former Member
0 Kudos

Hi Vishnu

One question.

Does the FM /SCMTMS/EXECINFO_PROCESS update also the table /SAPTRX/AOTREF with the EH GUID in field TRXOBJECT if this is not informed?


Thanks and best regards, Rafael.

Former Member
0 Kudos

Hi Rafael ,

I do not think that it will update /SAPTRX/AOTREF . Entries of EH_GUID in /SAPTRX/AOTREF works when you click on "execution " tab in freight order when system try to pull EM data through RFC program .

Regards,

Rajesh

former_member186607
Active Contributor
0 Kudos

Hi,

therefore we have released these notes. So you can implement the notes and do not need to install any new support package. I would really recommend to go this way.

Best regards, Daniel

Former Member
0 Kudos

Hi Daniel.


The notes you have released address the problem of deleting stale entries in /SAPTRX/AOTREF without the TRXOBJECT field informed, when archiving Event Handlers in EM marked for deletion.


But the problem I still have is how do I reload, with a standard procedure, the value of the created Event Handler´s GUID in the TRXOBJECT field, when, for whatever reason, the original acknowledgement from EM, or the return code of the BAPI that created the Event Handler, or whatever other initial mechanism was in place to retrieve the created Event Handler's GUID, did not come through, leaving an empty value in TRXOBJECT, which is the current situation at a couple of EM systems I am working on.


If the field is empty I am not able to see the actual events that are received in EM, even though they might have a ruleset activity that updates the execution information in the TM TOR object. The transient node EXECUTIONINFORMATION_TR is empty. Only when I manually update the TRXOBJECT with the EH GUID, then can I see the execution information.


I can use the program and RFC that I have written to restore all the empty TRXOBJECT fields, but I would like to know if this would be an accepted way of fixing the scenario I have described.


Thanks a lot for your time, and best regards

Rafael.

former_member186607
Active Contributor
0 Kudos

Hi Rafael,

ok, then let me try to sort this out again.

In general, the recommendation is to not use the acknowledgement in SAP EM - TM integration scenarios. Prerequisite to do this is that either specific SP levels for SAP EM and SAP TM are installed or that the notes described in note 2235954 are implemented. If you do this the execution tab in SAP TM works as expected although the field TRXOBJECT in table /SAPTRX/AOTREF is not used. Additionally the two notes 2228615 for SAP EM and 2228613 for SAP TM are needed to enable the deletion of the entries in table /SAPTRX/AOTREF if the event handlers are archived/deleted in SAP EM.

Therefore it is recommended to implement all these notes and everything should work as expected.

In that case you do not need to update your entries in /SAPTRX/AOTREF to get the execution tab working again.

There is no standard functionality available to "reload" the TRXOBJECT to table /SAPTRX/AOTREF - apart from activate the acknowledgement and then update all the affected event handlers.

Best regards, Daniel

Former Member
0 Kudos

Hi Daniel.

Now is perfectly clear.

Thanks and best regards, Rafael.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi

Whilst I wait to see if some one can give me an answer to the question of if there is some standard way to do the re sending of acknowledgment  from EM to TM I have done a simple development to resolve my issue, which was that I had records with empty TRXOBJECT fields in table /SAPTRX/AOTREF in TM.

I will share the code for what ever might be useful for. You are responsible to verify if it can be useful for your specific needs.

I create a RFC in EM ( remote call enabled )

FUNCTION zre_tool_001.

*"----------------------------------------------------------------------

*"*"Interfase local

*"  IMPORTING

*"     VALUE(AO_TYPE) TYPE  /SAPTRX/AOTYPE

*"     VALUE(AO_ID) TYPE  /SAPTRX/AOID

*"  EXPORTING

*"     VALUE(EH_GUID) TYPE  /SAPTRX/EH_GUID

*"----------------------------------------------------------------------

    SELECT SINGLE eh_guid FROM /saptrx/eh_hdr INTO eh_guid WHERE ao_type = ao_type AND ao_id = ao_id.

ENDFUNCTION.

Then I create a program in TM that calls the RFC in EM for each empty row and updates it with the actual EH GUID. It has solved my problem.

*&---------------------------------------------------------------------*

*& Report  ZRE_TOOL_002

*&

*&---------------------------------------------------------------------*

*&

*&

*&---------------------------------------------------------------------*

REPORT zre_tool_002.

DATA:

  l_emsystemrfc TYPE rfcdest,

  lt_aotref TYPE STANDARD TABLE OF /saptrx/aotref,

  ls_aotref LIKE LINE OF lt_aotref,

  l_eh_guid TYPE /saptrx/aotref-trxobject.

l_emsystemrfc = 'EM_RFC_DESTINATION_MAINTAINED_IN_SM59'.

SELECT * INTO TABLE lt_aotref FROM /saptrx/aotref WHERE trxobject = ''.

LOOP AT lt_aotref INTO ls_aotref.

  CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'

    EXPORTING

      text = ls_aotref-aoid.

  CALL FUNCTION 'ZRE_TOOL_001'

    DESTINATION l_emsystemrfc

    EXPORTING

      ao_type = ls_aotref-aotype

      ao_id   = ls_aotref-aoid

    IMPORTING

      eh_guid = l_eh_guid.

  IF l_eh_guid IS NOT INITIAL.

    UPDATE /saptrx/aotref SET trxobject = l_eh_guid poststatus = 'B'  WHERE aotype = ls_aotref-aotype AND aoid = ls_aotref-aoid .

  ENDIF.

ENDLOOP.

Best regards, Rafael

Former Member
0 Kudos

Hi Rafael,

I have just checked the system, I don't find SAP EM Standard reports that sends back retro acknowledgement status back to Application system for your need.

I think, we need a custom enhancement to achieve this as you did already.

Regards


GGOPII

Former Member
0 Kudos

Thanks, I value your opinion.

Best regards.

Former Member
0 Kudos

Hi Daniel/Rafael,

I have a query here.There is  a checkbox in /saptrx/delete_eh report in EM system to delete application system data which will call /SAPTRX/DEL_ARCHIVED_EH_DATA of ECC system. If TRXOBJECT will not get populated in /saptrx/aotref, I dont think.. it will delete the entries from /saptrx/aotref table. Can you confirm..Is there any other way to delete data from /saptrx/aotref data from EM system through standard report, if we are not populating TRXOBJECT in /saptrx/aotref   .. let's say by using tracking id or application object id  instead of event handler number/guid as in this case.

Regards,

Ratnakar

Former Member
0 Kudos

Hi Ratnakar

My understanding is that /SAPTRX/DEL_ARCHIVED_EH_DATA  needs a valid TRXOBJECT ( with an actual EH GUID ) in /SAPTRX/AOTREF, as it uses it for selecting which entries to delete.

  

From the Function Module source:

...

    SELECT * FROM /saptrx/aotref

      UP TO lv_pack_size ROWS

      INTO TABLE lt_aotref

      FOR ALL ENTRIES IN lt_arch_eh

      WHERE trxobject = lt_arch_eh-eh_guid.

...

Best regards, Rafael.

Former Member
0 Kudos

Hi Rafael ,

I believe Ratnakar is pointing out to Daniel's solution . Daniel recommended to make solution independent of TRXOBJECT populated in table /SAPTRX/AOTREF . In this case , if EH_GUID is not available then how /SAPTRX/DEL_ARCHIVED_EH_DATA will work ?

Regards,

Rajesh

Former Member
0 Kudos

Hi Rathnakar and Rafael,

The table /SAPTRX/AOTREF that stores the reference between EH GUID and the AOID. Always only one 1 Event Handler per unique Application Object ID.

So, when you execute the report with Delete Appl. System Data, it will delete reference application data.

If you have one tracking id to one object id then it would possible I believe but need to check on this.

Regards

GGOPII

former_member186607
Active Contributor
0 Kudos

Hi,

we have released an EM note and a TM note as well for this issue: 2228615 for SAP EM and 2228613 for SAP TM.

As soon as you have implemented the notes the entries in table /SAPTRX/AOTREF will be deleted as well if TRXOBJECT is not populated.

Best regards, Daniel