SAP Reports / Programs

S3VBRKWRS SAP ABAP Report - Archiving Billing Documents: Write Program







S3VBRKWRS is a standard Executable ABAP Report available within your SAP system (depending on your version and release level). It is used for Archiving of billing documents in SD: Write program This program writes billing documents from the database as archive files...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 S3VBRKWRS 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 S3VBRKWRS. "Basic submit
SUBMIT S3VBRKWRS AND RETURN. "Return to original report after report execution complete
SUBMIT S3VBRKWRS 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: P_SNAP = D .
Selection Text: P_DEST = D .
Selection Text: P_AR_ILM = D .
Selection Text: SO_VKORG = Sales Organization
Selection Text: SO_VBELN = Sales and Distribution Docs
Selection Text: SO_FKART = Billing Type
Selection Text: SO_ERDAT = Created On
Selection Text: SO_BUKRS = Company Code
Selection Text: P_WRITST = Test Mode
Selection Text: P_WRIPRD = Production Mode
Selection Text: P_PROT_O = Log Output
Selection Text: P_PROT = Customer Detail Log
Selection Text: P_DELTST = Delete with Test Variant
Selection Text: P_COMENT = Archiving Session Note
Selection Text: C_DBAS = Check Flow Documents Residence
Selection Text: CHK_AEDA = Change Date: Residence Time
Title: Archiving Billing Documents: Write Program
Text Symbol: S03 = Options
Text Symbol: S02 = Restrictions
Text Symbol: S01 = BillDocs
Text Symbol: N02 = Retention Period Ended
Text Symbol: N01 = Snapshot archived
Text Symbol: M21 = Document Not Archivable Due to BADI Add-On Check
Text Symbol: M15 = Document cannot be archived due to individual checkg rule
Text Symbol: M14 = Document cannot be archived because revenue realization incomplete
Text Symbol: M13 = Document Cannot Be Archived Because Residence-Time Agreement Not Expired
Text Symbol: M12 = Document Cannot Be Archived Because Rebate Agreement Not Expired
Text Symbol: M11 = Document Cannot Be Archived Because Rebate Agreement Not Settled
Text Symbol: M10 = Residence Time for Document Not Reached
Text Symbol: M09 = The Document Was Archived
Text Symbol: M08 = Document Cannot Be Archived Because Subsequent FI Document Number Not Cleared
Text Symbol: M07 = Document Can Be Archived
Text Symbol: M06 = Residence Flow Time Not Achieved
Text Symbol: M05 = The Document Cannot Be Archived - Not Complete
Text Symbol: M04 = Agreement Not Finally Settled
Text Symbol: M03 = Document Not Selected Becuase of Residence Time
Text Symbol: M02 = Document Cannot Be Archived
Text Symbol: M01 = Document Can Be Archived





Text Symbol: 425 = Document Cannot Be Archived Due to Open Rebate Agrmt
Text Symbol: 424 = RevRec: Document cannot be archived as VBREVR entry still exists.
Text Symbol: 423 = RevRec: Doc. cannot be archived VBREVK-RRSTA does not equal 'C'
Text Symbol: 422 = RevRec: Document cannot be archived as VBREVC entry still exists.
Text Symbol: 017 = &1 of &2 Bill. Docs Prcssd (&3 Can Be Archived)


INCLUDES used within this REPORT S3VBRKWRS

INCLUDE S3VBRKCD.
INCLUDE ARCHCOMO.
INCLUDE S3VBRKTB.
INCLUDE SDZAVDAT.
INCLUDE S3VBRKSEL.
INCLUDE S3VBRKCF.


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.

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 = 'SD_VBRK' 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 = archive_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_WRITE_STATISTICS call function 'ARCHIVE_WRITE_STATISTICS' exporting archive_handle = archive_handle.

ARCHIVE_CLOSE_FILE call function 'ARCHIVE_CLOSE_FILE' exporting archive_handle = archive_handle.

ARCHIVE_PROTOCOL_COLLECT_APPL call function 'ARCHIVE_PROTOCOL_COLLECT_APPL' exporting i_object = gt_log-vbeln i_msgtype = lf_msgtype i_text = gt_log-ntext.

