SAP Reports / Programs

BC_SBAL_WRI SAP ABAP Report - Archive Application Logs: Write Program







BC_SBAL_WRI is a standard Executable ABAP Report available within your SAP system (depending on your version and release level). It is used for The archiving object BC_SBAL is used to archive application logs...see full standard documentation available for this report. Also check out the submitted Comments related to this SAP report and the details below to see which OBJECTS it interacts with such as TABLES, FUNCTION MODULES, INCLUDES ETC.

If you would like to execute this report or see the full code listing simply enter BC_SBAL_WRI 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 BC_SBAL_WRI. "Basic submit
SUBMIT BC_SBAL_WRI AND RETURN. "Return to original report after report execution complete
SUBMIT BC_SBAL_WRI 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: S_SUB = D .
Selection Text: S_OBJ = D .
Selection Text: S_EXT = D .
Selection Text: P_WRITST = D .
Selection Text: P_WRIPRD = D .
Selection Text: P_SNAP = D .
Selection Text: P_PROT_O = D .
Selection Text: P_PROT = D .
Selection Text: P_DEST = D .
Selection Text: P_DELTST = D .
Selection Text: P_COMENT = D .
Selection Text: P_AR_ILM = D .
Selection Text: S_PCL = Problem Class
Selection Text: S_LOG_NM = Log Number
Selection Text: P_USER = User
Selection Text: P_TCODE = Transaction Code
Selection Text: P_PROG = Program
Selection Text: P_ENDTIM = Creation Time: To
Selection Text: P_ENDDAT = Creation Date: To
Selection Text: P_BEGTIM = Creation Time: From
Selection Text: P_BEGDAT = Creation Date: From
Title: Archive Application Logs: Write Program
Text Symbol: SEL = Application Logs
Text Symbol: RES = Further Selection Criteria
Text Symbol: N03 = Log number archivable
Text Symbol: N02 = Retention Time Reached
Text Symbol: N01 = Snapshot archived
Text Symbol: END = To (Date/Time)
Text Symbol: CRE = Log Triggered By
Text Symbol: BEG = From (Date/Time)
Text Symbol: 024 = &1 % (&2 of &3) of the application logs processed
Text Symbol: 023 = Archiving or deletion run is already running
Text Symbol: 022 = Reading data


INCLUDES used within this REPORT BC_SBAL_WRI

INCLUDE SBALTYPE.
INCLUDE SBAL_ACCESS.
INCLUDE ARCH_WRITE_PRG_STANDARD2.


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:

HELP_VALUES_GET_WITH_TABLE CALL FUNCTION 'HELP_VALUES_GET_WITH_TABLE' "#EC FB_OLDED EXPORTING cucol = 0 curow = 0 display = space fieldname = 'ALUSER' tabname = 'BALHDR' IMPORTING select_value = balhdr-aluser TABLES fields = fields valuetab = values EXCEPTIONS OTHERS = 0.

HELP_OBJECT_SHOW_FOR_FIELD CALL FUNCTION 'HELP_OBJECT_SHOW_FOR_FIELD' EXPORTING called_by_tcode = sy-tcode called_by_program = l_repid called_by_dynp = sy-dynnr "#EC DOM_EQUAL called_for_tab = 'BALHDR' called_for_field = 'LOGNUMBER' EXCEPTIONS OTHERS = 0.

ARCHIVE_PROTOCOL_INIT CALL FUNCTION 'ARCHIVE_PROTOCOL_INIT' EXPORTING i_detailprotocol = p_prot.

ENQUEUE_ESRDIRE CALL FUNCTION 'ENQUEUE_ESRDIRE' EXPORTING name = g_name EXCEPTIONS OTHERS = 1.

ARCHIVE_OPEN_FOR_WRITE CALL FUNCTION 'ARCHIVE_OPEN_FOR_WRITE' EXPORTING call_delete_job_in_test_mode = p_deltst create_archive_file = p_wriprd object = c_object comments = p_coment do_not_delete_data = l_not_delete destroy = l_destroy IMPORTING archive_handle = handle EXCEPTIONS internal_error = 1 object_not_found = 2 open_error = 3 not_authorized = 4 others = 5.

PROGRESS_INDICATOR CALL FUNCTION 'PROGRESS_INDICATOR' EXPORTING i_text = text-022 i_output_immediately = 'X'.

