SAP ANST_GET_TRACE Function Module for Get Trace Data









ANST_GET_TRACE is a standard anst get trace SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Get Trace Data processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.


See here to view full function module documentation and code listing for anst get trace FM, simply by entering the name ANST_GET_TRACE into the relevant SAP transaction such as SE37 or SE38.

Function Group: ANST_SEARCH_TRACES
Program Name: SAPLANST_SEARCH_TRACES
Main Program: SAPLANST_SEARCH_TRACES
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function ANST_GET_TRACE pattern details

In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.
CALL FUNCTION 'ANST_GET_TRACE'"Get Trace Data
EXPORTING
IV_EXE_UNIT = "128 character
* IV_WITH_SUBPARTS = ' ' "General Flag
* IV_WITH_DOCU = ' ' "General Flag
* IV_WITH_TRACE = ' ' "General Flag
* IV_WITH_CROSS = ' ' "General Flag
* IV_REMOVE_DUPLICATES = 'X' "General Flag
* IV_REMOVE_DUPL_S_D = ' ' "General Flag
* IV_SAPGUI_INFO_LINE = 'X' "General Flag
* IV_ADD_TADIR_TO_LIMU = 'X' "General Flag
* IV_NO_LAST_MESSAGE_DISP = "General Flag
* IV_WITH_TABLE_KEYS = "General Flag
IV_EXE_TYPE = "128 character
* IT_TABLE_TYPES = "Key to Drop-Down Box
IV_DYNAMIC = "General Flag
IV_STATIC = "General Flag
* IV_STATIC_DEEPNESS = 1 "
* IV_RUN_TCD = ' ' "General Flag
* IV_RUN_RTA = ' ' "General Flag
* IV_FRGUI = ' ' "General Flag
* IV_FRAUTH = ' ' "General Flag

IMPORTING
EV_RETURNCODE = "Return Value of ABAP Statements
ET_TRACE_BASE = "ANST_TBOM_BASE_T
ET_TRACE_TCD_BASE = "ANST_TBOM_TCD_BASE_T
ET_TRACE_TCD_MSG = "ANST_TBOM_TCD_MSG_T
ET_TRACE_CROSS = "ANST_TBOM_CROSS_T
ET_TRACE_TRACE = "ANST_TBOM_TRACE_T
ET_TRACE_BASE_KEY = "Table Type for TBOM Base Key
EV_RUNTIME_PFA = "
EV_RUNTIME_CROSS = "

CHANGING
* IV_EXECUTION_WEB = ' ' "General Flag
* IV_GUID = "16 Byte UUID in 16 Bytes (Raw Format)

EXCEPTIONS
ANST_TA_PFA_WRONG_EXE_TYPE = 1 ANST_TA_PFA_WRONG_EXE_UNIT = 2 ANST_TA_ENV_ERROR = 3 ANST_TA_PFA_STATIC_OR_DYNAMIC = 4 ANST_TA_PFA_ERROR = 5 ANST_TA_NO_DATA = 6
.



IMPORTING Parameters details for ANST_GET_TRACE

IV_EXE_UNIT - 128 character

Data type: CHAR128
Optional: No
Call by Reference: Yes

IV_WITH_SUBPARTS - General Flag

Data type: FLAG
Default: SPACE
Optional: Yes
Call by Reference: Yes

IV_WITH_DOCU - General Flag

Data type: FLAG
Default: SPACE
Optional: Yes
Call by Reference: Yes

IV_WITH_TRACE - General Flag

Data type: FLAG
Default: SPACE
Optional: Yes
Call by Reference: Yes

IV_WITH_CROSS - General Flag

Data type: FLAG
Default: SPACE
Optional: Yes
Call by Reference: Yes

IV_REMOVE_DUPLICATES - General Flag

Data type: FLAG
Default: 'X'
Optional: Yes
Call by Reference: Yes

IV_REMOVE_DUPL_S_D - General Flag

Data type: FLAG
Default: SPACE
Optional: Yes
Call by Reference: Yes

IV_SAPGUI_INFO_LINE - General Flag

Data type: FLAG
Default: 'X'
Optional: Yes
Call by Reference: Yes

IV_ADD_TADIR_TO_LIMU - General Flag

Data type: FLAG
Default: 'X'
Optional: Yes
Call by Reference: Yes

IV_NO_LAST_MESSAGE_DISP - General Flag

Data type: FLAG
Optional: Yes
Call by Reference: Yes

IV_WITH_TABLE_KEYS - General Flag

Data type: FLAG
Optional: Yes
Call by Reference: Yes

IV_EXE_TYPE - 128 character

Data type: CHAR128
Optional: No
Call by Reference: Yes

IT_TABLE_TYPES - Key to Drop-Down Box

Data type: VALUEKEYS
Optional: Yes
Call by Reference: Yes

IV_DYNAMIC - General Flag

Data type: FLAG
Optional: No
Call by Reference: Yes

