SAP Reports / Programs

RPASR_PA_WRITE SAP ABAP Report - Archiving/Destruction: Write Program for Employee Processes







RPASR_PA_WRITE is a standard Executable ABAP Report available within your SAP system (depending on your version and release level). It is used for You can use this program to archive completed employee processes (application type PA) that you no longer require in the database...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 RPASR_PA_WRITE 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 RPASR_PA_WRITE. "Basic submit
SUBMIT RPASR_PA_WRITE AND RETURN. "Return to original report after report execution complete
SUBMIT RPASR_PA_WRITE 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: PROTOCOL = D .
Selection Text: P_AR_ILM = D .
Selection Text: P_COMENT = D .
Selection Text: P_COMPDT = D .
Selection Text: P_DEST = D .
Selection Text: S_MOLGA = D .
Selection Text: S_PERNR = D .
Selection Text: S_PROC = D .
Selection Text: TESTRUN = D .
Title: Archiving/Destruction: Write Program for Employee Processes
Text Symbol: 001 = Employee Processes
Text Symbol: 002 = &1% of processes (&2 of &3) have been archived


INCLUDES used within this REPORT RPASR_PA_WRITE

No INCLUDES are used within this REPORT code!


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:

SELECT_OPTIONS_RESTRICT CALL FUNCTION 'SELECT_OPTIONS_RESTRICT' EXPORTING restriction = restrict.

ARCHIVE_PROTOCOL_LINE_DETAIL CALL FUNCTION 'ARCHIVE_PROTOCOL_LINE_DETAIL'.

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

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_msgtype = 3 i_msgid = 'HRASR00_ARCHIVE' i_msgno = '009' " No authorizations to execute program &1.

ARCHIVE_PROTOCOL_WRITE CALL FUNCTION 'ARCHIVE_PROTOCOL_WRITE'. " Write to spool as no further processing will be done.

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_msgtype = 3 i_msgid = 'HRASR00_ARCHIVE' i_msgno = '003'. " The system did not find any processes that match your selection criteria

ARCHIVE_PROTOCOL_WRITE CALL FUNCTION 'ARCHIVE_PROTOCOL_WRITE'. " Write to spool as no further processing will be done.

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_object = lv_object_text i_msgtype = 2 i_msgid = 'HRASR00_ARCHIVE' i_msgno = '002'. " No authorization for process

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 = 'HRASR_PA' comments = p_coment do_not_delete_data = lv_no_delete destroy = lv_destroy IMPORTING archive_handle = lv_arch_handle.

ARCHIVE_NEW_OBJECT CALL FUNCTION 'ARCHIVE_NEW_OBJECT' EXPORTING archive_handle = lv_arch_handle object_id = ls_process-case_guid.

ARCHIVE_PUT_TABLE CALL FUNCTION 'ARCHIVE_PUT_TABLE' EXPORTING archive_handle = lv_arch_handle record_structure = 'POBJD_LEVEL' TABLES table = lt_level_record.

ARCHIVE_PUT_RECORD CALL FUNCTION 'ARCHIVE_PUT_RECORD' EXPORTING archive_handle = lv_arch_handle record = ls_objects record_structure = 'POBJD_OBJECTS'.

ARCHIVE_PUT_RECORD CALL FUNCTION 'ARCHIVE_PUT_RECORD' EXPORTING archive_handle = lv_arch_handle record = ls_contcaselnk_proc record_structure = 'T5ASRCONTCASELNK'.

LOIO_ARCHIVE_OBJECT CALL FUNCTION 'LOIO_ARCHIVE_OBJECT' EXPORTING archive_handle = lv_arch_handle class = ls_contcaselnk_proc-class objid = ls_contcaselnk_proc-guid * CLIENT = SY-MANDT object_delete_flag = 'X' * ARCHIVE_REIOS = 'X' * ARCHIVE_PHIOS = 'X' * KEEP_CONTENT = ' ' EXCEPTIONS wrong_access_to_archive = 1 class_not_initialized = 2 OTHERS = 3.

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_object = lv_object_text i_msgtype = 3 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 = lv_arch_handle record = ls_process record_structure = 'T5ASRPROCESSES'.

ARCHIVE_PUT_RECORD CALL FUNCTION 'ARCHIVE_PUT_RECORD' EXPORTING archive_handle = lv_arch_handle record = ls_proc_case record_structure = 'SCMG_T_CASE'.

