SAP Reports / Programs | Materials Management | Inventory Management(MM-IM) SAP MM

RM07MARCS SAP ABAP Report - Archiving Material Documents: Write Program







RM07MARCS is a standard Executable ABAP Report available within your SAP system (depending on your version and release level). It is used for Program RM07MARCS archives the material documents of inventory management...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 RM07MARCS 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 RM07MARCS. "Basic submit
SUBMIT RM07MARCS AND RETURN. "Return to original report after report execution complete
SUBMIT RM07MARCS 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_PROJ = 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: POS = D .
Selection Text: S_WERKS = Plant
Selection Text: S_VGART = Transaction/Event Type
Selection Text: S_MJAHR = Material Document Year
Selection Text: S_MBLNR = Material Document
Selection Text: S_BUDAT = Posting Date
Selection Text: SET_EPRJ = Exclude Project
Title: Archiving Material Documents: Write Program
Text Symbol: T01 = Archiving of Material Documents for Inventory Management
Text Symbol: S03 = Retail: Archiving of POS Documents for Inventory Management
Text Symbol: S02 = Restrictions
Text Symbol: S01 = Material Documents
Text Symbol: N02 = Persist duration reached
Text Symbol: N01 = Snapshot archived
Text Symbol: M02 = Point Of Sale/Cash Sale - Documents
Text Symbol: M01 = You do not have authorization for all plants
Text Symbol: I09 = / Archiving Run Interrupted
Text Symbol: I08 = Archiving Run Complete
Text Symbol: I07 = &2 material documents archived
Text Symbol: I06 = Start of archiving run
Text Symbol: I05 = Material document selected
Text Symbol: I04 = Material document archived
Text Symbol: I03 = Material document archived and deleted
Text Symbol: I02 = You do not have authorization for this plant: '
Text Symbol: I01 = Object 'M_MSEG_WMB', activity '06', user '
Text Symbol: E04 = Material document cannot be archived
Text Symbol: E03 = Material documents from &1 &2 not archived/run canceled
Text Symbol: E02 = Material document not yet fully updated -> cannot be archived





Text Symbol: E01 = The selection is being changed due to insufficient authorization
Text Symbol: 110 = PS: Project
Text Symbol: 003 = Material Doc. Archivable


INCLUDES used within this REPORT RM07MARCS

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_APPL CALL FUNCTION 'ARCHIVE_PROTOCOL_INIT_APPL' EXPORTING i_detailprotocol = p_prot.

DYNSQL_GENERATE_WHERE_CLAUSE CALL FUNCTION 'DYNSQL_GENERATE_WHERE_CLAUSE' EXPORTING fieldname_key_1 = 'VGART' fieldname_key_2 = 'WERKS' fieldname_value = 'BUDAT' operator = '<=' TABLES where_clause = dyn_sql control_table = cnt_tab all_values_key_1 = t158v_all values_key_1 = t158v_tab all_values_key_2 = t001w_all values_key_2 = t001w_tab CHANGING key_1_is_in_where_clause = sw_key_1 key_2_is_in_where_clause = sw_key_2 EXCEPTIONS dynsql_too_large = 1 wrong_entry_in_control_table = 2 key_values_inconsistent = 3 no_entry_found = 4 function_already_called = 5 others = 6.

ARCHIVE_PROTOCOL_COLLECT_APPL CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT_APPL' EXPORTING i_msgtype = 3 i_text = i_text.

ARCHIVE_PROTOCOL_COLLECT_APPL CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT_APPL' EXPORTING i_msgtype = 3 i_text = i_text.

ARCHIVE_PROTOCOL_COLLECT_APPL CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT_APPL' EXPORTING i_msgtype = 3 i_text = i_text.

ARCHIVE_PROTOCOL_COLLECT_APPL CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT_APPL' EXPORTING i_object = mkpf_tab_entry i_msgtype = 2 i_text = lv_detail_text. "^_n833784

ARCHIVE_PROTOCOL_COLLECT_APPL CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT_APPL' EXPORTING i_object = mkpf_tab_entry i_msgtype = 2 i_text = lv_detail_text. "^_n833784

DYNSQL_READ_CONTROL_TABLE CALL FUNCTION 'DYNSQL_READ_CONTROL_TABLE' EXPORTING key_1 = v_mkpf_tab-vgart key_2 = mseg_tab-werks IMPORTING control_line = cntrl_line EXCEPTIONS key_value_invalid = 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 = 'MM_MATBEL' comments = p_coment do_not_delete_data = l_not_delete destroy = l_destroy output_sel_screen_when_dialog = space output_sel_screen_when_batch = space IMPORTING archive_handle = handle EXCEPTIONS internal_error = 1 object_not_found = 2 open_error = 3 not_authorized = 4.

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_PROTOCOL_COLLECT_APPL CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT_APPL' EXPORTING i_object = mkpf_tab_entry i_msgtype = 2 i_text = text-e02.

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 = mkpf_tab record_structure = 'MKPF'.

ARCHIVE_PUT_TABLE CALL FUNCTION 'ARCHIVE_PUT_TABLE' EXPORTING archive_handle = handle record_structure = 'MSEG' TABLES table = data_tab.

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

ARCHIVE_PROTOCOL_COLLECT_APPL





CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT_APPL' EXPORTING i_object = mkpf_tab_entry i_msgtype = 2 i_msgv1 = mkpf_tab-mblnr i_msgv2 = mkpf_tab-mjahr i_text = i_text.

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

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

ARCHIVE_PROTOCOL_COLLECT * call function 'ARCHIVE_PROTOCOL_COLLECT' * exporting * i_object = mkpf_tab_entry * i_msgtype = 1 * i_text = text-003.

ARCHIVE_PROTOCOL_COLLECT_APPL CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT_APPL' EXPORTING i_object = mkpf_tab_entry i_msgtype = 1 i_text = i_text.

PROGRESS_INDICATOR_APPL CALL FUNCTION 'PROGRESS_INDICATOR_APPL' EXPORTING i_text = i_text * i_msgv1 = object_counter i_output_immediately = output_immediately i_processed = object_counter * i_total = p_lines_tab-count IMPORTING e_progress_sent = l_progress_sent.

DB_COMMIT CALL FUNCTION 'DB_COMMIT'.

ARCHIVE_WRITE_STATISTICS CALL FUNCTION 'ARCHIVE_WRITE_STATISTICS' EXPORTING archive_handle = handle EXCEPTIONS internal_error = 1 wrong_access_to_archive = 2 others = 3.

ARCHIVE_PROTOCOL_WRITE_APPL CALL FUNCTION 'ARCHIVE_PROTOCOL_WRITE_APPL'.

ARCHIVE_CLOSE_FILE CALL FUNCTION 'ARCHIVE_CLOSE_FILE' EXPORTING archive_handle = handle.

ARCHIVE_PROTOCOL_WRITE_APPL CALL FUNCTION 'ARCHIVE_PROTOCOL_WRITE_APPL'. "838062

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

ARCHIVE_PROTOCOL_COLLECT_APPL CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT_APPL' EXPORTING i_object = mkpf_tab_entry i_msgtype = 2 i_text = lv_detail_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 RM07MARCS or its description.