IV_STATIC - General Flag

Data type: FLAG
Optional: No
Call by Reference: Yes

IV_STATIC_DEEPNESS -

Data type: I
Default: 1
Optional: No
Call by Reference: Yes

IV_RUN_TCD - General Flag

Data type: FLAG
Default: SPACE
Optional: Yes
Call by Reference: Yes

IV_RUN_RTA - General Flag

Data type: FLAG
Default: SPACE
Optional: Yes
Call by Reference: Yes

IV_FRGUI - General Flag

Data type: FLAG
Default: SPACE
Optional: Yes
Call by Reference: Yes

IV_FRAUTH - General Flag

Data type: FLAG
Default: SPACE
Optional: Yes
Call by Reference: Yes

EXPORTING Parameters details for ANST_GET_TRACE

EV_RETURNCODE - Return Value of ABAP Statements

Data type: SY-SUBRC
Optional: No
Call by Reference: Yes

ET_TRACE_BASE - ANST_TBOM_BASE_T

Data type: ANST_TRACE_BASE_T
Optional: No
Call by Reference: Yes

ET_TRACE_TCD_BASE - ANST_TBOM_TCD_BASE_T

Data type: ANST_TRACE_TCD_BASE_T
Optional: No
Call by Reference: Yes

ET_TRACE_TCD_MSG - ANST_TBOM_TCD_MSG_T

Data type: ANST_TRACE_TCD_MSG_T
Optional: No
Call by Reference: Yes

ET_TRACE_CROSS - ANST_TBOM_CROSS_T

Data type: ANST_TRACE_CROSS_T
Optional: No
Call by Reference: Yes

ET_TRACE_TRACE - ANST_TBOM_TRACE_T

Data type: ANST_TRACE_TRACE_T
Optional: No
Call by Reference: Yes

ET_TRACE_BASE_KEY - Table Type for TBOM Base Key

Data type: ANST_TRACE_BASE_KEYS_T
Optional: No
Call by Reference: Yes

EV_RUNTIME_PFA -

Data type: I
Optional: No
Call by Reference: Yes

EV_RUNTIME_CROSS -

Data type: I
Optional: No
Call by Reference: Yes

CHANGING Parameters details for ANST_GET_TRACE

IV_EXECUTION_WEB - General Flag

Data type: FLAG
Default: ' '
Optional: Yes
Call by Reference: Yes

IV_GUID - 16 Byte UUID in 16 Bytes (Raw Format)

Data type: ANST_GUID
Optional: Yes
Call by Reference: Yes

EXCEPTIONS details

ANST_TA_PFA_WRONG_EXE_TYPE - (see returncode for details)

Data type:
Optional: No
Call by Reference: Yes

ANST_TA_PFA_WRONG_EXE_UNIT - (see returncode for details)

Data type:
Optional: No
Call by Reference: Yes

ANST_TA_ENV_ERROR - General Environment Error

Data type:
Optional: No
Call by Reference: Yes

ANST_TA_PFA_STATIC_OR_DYNAMIC -

Data type:
Optional: No
Call by Reference: Yes

ANST_TA_PFA_ERROR -

Data type:
Optional: No
Call by Reference: Yes

ANST_TA_NO_DATA -

Data type:
Optional: No
Call by Reference: Yes

Copy and paste ABAP code example for ANST_GET_TRACE Function Module

The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.

