SAP Reports / Programs

CS_BOM_WRI SAP ABAP Report - Archiving BOM: Write Program







CS_BOM_WRI 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 CS_BOM_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 CS_BOM_WRI. "Basic submit
SUBMIT CS_BOM_WRI AND RETURN. "Return to original report after report execution complete
SUBMIT CS_BOM_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: SO_WERKS = D .
Selection Text: SO_STLNR = D .
Selection Text: SO_STLAN = D .
Selection Text: SO_STLAL = D .
Selection Text: SO_DATUV = Record Invalid Before
Selection Text: P_WRITST = D .
Selection Text: P_WRIPRD = D .
Selection Text: P_TPST = D .
Selection Text: P_STST = D .
Selection Text: P_SNAP = D .
Selection Text: P_PRST = D .
Selection Text: P_PROT_O = D .
Selection Text: P_PROT = D .
Selection Text: P_MAST = D .
Selection Text: P_LOEKZ = D .
Selection Text: P_KDST = D .
Selection Text: P_EQST = D .
Selection Text: P_DOST = D .
Selection Text: P_DEST = D .
Selection Text: P_DELTST = D .
Selection Text: P_DATUV = D .
Selection Text: P_COMENT = D .
Selection Text: P_AR_ILM = D .
Title: Archiving BOM: Write Program
Text Symbol: N11 = BOM &1 not archived. (Check BAdI)
Text Symbol: N05 = No object has been selected.
Text Symbol: N04 = Object not archived.
Text Symbol: N03 = Object archived.
Text Symbol: N02 = Data destruction.
Text Symbol: N01 = Snapshot has been created.
Text Symbol: 514 = A Quarter
Text Symbol: 513 = A Year
Text Symbol: 512 = A Month
Text Symbol: 511 = Choose None
Text Symbol: 510 = Select All
Text Symbol: 505 = Options
Text Symbol: 503 = Further Selection Criteria
Text Symbol: 027 = &1 of &2 BOMs have been processed





Text Symbol: 021 = Reading Bill Of Materials
Text Symbol: 002 = Bill Of Material


INCLUDES used within this REPORT CS_BOM_WRI

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:

ARCHIVE_PROTOCOL_INIT CALL FUNCTION 'ARCHIVE_PROTOCOL_INIT' EXPORTING i_detailprotocol = p_prot i_protocol_output = p_prot_o.

PROGRESS_INDICATOR CALL FUNCTION 'PROGRESS_INDICATOR' EXPORTING i_text = text-021 i_output_immediately = abap_true IMPORTING e_progress_sent = lv_progress_sent.

DB_COMMIT CALL FUNCTION 'DB_COMMIT'.

CSAR_SEL_BY_LOEKZ CALL FUNCTION 'CSAR_SEL_BY_LOEKZ' EXPORTING loekz = p_loekz sel_mast = p_mast sel_dost = p_dost sel_eqst = p_eqst sel_tpst = p_tpst sel_kdst = p_kdst sel_stst = p_stst sel_prst = p_prst TABLES it_mast = itab_mast it_dost = itab_dost it_eqst = itab_eqst it_tpst = itab_tpst it_kdst = itab_kdst it_stst = itab_stst it_prst = itab_prst it_stzu = itab_stzu it_stko = itab_stko it_stas = itab_stas it_stpo = itab_stpo it_stpu = itab_stpu it_stpn = itab_stpn so_stlnr = so_stlnr so_werks = so_werks so_stlan = so_stlan so_stlal = so_stlal EXCEPTIONS loekz_not_set = 0 no_stlty = 0 OTHERS = 0.

CSAR_SEL_BY_DATUV CALL FUNCTION 'CSAR_SEL_BY_DATUV' EXPORTING loekz = p_loekz sel_mast = p_mast sel_dost = p_dost sel_eqst = p_eqst sel_tpst = p_tpst sel_kdst = p_kdst sel_stst = p_stst sel_prst = p_prst TABLES it_mast = itab_mast it_dost = itab_dost it_eqst = itab_eqst it_tpst = itab_tpst it_kdst = itab_kdst it_stst = itab_stst it_prst = itab_prst it_stzu = itab_stzu ref_stko = ref_stko it_stas = itab_stas it_stpo = itab_stpo it_stpu = itab_stpu it_stpn = itab_stpn so_datuv = so_datuv so_stlnr = so_stlnr so_werks = so_werks so_stlan = so_stlan so_stlal = so_stlal EXCEPTIONS datuv_is_initial = 0 no_stlty = 0 OTHERS = 0.

ARCHIVE_OPEN_FOR_WRITE CALL FUNCTION 'ARCHIVE_OPEN_FOR_WRITE' EXPORTING call_delete_job_in_test_mode = gv_delete_testmode create_archive_file = gv_files_create 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 archiving_standard_violation = 5 OTHERS = 6.

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING 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_WRITE CALL FUNCTION 'ARCHIVE_PROTOCOL_WRITE'.

ARCHIVE_REGISTER_CLASS CALL FUNCTION 'ARCHIVE_REGISTER_CLASS' "note452695 EXPORTING "note452695 archive_class = 'TEXT' "note452695 archive_handle = handle. "note452695

