cancel
Showing results for 
Search instead for 
Did you mean: 

Technical trace

Former Member
0 Kudos

Hi again,

Maybe this is just a basic question, is the technical trace only available for the simulation tool?

Is there any way to activate it temporally, I am saying this because in the simulation mode I am not able to load the test data (due to the function signature) and I have to add it manually which is very time consuming. If is possible, could you provide me some details on how to activate it?

Regards,

M.

Accepted Solutions (1)

Accepted Solutions (1)

ttrapp
Active Contributor
0 Kudos

The trace mode can be defined when calling the function from ABAP:

          lr_function->process( EXPORTING io_context = lr_context
                                          iv_trace_mode = if_fdt_constants=>gc_trace_mode_technical                                           iv_timestamp  = lv_timestamp
                                IMPORTING eo_result  = lr_result
                                          eo_trace   = lr_trace ).

You can get the result back as XML:
          lr_trace->read( IMPORTING ev_trace = e_xml_trace ).


You can even start to think of converting the XML document to HTML or TEXT using an XSL Transformation (CALL TRANSFORMATIO command):

<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sap="http://www.sap.com/sapxsl" xmlns:asx="http://www.sap.com/abapxml" version="1.0">

  <xsl:strip-space elements="*"/>
  <xsl:template match="/">
    <asx:abap>
      <asx:values>
        <ROOT>
          <xsl:apply-templates/>
        </ROOT>
      </asx:values>
    </asx:abap>
  </xsl:template>

  <xsl:template match="/FDT/LOG/TEXT">
    <item>
      <xsl:value-of select="string(.)"/>
     </item>
     <xsl:apply-templates/>
  </xsl:template>


  <xsl:template match="/FDT/LOG/CONTEXT_UPDATE">
    <item>
      <xsl:value-of select="concat(string(@DataObjectName), ' is assigned to ' , string(text()))"/>
     </item>
     <xsl:apply-templates/>
  </xsl:template>

  <xsl:template match="text() | @*">
  </xsl:template>

</xsl:transform>


The logs can also be stored the DB. Please be aware that the persistance of those Messages has been optimized.

BR Tobias

Former Member
0 Kudos

Hi Tobias,

Sorry my ABAP ignorance, how should the lr_result

be defined?


For example:

DATA: lt_name_value  TYPE     abap_parmbind_tab,
lv_function_id TYPE  if_fdt_types=>id,  
lo_trace_plus  TYPE REF TO   if_fdt_trace,

lv_timestamp   TYPE     timestamp.

"Trace active

          MOVE abap_true TO lv_trace_gen.

          CALL METHOD cl_fdt_function_process=>process

            EXPORTING

              iv_function_id = lv_function_id

              iv_timestamp   = lv_timestamp

              iv_trace_mode  = if_fdt_constants=>gc_trace_mode_technical

            IMPORTING

              eo_trace       = lo_trace_plus

     eo_result  = lr_result

            CHANGING

              ct_name_value  = lt_name_value.

Many thanks,

Mario

ttrapp
Active Contributor
0 Kudos

You should have a look at the API for a function call. The call of a function is described here the method IF_FDT_FUNCTION~PROCESS.

So le_result has to be defined as follows: DATA lr_result TYPE REF TO  if_fdt_result.

BR

Tobias

Answers (1)

Answers (1)

carsten_ziegler
Active Contributor
0 Kudos

I recently published a document on this very question.
Please take a look at Tracing in SAP Decision Service Management.