DATA:
lv_iv_exe_unit  TYPE CHAR128, "   
lv_ev_returncode  TYPE SY-SUBRC, "   
lv_iv_execution_web  TYPE FLAG, "   ' '
lv_anst_ta_pfa_wrong_exe_type  TYPE FLAG, "   
lv_iv_with_subparts  TYPE FLAG, "   SPACE
lv_iv_with_docu  TYPE FLAG, "   SPACE
lv_iv_with_trace  TYPE FLAG, "   SPACE
lv_iv_with_cross  TYPE FLAG, "   SPACE
lv_iv_remove_duplicates  TYPE FLAG, "   'X'
lv_iv_remove_dupl_s_d  TYPE FLAG, "   SPACE
lv_iv_sapgui_info_line  TYPE FLAG, "   'X'
lv_iv_add_tadir_to_limu  TYPE FLAG, "   'X'
lv_iv_no_last_message_disp  TYPE FLAG, "   
lv_iv_with_table_keys  TYPE FLAG, "   
lv_iv_guid  TYPE ANST_GUID, "   
lv_iv_exe_type  TYPE CHAR128, "   
lv_et_trace_base  TYPE ANST_TRACE_BASE_T, "   
lv_anst_ta_pfa_wrong_exe_unit  TYPE ANST_TRACE_BASE_T, "   
lv_it_table_types  TYPE VALUEKEYS, "   
lv_iv_dynamic  TYPE FLAG, "   
lv_anst_ta_env_error  TYPE FLAG, "   
lv_et_trace_tcd_base  TYPE ANST_TRACE_TCD_BASE_T, "   
lv_iv_static  TYPE FLAG, "   
lv_et_trace_tcd_msg  TYPE ANST_TRACE_TCD_MSG_T, "   
lv_anst_ta_pfa_static_or_dynamic  TYPE ANST_TRACE_TCD_MSG_T, "   
lv_et_trace_cross  TYPE ANST_TRACE_CROSS_T, "   
lv_anst_ta_pfa_error  TYPE ANST_TRACE_CROSS_T, "   
lv_iv_static_deepness  TYPE I, "   1
lv_iv_run_tcd  TYPE FLAG, "   SPACE
lv_et_trace_trace  TYPE ANST_TRACE_TRACE_T, "   
lv_anst_ta_no_data  TYPE ANST_TRACE_TRACE_T, "   
lv_iv_run_rta  TYPE FLAG, "   SPACE
lv_et_trace_base_key  TYPE ANST_TRACE_BASE_KEYS_T, "   
lv_iv_frgui  TYPE FLAG, "   SPACE
lv_ev_runtime_pfa  TYPE I, "   
lv_iv_frauth  TYPE FLAG, "   SPACE
lv_ev_runtime_cross  TYPE I. "   

  CALL FUNCTION 'ANST_GET_TRACE'  "Get Trace Data
    EXPORTING
         IV_EXE_UNIT = lv_iv_exe_unit
         IV_WITH_SUBPARTS = lv_iv_with_subparts
         IV_WITH_DOCU = lv_iv_with_docu
         IV_WITH_TRACE = lv_iv_with_trace
         IV_WITH_CROSS = lv_iv_with_cross
         IV_REMOVE_DUPLICATES = lv_iv_remove_duplicates
         IV_REMOVE_DUPL_S_D = lv_iv_remove_dupl_s_d
         IV_SAPGUI_INFO_LINE = lv_iv_sapgui_info_line
         IV_ADD_TADIR_TO_LIMU = lv_iv_add_tadir_to_limu
         IV_NO_LAST_MESSAGE_DISP = lv_iv_no_last_message_disp
         IV_WITH_TABLE_KEYS = lv_iv_with_table_keys
         IV_EXE_TYPE = lv_iv_exe_type
         IT_TABLE_TYPES = lv_it_table_types
         IV_DYNAMIC = lv_iv_dynamic
         IV_STATIC = lv_iv_static
         IV_STATIC_DEEPNESS = lv_iv_static_deepness
         IV_RUN_TCD = lv_iv_run_tcd
         IV_RUN_RTA = lv_iv_run_rta
         IV_FRGUI = lv_iv_frgui
         IV_FRAUTH = lv_iv_frauth
    IMPORTING
         EV_RETURNCODE = lv_ev_returncode
         ET_TRACE_BASE = lv_et_trace_base
         ET_TRACE_TCD_BASE = lv_et_trace_tcd_base
         ET_TRACE_TCD_MSG = lv_et_trace_tcd_msg
         ET_TRACE_CROSS = lv_et_trace_cross
         ET_TRACE_TRACE = lv_et_trace_trace
         ET_TRACE_BASE_KEY = lv_et_trace_base_key
         EV_RUNTIME_PFA = lv_ev_runtime_pfa
         EV_RUNTIME_CROSS = lv_ev_runtime_cross
    CHANGING
         IV_EXECUTION_WEB = lv_iv_execution_web
         IV_GUID = lv_iv_guid
    EXCEPTIONS
        ANST_TA_PFA_WRONG_EXE_TYPE = 1
        ANST_TA_PFA_WRONG_EXE_UNIT = 2
        ANST_TA_ENV_ERROR = 3
        ANST_TA_PFA_STATIC_OR_DYNAMIC = 4
        ANST_TA_PFA_ERROR = 5
        ANST_TA_NO_DATA = 6
. " ANST_GET_TRACE




ABAP code using 7.40 inline data declarations to call FM ANST_GET_TRACE

The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.

 
"SELECT single SUBRC FROM SY INTO @DATA(ld_ev_returncode).
 
DATA(ld_iv_execution_web) = ' '.
 
 
DATA(ld_iv_with_subparts) = ' '.
 
DATA(ld_iv_with_docu) = ' '.
 
DATA(ld_iv_with_trace) = ' '.
 
DATA(ld_iv_with_cross) = ' '.
 
DATA(ld_iv_remove_duplicates) = 'X'.
 
DATA(ld_iv_remove_dupl_s_d) = ' '.
 
DATA(ld_iv_sapgui_info_line) = 'X'.
 
DATA(ld_iv_add_tadir_to_limu) = 'X'.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
DATA(ld_iv_static_deepness) = 1.
 
DATA(ld_iv_run_tcd) = ' '.
 
 
 
DATA(ld_iv_run_rta) = ' '.
 
 
DATA(ld_iv_frgui) = ' '.
 
 
DATA(ld_iv_frauth) = ' '.
 
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!