BAL_DB_LOAD CALL FUNCTION 'BAL_DB_LOAD' EXPORTING i_t_log_header = g_t_balhdr_convert IMPORTING e_t_log_handle = g_t_log_handle EXCEPTIONS OTHERS = 0.

BAL_DB_SAVE CALL FUNCTION 'BAL_DB_SAVE' EXPORTING i_t_log_handle = g_t_log_handle.

BAL_DB_SEARCH CALL FUNCTION 'BAL_DB_SEARCH' EXPORTING i_s_log_filter = g_s_log_filter IMPORTING e_t_log_header = g_t_modified.

PROGRESS_INDICATOR CALL FUNCTION 'PROGRESS_INDICATOR' EXPORTING i_text = text-024 i_processed = g_processed i_total = g_number_of_logs i_output_immediately = 'X'.

PROGRESS_INDICATOR CALL FUNCTION 'PROGRESS_INDICATOR' EXPORTING i_text = text-024 i_processed = g_processed i_total = g_number_of_logs IMPORTING e_progress_sent = g_progress_sent.

DB_COMMIT CALL FUNCTION 'DB_COMMIT'.

PROGRESS_INDICATOR CALL FUNCTION 'PROGRESS_INDICATOR' EXPORTING i_text = text-024 i_processed = g_processed i_total = g_number_of_logs i_output_immediately = 'X' IMPORTING e_progress_sent = g_progress_sent.

DB_COMMIT CALL FUNCTION 'DB_COMMIT'.

PROGRESS_INDICATOR CALL FUNCTION 'PROGRESS_INDICATOR' EXPORTING i_text = text-024 i_processed = g_processed i_total = g_number_of_logs i_output_immediately = 'X'.

ARCHIVE_WRITE_STATISTICS CALL FUNCTION 'ARCHIVE_WRITE_STATISTICS' EXPORTING archive_handle = handle EXCEPTIONS internal_error = 1 OTHERS = 2.

ARCHIVE_GET_STATISTICS CALL FUNCTION 'ARCHIVE_GET_STATISTICS' EXPORTING archive_handle = handle IMPORTING archive_document = stat_sess TABLES statistics_data = stat_tab EXCEPTIONS internal_error = 1 wrong_access_to_archive = 2 OTHERS = 3.

ARCHIVE_PROTOCOL_WRITE CALL FUNCTION 'ARCHIVE_PROTOCOL_WRITE'.

ARCHIVE_CLOSE_FILE





CALL FUNCTION 'ARCHIVE_CLOSE_FILE' EXPORTING archive_handle = handle EXCEPTIONS internal_error = 1 wrong_access_to_archive = 2 OTHERS = 3.

ARCHIVE_NEW_OBJECT CALL FUNCTION 'ARCHIVE_NEW_OBJECT' EXPORTING archive_handle = handle object_id = data_object_id EXCEPTIONS internal_error = 1 wrong_access_to_archive = 2 OTHERS = 3.

ARCHIVE_PUT_RECORD CALL FUNCTION 'ARCHIVE_PUT_RECORD' EXPORTING archive_handle = handle record_structure = 'BALHDR' record = .

ARCHIVE_PUT_TABLE CALL FUNCTION 'ARCHIVE_PUT_TABLE' EXPORTING archive_handle = handle record_structure = 'BALDAT' TABLES table = g_t_baldat_to_archive.

ARCHIVE_PUT_TABLE CALL FUNCTION 'ARCHIVE_PUT_TABLE' EXPORTING archive_handle = handle record_structure = 'BAL_INDX' TABLES table = g_t_balindx_to_archive.

ARCHIVE_SAVE_OBJECT CALL FUNCTION 'ARCHIVE_SAVE_OBJECT' EXPORTING archive_handle = handle EXCEPTIONS termination_requested = 4 data_object_not_saved = 6.

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_object = l_objnr i_msgtype = 2 i_msgid = sy-msgid i_msgno = sy-msgno I_MSGV1 = sy-msgv1 I_MSGV2 = sy-msgv2 I_MSGV3 = sy-msgv3 I_MSGV4 = sy-msgv4.

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_object = l_objnr i_msgtype = 1 i_text = lf_text.

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_object = l_objnr i_msgtype = 1 i_text = lf_text.

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_object = l_objnr i_msgtype = 1 i_text = lf_text.



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 BC_SBAL_WRI or its description.