SAP Function Modules

ANST_SEARCH_TRACES SAP Function module - Search Traces







ANST_SEARCH_TRACES is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name ANST_SEARCH_TRACES into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: ANST_SEARCH_TRACES
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM ANST_SEARCH_TRACES - ANST SEARCH TRACES





CALL FUNCTION 'ANST_SEARCH_TRACES' "Search Traces
  TABLES
    t_anst_note_sea =           " anst_select_traces  Select traces
    lt_trace_p =                " anst_traces_traces  Tbom for selected traces
* CHANGING
*   sw_execution =              " flag          General Flag
*   uname =                     " anst_note_sea-uname  User Name
*   description =               " anst_note_sea-description  Trace Description
*   unit =                      " anst_note_sea-unit  128 character
*   dtrace_low =                " anst_note_sea-datum  Date
*   dtrace_high =               " anst_note_sea-datum  Date
*   sw_save_trace =             " flag          General Flag
  EXCEPTIONS
    NO_TRACE = 1                "               No trace found
    .  "  ANST_SEARCH_TRACES

ABAP code example for Function Module ANST_SEARCH_TRACES





The ABAP code below is a full code listing to execute function module ANST_SEARCH_TRACES including all data declarations. The code uses 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 original method of declaring data variables up front. 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).

DATA:
it_t_anst_note_sea  TYPE STANDARD TABLE OF ANST_SELECT_TRACES,"TABLES PARAM
wa_t_anst_note_sea  LIKE LINE OF it_t_anst_note_sea ,
it_lt_trace_p  TYPE STANDARD TABLE OF ANST_TRACES_TRACES,"TABLES PARAM
wa_lt_trace_p  LIKE LINE OF it_lt_trace_p .

DATA(ld_sw_execution) = 'Check type of data required'.

SELECT single UNAME
FROM ANST_NOTE_SEA
INTO @DATA(ld_uname).


SELECT single DESCRIPTION
FROM ANST_NOTE_SEA
INTO @DATA(ld_description).


SELECT single UNIT
FROM ANST_NOTE_SEA
INTO @DATA(ld_unit).


SELECT single DATUM
FROM ANST_NOTE_SEA
INTO @DATA(ld_dtrace_low).


SELECT single DATUM
FROM ANST_NOTE_SEA
INTO @DATA(ld_dtrace_high).

DATA(ld_sw_save_trace) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_anst_note_sea to it_t_anst_note_sea.

"populate fields of struture and append to itab
append wa_lt_trace_p to it_lt_trace_p. . CALL FUNCTION 'ANST_SEARCH_TRACES' TABLES t_anst_note_sea = it_t_anst_note_sea lt_trace_p = it_lt_trace_p * CHANGING * sw_execution = ld_sw_execution * uname = ld_uname * description = ld_description * unit = ld_unit * dtrace_low = ld_dtrace_low * dtrace_high = ld_dtrace_high * sw_save_trace = ld_sw_save_trace EXCEPTIONS NO_TRACE = 1 . " ANST_SEARCH_TRACES
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_sw_execution  TYPE FLAG ,
it_t_anst_note_sea  TYPE STANDARD TABLE OF ANST_SELECT_TRACES ,
wa_t_anst_note_sea  LIKE LINE OF it_t_anst_note_sea,
ld_uname  TYPE ANST_NOTE_SEA-UNAME ,
it_lt_trace_p  TYPE STANDARD TABLE OF ANST_TRACES_TRACES ,
wa_lt_trace_p  LIKE LINE OF it_lt_trace_p,
ld_description  TYPE ANST_NOTE_SEA-DESCRIPTION ,
ld_unit  TYPE ANST_NOTE_SEA-UNIT ,
ld_dtrace_low  TYPE ANST_NOTE_SEA-DATUM ,
ld_dtrace_high  TYPE ANST_NOTE_SEA-DATUM ,
ld_sw_save_trace  TYPE FLAG .

ld_sw_execution = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_anst_note_sea to it_t_anst_note_sea.

SELECT single UNAME
FROM ANST_NOTE_SEA
INTO ld_uname.


"populate fields of struture and append to itab
append wa_lt_trace_p to it_lt_trace_p.

SELECT single DESCRIPTION
FROM ANST_NOTE_SEA
INTO ld_description.


SELECT single UNIT
FROM ANST_NOTE_SEA
INTO ld_unit.


SELECT single DATUM
FROM ANST_NOTE_SEA
INTO ld_dtrace_low.


SELECT single DATUM
FROM ANST_NOTE_SEA
INTO ld_dtrace_high.

ld_sw_save_trace = 'Check type of data required'.

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name ANST_SEARCH_TRACES or its description.