ARCHIVE_REGISTER_CLASS CALL FUNCTION 'ARCHIVE_REGISTER_CLASS' "note452695 EXPORTING "note452695 archive_class = 'CLASSIFY' "note452695 archive_handle = handle. "note452695

ARCHIVE_REGISTER_CLASS CALL FUNCTION 'ARCHIVE_REGISTER_CLASS' "note452695 EXPORTING "note452695 archive_class = 'CHANGEDOCU' "note452695 archive_handle = handle. "note452695

ARCHIVE_REGISTER_CLASS CALL FUNCTION 'ARCHIVE_REGISTER_CLASS' "note452695 EXPORTING "note452695 archive_class = 'CU_CONFIG' "note452695 archive_handle = handle. "note452695

PROGRESS_INDICATOR CALL FUNCTION 'PROGRESS_INDICATOR' EXPORTING i_text = text-027 i_msgv1 = gv_objects_processed i_msgv2 = gv_total_object_number i_processed = gv_objects_processed i_total = gv_total_object_number i_output_immediately = abap_true IMPORTING e_progress_sent = gv_message_sent.

DB_COMMIT CALL FUNCTION 'DB_COMMIT'. "for batch processing

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_object = gv_object_identifier i_msgtype = 2 i_text = lf_text.

ARCHIVE_NEW_OBJECT CALL FUNCTION 'ARCHIVE_NEW_OBJECT' EXPORTING archive_handle = handle.

ARCHIVE_PUT_RECORD CALL FUNCTION 'ARCHIVE_PUT_RECORD' EXPORTING archive_handle = handle record = wa_stko record_flags = ' ' record_structure = 'STKOAR' EXCEPTIONS internal_error = 1 wrong_access_to_archive = 2 invalid_record_structure = 3 OTHERS = 4.






ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_object = gv_object_identifier 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.

TEXT_ARCHIVE_OBJECT CALL FUNCTION 'TEXT_ARCHIVE_OBJECT' EXPORTING archive_handle = handle id = text_id language = sy-langu name = text_name object = 'BOM' object_delete_flag = delete_flag.

CHANGEDOCU_ARCHIVE_OBJECT CALL FUNCTION 'CHANGEDOCU_ARCHIVE_OBJECT' EXPORTING archive_handle = handle objectclass = 'STUE_V' objectid = objid object_delete_flag = delete_flag.

ARCHIVE_PUT_RECORD CALL FUNCTION 'ARCHIVE_PUT_RECORD' EXPORTING archive_handle = handle record = itab_stzu record_flags = ' ' record_structure = 'STZU' EXCEPTIONS internal_error = 1 wrong_access_to_archive = 2 invalid_record_structure = 3 OTHERS = 4.

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_object = gv_object_identifier 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.

TEXT_ARCHIVE_OBJECT CALL FUNCTION 'TEXT_ARCHIVE_OBJECT' EXPORTING archive_handle = handle id = text_id language = sy-langu name = text_name object = 'BOM' object_delete_flag = delete_flag.

CHANGEDOCU_ARCHIVE_OBJECT CALL FUNCTION 'CHANGEDOCU_ARCHIVE_OBJECT' EXPORTING archive_handle = handle objectclass = 'STUE' objectid = objid object_delete_flag = delete_flag.

ARCHIVE_PUT_RECORD CALL FUNCTION 'ARCHIVE_PUT_RECORD' EXPORTING archive_handle = handle record = itab_mast record_flags = ' ' record_structure = 'MAST' EXCEPTIONS internal_error = 1 wrong_access_to_archive = 2 invalid_record_structure = 3 OTHERS = 4.

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_object = gv_object_identifier 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.

WSTAR_T415B_ARCHIVE CALL FUNCTION 'WSTAR_T415B_ARCHIVE' "T415B EXPORTING "T415B iv_archive_handle = handle "T415B iv_testarch = space "T415B is_mast = itab_mast. "T415B

ARCHIVE_PUT_RECORD CALL FUNCTION 'ARCHIVE_PUT_RECORD' EXPORTING archive_handle = handle record = itab_dost record_flags = ' ' record_structure = 'DOST' EXCEPTIONS internal_error = 1 wrong_access_to_archive = 2 invalid_record_structure = 3 OTHERS = 4.

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_object = gv_object_identifier 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_PUT_RECORD CALL FUNCTION 'ARCHIVE_PUT_RECORD' EXPORTING archive_handle = handle record = itab_eqst record_flags = ' ' record_structure = 'EQST' EXCEPTIONS internal_error = 1 wrong_access_to_archive = 2 invalid_record_structure = 3 OTHERS = 4.

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_object = gv_object_identifier 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_PUT_RECORD CALL FUNCTION 'ARCHIVE_PUT_RECORD' EXPORTING archive_handle = handle record = itab_kdst record_flags = ' ' record_structure = 'KDST' EXCEPTIONS internal_error = 1 wrong_access_to_archive = 2 invalid_record_structure = 3 OTHERS = 4.

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_object = gv_object_identifier 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_PUT_RECORD CALL FUNCTION 'ARCHIVE_PUT_RECORD' EXPORTING archive_handle = handle record = itab_prst record_flags = ' ' record_structure = 'PRST' EXCEPTIONS internal_error = 1 wrong_access_to_archive = 2 invalid_record_structure = 3 OTHERS = 4.

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_object = gv_object_identifier 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_PUT_RECORD CALL FUNCTION 'ARCHIVE_PUT_RECORD' EXPORTING archive_handle = handle record = itab_stst record_flags = ' ' record_structure = 'STST'.

