Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 3116

Re: SAP TM documents without SAP EM acknowledged EH GUID

$
0
0

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


Viewing all articles
Browse latest Browse all 3116


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>