SAP Reports / Programs

BTC_SET_TRACE SAP ABAP Report - Program for Setting Work Process Trace and SQL Trace







BTC_SET_TRACE is a standard Executable ABAP Report available within your SAP system (depending on your version and release level). Below is the basic information available for this SAP report including which OBJECTS it interacts with such as TABLES, FUNCTION MODULES, INCLUDES ETC. Also check out the submitted Comments related to this SAP report or see any standard documentation available.

If you would like to execute this report or see the full code listing simply enter BTC_SET_TRACE into the relevant SAP transactions such as SE38 or SE80


ABAP code to call this SAP report using the submit statement

This report can be called from another progam/report simply by using the ABAP SUBMIT statement, see below for example ABAP code snipts of how to do this.






SUBMIT BTC_SET_TRACE. "Basic submit
SUBMIT BTC_SET_TRACE AND RETURN. "Return to original report after report execution complete
SUBMIT BTC_SET_TRACE VIA SELECTION-SCREEN. "Display selection screen of submitted report to user
    See more syntax options for the ABAP SUBMIT statement


Text pool values


Selection Text: VMC = VM Container
Selection Text: TRC_ON = Activate
Selection Text: TRC_OFF = Deactivate
Selection Text: TRC_NONE = Do Not Change
Selection Text: TABNAME = Table Name
Selection Text: SQL_ON = Activate
Selection Text: SQL_OFF = Deactivate
Selection Text: SQL_NONE = Do Not Change
Selection Text: SQL_LIST = Display SQL Trace
Selection Text: SPOOL = Print
Selection Text: SNC = Security
Selection Text: ROLL = Rolling
Selection Text: PAGE = Paging
Selection Text: NLS = Language Support
Selection Text: MAIN = Taskhandler
Selection Text: LEVEL = Trace Level
Selection Text: ITS = Internet Transaction Server
Selection Text: IPC = IPC
Selection Text: ICF = ICF
Selection Text: ENQ = Lock Management
Selection Text: EM = Extended Memory
Selection Text: DYNP = Screen Processing
Selection Text: DIAG = Dialog Processing
Selection Text: DBSL = Database (Interface)
Selection Text: DBG = Debug System
Selection Text: DB = Database
Selection Text: BATCH = Background
Selection Text: ABAP = ABAP Processing
Title: Program for Setting Work Process Trace and SQL Trace
Text Symbol: 003 = Components
Text Symbol: 002 = SQL Trace
Text Symbol: 001 = Process Trace


INCLUDES used within this REPORT BTC_SET_TRACE

INCLUDE TSKHINCL.
INCLUDE LBTCHDEF.


TABLES used within REPORT and the associated SELECT statement:





No SAP DATABASE tables are accessed within this REPORT code!


Function Modules used within report and the associated call statement:

TH_GET_OWN_WP_NO CALL FUNCTION 'TH_GET_OWN_WP_NO' IMPORTING * SUBRC = * WP_NO = * wp_pid = pid wp_index = pindex.

TH_SET_WP_TRACE CALL FUNCTION 'TH_SET_WP_TRACE' EXPORTING * wp_id = _pid trc = trc.

PERFORMANCE_TRACE_ON CALL FUNCTION 'PERFORMANCE_TRACE_ON' EXPORTING * USE_TRACE_EXCEPTIONS = USE_TRACE_EXCEPTIONS trace_user = trc_user sql_trace_on = 'X' proc_nr = _pid tab_inc = tab_inc tab_exc = tab_exc * IMPORTING * LAST_MOD_DAT = trace_options-DATe * LAST_MOD_TIME = trace_options-TIME * act_trace_user = act_trace_user * SQL_TRACE_ALREADY_ON = SQL_TRACE_ALREADY_ON * RFC_TRACE_ALREADY_ON = RFC_TRACE_ALREADY_ON * ENQ_TRACE_ALREADY_ON = ENQ_TRACE_ALREADY_ON * BUF_TRACE_ALREADY_ON = BUF_TRACE_ALREADY_ON * ST01_TRACE_ALREADY_ON = ST01_TRACE_ALREADY_ON EXCEPTIONS no_trace_selected = 1 error_trace_on = 2 trace_on_for_all = 3 trace_on_for_user = 4 sql_trace_on = 5 rfc_trace_on = 6 enqueue_trace_on = 7 buffer_trace_on = 8 error_only_prognam_or_tcode = 9 OTHERS = 11.