ARCHIVE_PUT_RECORD CALL FUNCTION 'ARCHIVE_PUT_RECORD' EXPORTING archive_handle = lv_arch_handle record = ls_proc_case_attr record_structure = 'SCMG_T_CASE_ATTR'.

ARCHIVE_PUT_RECORD





CALL FUNCTION 'ARCHIVE_PUT_RECORD' EXPORTING archive_handle = lv_arch_handle record = ls_prel_proc record_structure = 'SCMGPREL_CLNT'.

ARCHIVE_PUT_RECORD CALL FUNCTION 'ARCHIVE_PUT_RECORD' EXPORTING archive_handle = lv_arch_handle record = ls_contcaselnk_scn record_structure = 'T5ASRCONTCASELNK'.

LOIO_ARCHIVE_OBJECT CALL FUNCTION 'LOIO_ARCHIVE_OBJECT' EXPORTING archive_handle = lv_arch_handle class = ls_contcaselnk_scn-class objid = ls_contcaselnk_scn-guid * CLIENT = SY-MANDT object_delete_flag = 'X' * ARCHIVE_REIOS = 'X' * ARCHIVE_PHIOS = 'X' * KEEP_CONTENT = ' ' EXCEPTIONS wrong_access_to_archive = 1 class_not_initialized = 2 OTHERS = 3.

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_object = lv_object_text i_msgtype = 3 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 = lv_arch_handle record = ls_scenario record_structure = 'T5ASRSCENARIOS'.

ARCHIVE_PUT_RECORD CALL FUNCTION 'ARCHIVE_PUT_RECORD' EXPORTING archive_handle = lv_arch_handle record = ls_scn_case record_structure = 'SCMG_T_CASE'.

ARCHIVE_PUT_RECORD CALL FUNCTION 'ARCHIVE_PUT_RECORD' EXPORTING archive_handle = lv_arch_handle record = ls_scenario_case_attr record_structure = 'SCMG_T_CASE_ATTR'.

ARCHIVE_PUT_RECORD CALL FUNCTION 'ARCHIVE_PUT_RECORD' EXPORTING archive_handle = lv_arch_handle record = ls_prel_scn record_structure = 'SCMGPREL_CLNT'.

ARCHIVE_PUT_RECORD CALL FUNCTION 'ARCHIVE_PUT_RECORD' EXPORTING archive_handle = lv_arch_handle record = ls_stepdetails record_structure = 'T5ASRSTEPDETAILS'.

ARCHIVE_PUT_RECORD CALL FUNCTION 'ARCHIVE_PUT_RECORD' EXPORTING archive_handle = lv_arch_handle record = ls_contcaselnk_stp record_structure = 'T5ASRCONTCASELNK'.

LOIO_ARCHIVE_OBJECT CALL FUNCTION 'LOIO_ARCHIVE_OBJECT' EXPORTING archive_handle = lv_arch_handle class = ls_contcaselnk_stp-class objid = ls_contcaselnk_stp-guid * CLIENT = SY-MANDT object_delete_flag = 'X' * ARCHIVE_REIOS = 'X' * ARCHIVE_PHIOS = 'X' * KEEP_CONTENT = ' ' EXCEPTIONS wrong_access_to_archive = 1 class_not_initialized = 2 OTHERS = 3.

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_object = lv_object_text i_msgtype = 3 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 = lv_arch_handle record = ls_doccaselnk record_structure = 'T5ASRDOCCASELNK'.

ARCHIVE_PUT_RECORD CALL FUNCTION 'ARCHIVE_PUT_RECORD' EXPORTING archive_handle = lv_arch_handle record = ls_documents record_structure = 'T5ASRDOCUMENTS'.

LOIO_ARCHIVE_OBJECT CALL FUNCTION 'LOIO_ARCHIVE_OBJECT' EXPORTING archive_handle = lv_arch_handle class = ls_documents-class objid = ls_documents-guid * CLIENT = SY-MANDT object_delete_flag = 'X' * ARCHIVE_REIOS = 'X' * ARCHIVE_PHIOS = 'X' * KEEP_CONTENT = ' ' EXCEPTIONS wrong_access_to_archive = 1 class_not_initialized = 2 OTHERS = 3.

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_object = lv_object_text i_msgtype = 3 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 = lv_arch_handle record = ls_step record_structure = 'T5ASRSTEPS'.