ARCHIVE_PUT_RECORD



CALL FUNCTION 'ARCHIVE_PUT_RECORD' EXPORTING archive_handle = handle record = itab_tpst record_flags = ' ' record_structure = 'TPST' EXCEPTIONS internal_error = 1 wrong_access_to_archive = 2 invalid_record_structure = 3 OTHERS = 4.

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_object = gv_object_identifier 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_PUT_RECORD CALL FUNCTION 'ARCHIVE_PUT_RECORD' EXPORTING archive_handle = handle record = itab_stas record_flags = ' ' record_structure = 'STAS' EXCEPTIONS internal_error = 1 wrong_access_to_archive = 2 invalid_record_structure = 3 OTHERS = 4.

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_object = gv_object_identifier 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.

CHANGEDOCU_ARCHIVE_OBJECT CALL FUNCTION 'CHANGEDOCU_ARCHIVE_OBJECT' EXPORTING archive_handle = handle objectclass = 'STUE_V' objectid = objid object_delete_flag = delete_flag.

ARCHIVE_PUT_RECORD CALL FUNCTION 'ARCHIVE_PUT_RECORD' EXPORTING archive_handle = handle record = itab_stpo record_flags = ' ' record_structure = 'STPO' EXCEPTIONS internal_error = 1 wrong_access_to_archive = 2 invalid_record_structure = 3 OTHERS = 4.

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_object = gv_object_identifier 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.

TEXT_ARCHIVE_OBJECT CALL FUNCTION 'TEXT_ARCHIVE_OBJECT' EXPORTING archive_handle = handle id = text_id language = sy-langu name = text_name object = 'BOM' object_delete_flag = delete_flag.

CLASSIFY_ARCHIVE_OBJECT CALL FUNCTION 'CLASSIFY_ARCHIVE_OBJECT' EXPORTING archive_handle = handle object = clobj ptable = 'STPO' object_delete_flag = delete_flag.

ARCHIVE_PUT_RECORD CALL FUNCTION 'ARCHIVE_PUT_RECORD' "CUOB EXPORTING "CUOB archive_handle = handle "CUOB record = itab_cuob "CUOB record_flags = ' ' "CUOB record_structure = 'CUOB'. "CUOB

ARCHIVE_PUT_RECORD CALL FUNCTION 'ARCHIVE_PUT_RECORD' EXPORTING archive_handle = handle record = itab_stpu record_flags = ' ' record_structure = 'STPU'.

ARCHIVE_PUT_RECORD CALL FUNCTION 'ARCHIVE_PUT_RECORD' EXPORTING archive_handle = handle record = itab_stpn record_flags = ' ' record_structure = 'STPN' EXCEPTIONS internal_error = 1 wrong_access_to_archive = 2 invalid_record_structure = 3 OTHERS = 4.

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_object = gv_object_identifier 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_SAVE_OBJECT CALL FUNCTION 'ARCHIVE_SAVE_OBJECT' EXPORTING archive_handle = handle EXCEPTIONS file_io_error = 1 internal_error = 2 open_error = 3 termination_requested = 4 wrong_access_to_archive = 5 data_object_not_saved = 6 OTHERS = 7.

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_object = gv_object_identifier 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 = gv_object_identifier i_msgtype = 1 i_text = lf_text.

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

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

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_text = text-n05.

PROGRESS_INDICATOR CALL FUNCTION 'PROGRESS_INDICATOR' EXPORTING i_text = text-027 i_msgv1 = gv_objects_processed i_msgv2 = gv_total_object_number i_processed = gv_objects_processed i_total = gv_total_object_number i_output_immediately = abap_true IMPORTING e_progress_sent = gv_message_sent.

DB_COMMIT CALL FUNCTION 'DB_COMMIT'. "for batch processing

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_object = gv_object_identifier i_text = lf_text i_msgtype = 2.

ARCHIVE_WRITE_STATISTICS CALL FUNCTION 'ARCHIVE_WRITE_STATISTICS' EXPORTING archive_handle = handle.

ARCHIVE_PROTOCOL_WRITE_APPL CALL FUNCTION 'ARCHIVE_PROTOCOL_WRITE_APPL'.

ARCHIVE_CLOSE_FILE CALL FUNCTION 'ARCHIVE_CLOSE_FILE' EXPORTING archive_handle = handle.

WSTAR_T415B_SELECT CALL FUNCTION 'WSTAR_T415B_SELECT' "t415B TABLES "t415B it_mast = mast_i1. "t415B



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