PERFORMANCE_TRACE_OFF CALL FUNCTION 'PERFORMANCE_TRACE_OFF' * EXPORTING * TRACE_USER = SY-UNAME * SQL_TRACE_OFF = 'X' * ENQ_TRACE_OFF = ' ' * RFC_TRACE_OFF = ' ' * BUF_TRACE_OFF = ' ' * CHECK_USER = ' ' * USE_TRACE_EXCEPTIONS = 'X' * IMPORTING * LAST_MOD_DAT = * LAST_MOD_TIME = * LAST_MOD_USER = * SQL_TRACE_ALREADY_OFF = * RFC_TRACE_ALREADY_OFF = * ENQ_TRACE_ALREADY_OFF = * BUF_TRACE_ALREADY_OFF = EXCEPTIONS no_trace_selected = 1 error_trace_off = 2 sql_trace_off = 3 rfc_trace_off = 4 enqueue_trace_off = 5 buffer_trace_off = 6 error_mod_user = 7 OTHERS = 8 .

RFC_PING CALL FUNCTION 'RFC_PING' DESTINATION 'NONE'.

RS_VARIANT_CONTENTS CALL FUNCTION 'RS_VARIANT_CONTENTS' EXPORTING report = report variant = variant * MOVE_OR_WRITE = 'W' * NO_IMPORT = ' ' * EXECUTE_DIRECT = ' ' * IMPORTING * SP = TABLES * L_PARAMS = * L_PARAMS_NONV = * L_SELOP = * L_SELOP_NONV = valutab = lt_values * OBJECTS = * FREE_SELECTIONS_DESC = * FREE_SELECTIONS_VALUE = EXCEPTIONS variant_non_existent = 1 variant_obsolete = 2 OTHERS = 3 .

SQLT_GEN_TRACE_RECORDS_NEW CALL FUNCTION 'SQLT_GEN_TRACE_RECORDS_NEW' EXPORTING * FILENAME = filter_wa = filter_wa trace_filter = trace_filter beg_date = jobhead-strtdate beg_time = jobhead-strttime client = sy-mandt * IMPORTING * N_BLOCKS = * ENQ_TRACE_TAB = * BUF_TRACE_TAB = * RFC_TRACE_TAB = TABLES sql_trace_tab = sql_trace_tab sql_bheader_tab = sql_bheader_tab EXCEPTIONS file_not_openable = 1 abort = 2 show_found_records = 3 read_error = 4 OTHERS = 5 .

SQLT_PREPARE_STATEMENTS CALL FUNCTION 'SQLT_PREPARE_STATEMENTS' TABLES sql_trace_tab = sql_trace_tab sql_bheader_tab = sql_bheader_tab EXCEPTIONS internal_error = 1 OTHERS = 2.

SQLT_WRITE_TRACE CALL FUNCTION 'SQLT_WRITE_TRACE' * EXPORTING * SORT_ORDER = TABLES sql_trace_tab = sql_trace_tab sql_bheader_tab = sql_bheader_tab EXCEPTIONS wrong_list_desc = 1 OTHERS = 2 .

GET_JOB_RUNTIME_INFO CALL FUNCTION 'GET_JOB_RUNTIME_INFO' IMPORTING * EVENTID = * EVENTPARM = * EXTERNAL_PROGRAM_ACTIVE = jobcount = jobcount jobname = jobname * STEPCOUNT = EXCEPTIONS no_runtime_info = 1 OTHERS = 2 .

BP_JOB_READ CALL FUNCTION 'BP_JOB_READ' EXPORTING job_read_jobcount = jobcount job_read_jobname = jobname job_read_opcode = btc_read_all_jobdata * JOB_STEP_NUMBER = IMPORTING job_read_jobhead = jobhead * JOBLOG_ATTRIBUTES = TABLES job_read_steplist = lt_steps * SPOOL_ATTRIBUTES = * CHANGING * RET = EXCEPTIONS invalid_opcode = 1 job_doesnt_exist = 2 job_doesnt_have_steps = 3 OTHERS = 4 .



Contribute (Add Comments)

Although this basic information may have limited use it does provide an easy to find location to store any knowledge about this program/report.







The contribute/comments section below therefore offer's an opportunity for anyone to add additional information. This can be anything from useful hints, tips and screen shots to relevant SAP notes or anything else you feel is relevant to this report.

This will then be available for everyone to easily find by simply searching on the report name BTC_SET_TRACE or its description.