ARCHIVE_PROTOCOL_WRITE_APPL call function 'ARCHIVE_PROTOCOL_WRITE_APPL'.

ARCHIVE_NEW_OBJECT call function 'ARCHIVE_NEW_OBJECT' exporting archive_handle = archive_handle object_id = obj_id.

ARCHIVE_PUT_RECORD call function 'ARCHIVE_PUT_RECORD' exporting archive_handle = archive_handle record = xvbuk record_flags = ' ' record_structure = 'VBUK'.

CHANGEDOCU_ARCHIVE_OBJECT call function 'CHANGEDOCU_ARCHIVE_OBJECT' exporting archive_handle = archive_handle objectclass = cdhdr-objectclas objectid = cdhdr-objectid.

ARCHIVE_PUT_RECORD call function 'ARCHIVE_PUT_RECORD' exporting archive_handle = archive_handle record = xvbrk record_flags = ' ' record_structure = 'VBRK'.

TEXT_ARCHIVE_OBJECT call function 'TEXT_ARCHIVE_OBJECT' exporting archive_handle = archive_handle client = sy-mandt id = '*' language = '*' name = textname object = 'VBBK' object_delete_flag = 'X'.






TEXT_ARCHIVE_OBJECT call function 'TEXT_ARCHIVE_OBJECT' exporting archive_handle = archive_handle client = sy-mandt id = '*' language = '*' name = textname object = 'VBBP' object_delete_flag = 'X'.

ARCHIVE_PUT_TABLE call function 'ARCHIVE_PUT_TABLE' exporting archive_handle = archive_handle record_flags = ' ' record_structure = 'NAST' tables table = ynast.

ARCHIVE_PUT_TABLE call function 'ARCHIVE_PUT_TABLE' exporting archive_handle = archive_handle record_flags = ' ' record_structure = 'VBFA' tables table = yvbfa.

ARCHIVE_PUT_TABLE call function 'ARCHIVE_PUT_TABLE' exporting archive_handle = archive_handle record_flags = ' ' record_structure = 'VBRP' tables table = yvbrp.

ARCHIVE_PUT_TABLE call function 'ARCHIVE_PUT_TABLE' exporting archive_handle = archive_handle record_flags = ' ' record_structure = 'KONV' tables table = ykonv.

PRC_SUPPL_ARCHIVE_OBJECT CALL FUNCTION 'PRC_SUPPL_ARCHIVE_OBJECT' EXPORTING iv_archive_handle = archive_handle is_key = ls_key iv_object_delete_flag = abap_true EXCEPTIONS wrong_access_to_archive = 1 OTHERS = 2.

ADDRESS_ARCHIVE_OBJECT call function 'ADDRESS_ARCHIVE_OBJECT' exporting archive_handle = archive_handle address_object_type = gcf_address_type_company address_number = p_adrnr address_reference = addr_ref exceptions wrong_access_to_archive = 1 parameter_error = 2 others = 3.

ARCHIVE_PUT_TABLE call function 'ARCHIVE_PUT_TABLE' exporting archive_handle = archive_handle record_flags = ' ' record_structure = 'SADR' tables table = ysadr.

ARCHIVE_PUT_TABLE call function 'ARCHIVE_PUT_TABLE' exporting archive_handle = archive_handle record_flags = ' ' record_structure = 'VBPA' tables table = yvbpa.

ARCHIVE_PUT_TABLE call function 'ARCHIVE_PUT_TABLE' exporting archive_handle = archive_handle record_flags = ' ' record_structure = 'VBSSSK' tables table = yvbsssk.

ARCHIVE_PUT_TABLE call function 'ARCHIVE_PUT_TABLE' exporting archive_handle = archive_handle record_flags = ' ' record_structure = 'EIKP' tables table = yeikp.

ARCHIVE_PUT_TABLE call function 'ARCHIVE_PUT_TABLE' exporting archive_handle = archive_handle record_flags = ' ' record_structure = 'EIPO' tables table = yeipo.