ARCHIVE_PUT_RECORD CALL FUNCTION 'ARCHIVE_PUT_RECORD' EXPORTING archive_handle = lv_arch_handle record = ls_step_case record_structure = 'SCMG_T_CASE'.

ARCHIVE_PUT_RECORD CALL FUNCTION 'ARCHIVE_PUT_RECORD' EXPORTING archive_handle = lv_arch_handle record = ls_step_case_attr record_structure = 'SCMG_T_CASE_ATTR'.

ARCHIVE_PUT_RECORD CALL FUNCTION 'ARCHIVE_PUT_RECORD' EXPORTING archive_handle = lv_arch_handle record = ls_prel_step record_structure = 'SCMGPREL_CLNT'.




ARCHIVE_SAVE_OBJECT CALL FUNCTION 'ARCHIVE_SAVE_OBJECT' EXPORTING archive_handle = lv_arch_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 = lv_object_text i_msgtype = 1 i_msgid = 'HRASR00_ARCHIVE' i_msgno = '004'. " Process was archived

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_object = lv_object_text i_msgtype = 1 i_msgid = 'HRASR00_ARCHIVE' i_msgno = '005'. " Retention period end reached

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_msgtype = 3 i_msgid = 'HRASR00_ARCHIVE' i_msgno = '000' " The interruption request for write program was received on &1 at &2 (&3) i_msgv1 = lv_interrupt_date i_msgv2 = lv_interrupt_time i_msgv3 = lv_interrupt_timestamp.

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_object = lv_object_text i_msgtype = 2 i_msgid = 'HRASR00_ARCHIVE' i_msgno = '006'. " Process was not archived due to interruption request

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

PROGRESS_INDICATOR CALL FUNCTION 'PROGRESS_INDICATOR' EXPORTING i_text = text-002 "&1% (&2 of &3) of the processes have been archived i_processed = lv_objects_processed i_total = lv_total_of_objects IMPORTING e_progress_sent = lv_progress_send.

DB_COMMIT CALL FUNCTION 'DB_COMMIT'. "otherwise message will not appear in the job-log

PROGRESS_INDICATOR CALL FUNCTION 'PROGRESS_INDICATOR' EXPORTING i_text = text-002 "&1% (&2 of &3) of the processes have been archived i_processed = lv_objects_processed i_total = lv_total_of_objects i_output_immediately = 'X'. "force the progress output

ARCHIVE_WRITE_STATISTICS CALL FUNCTION 'ARCHIVE_WRITE_STATISTICS' EXPORTING archive_handle = lv_arch_handle.

ARCHIVE_PROTOCOL_WRITE CALL FUNCTION 'ARCHIVE_PROTOCOL_WRITE'.

ARCHIVE_CLOSE_FILE CALL FUNCTION 'ARCHIVE_CLOSE_FILE' EXPORTING archive_handle = lv_arch_handle.

TEXT_ARCHIVE_OBJECT CALL FUNCTION 'TEXT_ARCHIVE_OBJECT' EXPORTING archive_handle = p_archive_handle * CLIENT = SY-MANDT id = texts_line-header-tdid language = texts_line-header-tdspras name = texts_line-header-tdname object = texts_line-header-tdobject object_delete_flag = 'X' EXCEPTIONS wrong_access_to_archive = 1 OTHERS = 2.

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_object = lv_object_text i_msgtype = 3 i_msgid = sy-msgid i_msgno = sy-msgno i_msgv1 = sy-msgv1 i_msgv2 = sy-msgv2 i_msgv3 = sy-msgv3 i_msgv4 = sy-msgv4.

LOIO_ARCHIVE_OBJECT CALL FUNCTION 'LOIO_ARCHIVE_OBJECT' EXPORTING archive_handle = p_archive_handle class = ls_docid-class objid = ls_docid-objid * CLIENT = SY-MANDT object_delete_flag = 'X' * ARCHIVE_REIOS = 'X' * ARCHIVE_PHIOS = 'X' * KEEP_CONTENT = ' ' EXCEPTIONS wrong_access_to_archive = 1 class_not_initialized = 2 OTHERS = 3.

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_object = lv_object_text i_msgtype = 3 i_msgid = sy-msgid i_msgno = sy-msgno i_msgv1 = sy-msgv1 i_msgv2 = sy-msgv2 i_msgv3 = sy-msgv3 i_msgv4 = sy-msgv4.



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