SAP Reports / Programs | Archiving | SAP Utilities | Archiving(IS-U-TO-ARC) SAP IS

REAARCH_READ_HEAD SAP ABAP Report - Write Billing Documents to the Archive







REAARCH_READ_HEAD is a standard Executable ABAP Report available within your SAP system (depending on your version and release level). It is used for Archive Billing Document Headers This report carries out the second step in archiving billing document headers...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 REAARCH_READ_HEAD 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 REAARCH_READ_HEAD. "Basic submit
SUBMIT REAARCH_READ_HEAD AND RETURN. "Return to original report after report execution complete
SUBMIT REAARCH_READ_HEAD 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: SE_VTRG = D .
Selection Text: SE_VKONT = D .
Selection Text: SE_BUKRS = D .
Selection Text: SE_BELNR = 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_LFZTIM = D .
Selection Text: P_LFZDAT = D .
Selection Text: P_LAUFZ = D .
Selection Text: P_DEST = D .
Selection Text: P_DELTST = D .
Selection Text: P_COMENT = D .
Selection Text: P_AR_ILM = D .
Selection Text: SE_SIMT = Selection of Simulation Type
Selection Text: P_SIMT3 = All
Selection Text: P_SIMT2 = Simulated
Selection Text: P_SIMT1 = Billed
Title: Write Billing Documents to the Archive
Text Symbol: S08 = All
Text Symbol: S07 = Simulated
Text Symbol: S06 = Billed
Text Symbol: S05 = Selection of Billing Documents
Text Symbol: S04 = Additional restriction of archiving quantity
Text Symbol: S02 = Runtime Restriction
Text Symbol: 002 = &3 Billing Documents Archived


INCLUDES used within this REPORT REAARCH_READ_HEAD

INCLUDE: REAARCH_READ_HEAD01,
MEAMAC00,
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_LINE_DETAIL CALL FUNCTION 'ARCHIVE_PROTOCOL_LINE_DETAIL'.

ARCHIVE_PROTOCOL_INIT CALL FUNCTION 'ARCHIVE_PROTOCOL_INIT' EXPORTING i_detailprotocol = p_prot.

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_msgtype = '2' i_msgid = 'EMDUS' i_msgno = '601'.

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_msgtype = '2' i_msgid = 'EMDUS' i_msgno = '602'.

ARCHIVE_WRITE_STATISTICS CALL FUNCTION 'ARCHIVE_WRITE_STATISTICS' EXPORTING archive_handle = gv_archive_data-handle.

ARCHIVE_PROTOCOL_WRITE CALL FUNCTION 'ARCHIVE_PROTOCOL_WRITE'.

ARCHIVE_OPEN_FOR_WRITE CALL FUNCTION 'ARCHIVE_OPEN_FOR_WRITE' EXPORTING call_delete_job_in_test_mode = p_deltst object = co_isu_bill_archive_obj create_archive_file = p_wriprd comments = p_coment do_not_delete_data = gv_not_delete output_sel_screen_when_dialog = space output_sel_screen_when_batch = co_true destroy = gv_destroy IMPORTING archive_handle = gv_archive_data-handle EXCEPTIONS OTHERS = 1.

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_GET_INFORMATION CALL FUNCTION 'ARCHIVE_GET_INFORMATION' EXPORTING archive_handle = gv_archive_data-handle IMPORTING archive_name = gv_archive_data-name EXCEPTIONS OTHERS = 1.

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_msgtype = '2' i_msgid = 'EARC' i_msgno = '201'.

ARCHIVE_CLOSE_FILE CALL FUNCTION 'ARCHIVE_CLOSE_FILE' EXPORTING archive_handle = gv_archive_data-handle EXCEPTIONS OTHERS = 1.

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_msgtype = '2' i_msgid = 'EARC' i_msgno = '202'.

ISU_DB_ERCHARC_CURSOR CALL FUNCTION 'ISU_DB_ERCHARC_CURSOR' EXPORTING x_archive_status = co_bill_head_archivable IMPORTING y_erch_arc_cursor = ercharc_cursor TABLES x_se_belnr = tab_sel_belnr x_se_vkont = tab_sel_vkont x_se_vtrg = tab_sel_vtrg x_se_bukrs = tab_sel_bukrs x_se_simt = tab_sel_simt.

PROGRESS_INDICATOR CALL FUNCTION 'PROGRESS_INDICATOR' EXPORTING i_text = text-002 i_total = li_num_entries_processed i_output_immediately = space.

PROGRESS_INDICATOR CALL FUNCTION 'PROGRESS_INDICATOR' EXPORTING i_text = text-002 i_total = li_num_entries_processed i_output_immediately = co_true.

ISU_DB_SELECT_MULTIPLE_BILL CALL FUNCTION 'ISU_DB_SELECT_MULTIPLE_BILL' EXPORTING xt_erch_key = xt_erch_key x_dberchz = space x_dberchr = space x_dbercht = space x_dberchu = space x_dberdtax = space x_dberche = space IMPORTING y_bill_documents = yt_arch_all EXCEPTIONS not_found = 1 OTHERS = 2.

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_NEW_OBJECT CALL FUNCTION 'ARCHIVE_NEW_OBJECT' "New Object register EXPORTING archive_handle = gv_archive_data-handle object_id = lc_archive_index EXCEPTIONS OTHERS = 1.

ARCHIVE_PROTOCOL_COLLECT





CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_object = -erch-belnr i_msgtype = '2' i_msgid = 'EARC' i_msgno = '232'.

ARCHIVE_PUT_RECORD CALL FUNCTION 'ARCHIVE_PUT_RECORD' EXPORTING archive_handle = gv_archive_data-handle record_flags = co_archive_flags record_structure = 'ERCH' record = -erch EXCEPTIONS OTHERS = 1.

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_object = -erch-belnr i_msgtype = '2' i_msgid = 'EARC' i_msgno = '233'.

ARCHIVE_PUT_TABLE CALL FUNCTION 'ARCHIVE_PUT_TABLE' EXPORTING archive_handle = gv_archive_data-handle record_structure = 'ERCHO' TABLES table = -iercho 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 = -erch-belnr i_msgtype = '2' i_msgid = 'EARC' i_msgno = '233'.

ARCHIVE_PUT_TABLE CALL FUNCTION 'ARCHIVE_PUT_TABLE' EXPORTING archive_handle = gv_archive_data-handle record_structure = 'ERCHC' TABLES table = -ierchc 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 = -erch-belnr i_msgtype = '2' i_msgid = 'EARC' i_msgno = '233'.

ARCHIVE_PUT_TABLE CALL FUNCTION 'ARCHIVE_PUT_TABLE' EXPORTING archive_handle = gv_archive_data-handle record_structure = 'ERCHP' TABLES table = -ierchp 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 = -erch-belnr i_msgtype = '2' i_msgid = 'EARC' i_msgno = '233'.

ARCHIVE_PUT_TABLE CALL FUNCTION 'ARCHIVE_PUT_TABLE' EXPORTING archive_handle = gv_archive_data-handle record_structure = 'DBERCHV' TABLES table = -idberchv 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 = -erch-belnr i_msgtype = '2' i_msgid = 'EARC' i_msgno = '233'.

ARCHIVE_PUT_RECORD CALL FUNCTION 'ARCHIVE_PUT_RECORD' EXPORTING archive_handle = gv_archive_data-handle record_structure = 'ETAXERCH' record = -etaxerch EXCEPTIONS OTHERS = 1.

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_object = -erch-belnr i_msgtype = '2' i_msgid = 'EARC' i_msgno = '233'.

ARCHIVE_PUT_RECORD CALL FUNCTION 'ARCHIVE_PUT_RECORD' EXPORTING archive_handle = gv_archive_data-handle record_flags = co_archive_flags record_structure = 'EMDUSDRQHEAD' record = -head EXCEPTIONS OTHERS = 1.

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_object = -erch-belnr i_msgtype = '2' i_msgid = 'EARC' i_msgno = '233'.

ARCHIVE_PUT_TABLE CALL FUNCTION 'ARCHIVE_PUT_TABLE' EXPORTING archive_handle = gv_archive_data-handle record_structure = 'EMDUSDRQITEM' TABLES table = -item_tab 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 = -erch-belnr i_msgtype = '2' i_msgid = 'EARC' i_msgno = '233'.

ARCHIVE_PUT_TABLE CALL FUNCTION 'ARCHIVE_PUT_TABLE' EXPORTING archive_handle = gv_archive_data-handle record_structure = 'EMDUSDRQINPUT' TABLES table = -input_tab 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 = -erch-belnr i_msgtype = '2' i_msgid = 'EARC' i_msgno = '233'.

ARCHIVE_PUT_TABLE CALL FUNCTION 'ARCHIVE_PUT_TABLE' EXPORTING archive_handle = gv_archive_data-handle record_structure = 'EMDUSDRQRESULT' TABLES table = -result_tab 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 = -erch-belnr i_msgtype = '2' i_msgid = 'EARC' i_msgno = '233'.

ARCHIVE_PUT_TABLE CALL FUNCTION 'ARCHIVE_PUT_TABLE' EXPORTING archive_handle = gv_archive_data-handle record_structure = 'EMDUSDRQEXCL' TABLES table = -excl_tab 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 = -erch-belnr i_msgtype = '2' i_msgid = 'EARC' i_msgno = '233'.

ARCHIVE_SAVE_OBJECT CALL FUNCTION 'ARCHIVE_SAVE_OBJECT' EXPORTING archive_handle = gv_archive_data-handle EXCEPTIONS termination_requested = 1 data_object_not_saved = 2 OTHERS = 3.

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_object = -erch-belnr i_msgtype = '2' i_msgid = 'EARC' i_msgno = '205'.

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_object = -erch-belnr 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 = -erch-belnr 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 = -erch-belnr i_msgtype = '1' i_msgid = 'EARC' i_msgno = '243' i_msgv1 = -erch-gpartner i_msgv2 = -erch-vkont i_msgv3 = -erch-vertrag.

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_object = -erch-belnr i_msgtype = '1' i_msgid = 'EARC' i_msgno = '601'.

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_object = -erch-belnr i_msgtype = '1' i_msgid = 'EARC' i_msgno = '602'.

ISU_DB_ERCHARC_MULTIPLE_UPDATE CALL FUNCTION 'ISU_DB_ERCHARC_MULTIPLE_UPDATE' EXPORTING x_upd_mode = co_upd_update TABLES xt_ercharc = xt_ercharc EXCEPTIONS OTHERS = 1.

DB_COMMIT CALL FUNCTION 'DB_COMMIT'.

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_object = -belnr i_msgtype = '2' i_msgid = 'EARC' i_msgno = '238'.



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