ARCHIVE_PUT_TABLE call function 'ARCHIVE_PUT_TABLE' exporting archive_handle = archive_handle record_flags = ' ' record_structure = 'VBRL' tables table = yvbrl.

ARCHIVE_PUT_TABLE call function 'ARCHIVE_PUT_TABLE' exporting archive_handle = archive_handle record_flags = ' ' record_structure = 'FPLA' tables table = yfpla.

ARCHIVE_PUT_TABLE call function 'ARCHIVE_PUT_TABLE' exporting archive_handle = archive_handle record_flags = ' ' record_structure = 'FPLT' tables table = yfplt.

ARCHIVE_PUT_TABLE call function 'ARCHIVE_PUT_TABLE' exporting archive_handle = archive_handle record_flags = ' ' record_structure = 'FPLTC' tables table = yfpltc.

ARCHIVE_PUT_TABLE call function 'ARCHIVE_PUT_TABLE' exporting archive_handle = archive_handle record_flags = ' ' record_structure = 'VBPA3' tables table = yvbpa3.

ARCHIVE_SAVE_OBJECT call function 'ARCHIVE_SAVE_OBJECT' exporting archive_handle = archive_handle exceptions termination_requested = 1 file_io_error = 2 internal_error = 3 open_error = 4 wrong_access_to_archive = 5 data_object_not_saved = 6 others = 7.

ARCHIVE_PROTOCOL_COLLECT call function 'ARCHIVE_PROTOCOL_COLLECT' exporting i_object = prot_part-vbeln 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 = prot_part-vbeln i_msgtype = 1 i_text = lf_text.

ARCHIVE_PROTOCOL_COLLECT call function 'ARCHIVE_PROTOCOL_COLLECT' exporting i_object = prot_part-vbeln i_msgtype = 1 i_text = lf_text.

PROGRESS_INDICATOR_APPL call function 'PROGRESS_INDICATOR_APPL' exporting i_text = lf_prog_text i_processed = if_processed i_total = if_total i_output_immediately = lf_output_immediately importing "v_n_590818 e_progress_sent = lf_progress_sent.

DB_COMMIT call function 'DB_COMMIT'.

CPE_APPL_ACTIVATED_CHECK_CB call function 'CPE_APPL_ACTIVATED_CHECK_CB' exporting iv_application = 'V ' importing ev_activated = lv_cpe_active exceptions not_found = 1 others = 2.

CPE_KNUMVTOGUID_READ_MULTI_DB call function 'CPE_KNUMVTOGUID_READ_MULTI_DB' exporting it_knumv_struct = lt_knumv importing et_knumvtoguid = gt_knumvtoguid exceptions nothing_found = 1.

CPE_DEFFORMULA_ALL_PRESELEC_AC call function 'CPE_DEFFORMULA_ALL_PRESELEC_AC' exporting it_doc_guid = lt_doc_guid.

CPE_FORMULA_ALL_PRESELECT_AC call function 'CPE_FORMULA_ALL_PRESELECT_AC' exporting it_docitem_guid = lt_docitem_guid.

CPE_APPL_ACTIVATED_CHECK_CB call function 'CPE_APPL_ACTIVATED_CHECK_CB' exporting iv_application = 'V ' importing ev_activated = lv_cpe_active exceptions not_found = 1 others = 2.

ARCHIVE_PUT_TABLE call function 'ARCHIVE_PUT_TABLE' exporting archive_handle = archive_handle record_flags = ' ' record_structure = 'CPED_KNUMVTOGUID' tables table = lt_knumvtoguid.

CPE_DEFFORMULA_ALL_SAVE_AC call function 'CPE_DEFFORMULA_ALL_SAVE_AC' exporting iv_archive_handle = archive_handle it_doc_guid = lt_doc_guid.

CPE_FORMULA_ALL_SAVE_AC call function 'CPE_FORMULA_ALL_SAVE_AC' exporting iv_archive_handle = archive_handle it_docitem_guid = lt_docitem_guid.



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