SAP Reports / Programs | Controlling | Product Cost Controlling | Product Cost Planning(CO-PC-PCP) SAP CO

CO_COPC_WRI SAP ABAP Report - Archiving: Write Program (Product Costing)







CO_COPC_WRI is a standard Executable ABAP Report available within your SAP system (depending on your version and release level). It is used for This write program removes cost estimates from the SAP system that are not currently required...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 CO_COPC_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 CO_COPC_WRI. "Basic submit
SUBMIT CO_COPC_WRI AND RETURN. "Return to original report after report execution complete
SUBMIT CO_COPC_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: 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_FEH_ST = D .
Selection Text: P_DEST = D .
Selection Text: P_DELTST = D .
Selection Text: P_COMENT = D .
Selection Text: P_AR_ILM = D .
Selection Text: P_ADMTXT = D .
Selection Text: KALAID = D .
Selection Text: KALADAT = D .
Selection Text: P_WERKS = Plant
Selection Text: P_TVERS = Costing Version
Selection Text: P_MATNR = Material Number
Selection Text: P_KLVAR = Costing Variant
Selection Text: P_KADAT = Interval for Validity from
Selection Text: P_BUKRS = Company Code
Selection Text: P_BIDAT = Interval for Validity to
Selection Text: OHMEGER = Without Quantity Structure
Selection Text: MIMEGER = With Quantity Structure
Selection Text: MASCHIN = Automatic Cost Estimates
Selection Text: MANUELL = Manual Cost Estimates
Title: Archiving: Write Program (Product Costing)
Text Symbol: 015 = Additive Cost Ests
Text Symbol: 014 = W/o Qty Structure
Text Symbol: 013 = With Qty Struct.
Text Symbol: 012 = Automatic Cost Estimates
Text Symbol: 006 = &1% (&2 of &3) Cost Estimates Edited
Text Symbol: 005 = Cost estimate was destroyed.
Text Symbol: 004 = Snapshot for cost estimate was created.
Text Symbol: 003 = Cost estimate was archived.
Text Symbol: 002 = File Creation
Text Symbol: 001 = Cost Estimates


INCLUDES used within this REPORT CO_COPC_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:

CK_F_F4_COSTING_RUN CALL FUNCTION 'CK_F_F4_COSTING_RUN'.

CK_F_F4_COSTING_RUN CALL FUNCTION 'CK_F_F4_COSTING_RUN'.

CK_F_COSTINGRUN_HEADER_READ CALL FUNCTION 'CK_F_COSTINGRUN_HEADER_READ' EXPORTING KALAID = KALAID KALADAT = KALADAT IMPORTING F_KALA = F_KALA KALA_FOUND = KALA_FOUND.

CM_F_INITIALIZE CALL FUNCTION 'CM_F_INITIALIZE' EXPORTING APLID = 'CKRE' MSG_ON_SCREEN = ' ' EXCEPTIONS OTHERS = 1.

CK_F_KEKOS_SELECTION CALL FUNCTION 'CK_F_KEKOS_SELECTION' EXPORTING MASCHIN = MASCHIN MANUELL = MANUELL MIMEGER = MIMEGER OHMEGER = OHMEGER USED_FOR_ARCHIVE_REL = ' ' " normale Datenbankselektion P_KALAID = KALAID P_KALADAT = KALADAT TABLES T_KEKO = T_KEKO " result P_KLVAR = P_KLVAR " input P_TVERS = P_TVERS " input P_KADAT = P_KADAT " input p_bidat = p_bidat P_MATNR = P_MATNR " input P_WERKS = P_WERKS " input P_BUKRS = P_BUKRS " input P_FEH_STA = P_FEH_ST. " input

MATERIAL_READ_MAKA call function 'MATERIAL_READ_MAKA' EXPORTING schluessel = mtcom IMPORTING matdaten = mack4 return = mtcor TABLES seqmat01 = t_dummy EXCEPTIONS material_not_found = 01 plant_not_found = 02.

CK_F_REORGANIZATION CALL FUNCTION 'CK_F_REORGANIZATION' EXPORTING TEST = 'X' KAOHREF = 'X' ZUKA = SPACE LAKA = SPACE VEKA = SPACE ARCHIVE_MODE = 'X' TABLES T_KEKO = t_keko_temp EXCEPTIONS OTHERS = 1.

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

ARCHIVE_OPEN_FOR_WRITE CALL FUNCTION 'ARCHIVE_OPEN_FOR_WRITE' EXPORTING CALL_DELETE_JOB_IN_TEST_MODE = P_WRITST CREATE_ARCHIVE_FILE = l_write_file "HW1242522 OBJECT = 'CO_COPC' comments = p_coment do_not_delete_data = p_snap "HW1877863 destroy = p_dest "HW1877863 IMPORTING ARCHIVE_HANDLE = HANDLE.

CK_F_GET_TABLES_FOR_ONE_KEKO CALL FUNCTION 'CK_F_GET_TABLES_FOR_ONE_KEKO' EXPORTING T_KEKO_ONE = T_KEKO_ONE " input structure TABLES T_KEPH = T_KEPH " result T_CKHS = T_CKHS " result T_CKHT = T_CKHT " result T_CKIS = T_CKIS " result T_CKIT = T_CKIT " result T_CMFK = T_CMFK " result T_CMFP = T_CMFP. " result

ARCHIVE_NEW_OBJECT CALL FUNCTION 'ARCHIVE_NEW_OBJECT' EXPORTING ARCHIVE_HANDLE = HANDLE OBJECT_ID = OBJECT_ID.

ARCHIVE_PUT_TABLE CALL FUNCTION 'ARCHIVE_PUT_TABLE' EXPORTING ARCHIVE_HANDLE = HANDLE RECORD_FLAGS = ' ' RECORD_STRUCTURE = 'KEKO' TABLES TABLE = T_KEKO_ONE.

ARCHIVE_PUT_TABLE CALL FUNCTION 'ARCHIVE_PUT_TABLE' EXPORTING ARCHIVE_HANDLE = HANDLE RECORD_FLAGS = ' ' RECORD_STRUCTURE = 'KEPH' TABLES TABLE = T_KEPH.

ARCHIVE_PUT_TABLE CALL FUNCTION 'ARCHIVE_PUT_TABLE' EXPORTING ARCHIVE_HANDLE = HANDLE RECORD_FLAGS = ' ' RECORD_STRUCTURE = 'CKHS' TABLES TABLE = T_CKHS.

ARCHIVE_PUT_TABLE CALL FUNCTION 'ARCHIVE_PUT_TABLE' EXPORTING ARCHIVE_HANDLE = HANDLE RECORD_FLAGS = ' ' RECORD_STRUCTURE = 'CKHT' TABLES TABLE = T_CKHT.

ARCHIVE_PUT_TABLE CALL FUNCTION 'ARCHIVE_PUT_TABLE' EXPORTING ARCHIVE_HANDLE = HANDLE RECORD_FLAGS = ' ' RECORD_STRUCTURE = 'CKIS' TABLES TABLE = T_CKIS.

ARCHIVE_PUT_TABLE CALL FUNCTION 'ARCHIVE_PUT_TABLE' EXPORTING ARCHIVE_HANDLE = HANDLE RECORD_FLAGS = ' ' RECORD_STRUCTURE = 'CKIT' TABLES TABLE = T_CKIT.

ARCHIVE_PUT_TABLE CALL FUNCTION 'ARCHIVE_PUT_TABLE' EXPORTING ARCHIVE_HANDLE = HANDLE RECORD_FLAGS = ' ' RECORD_STRUCTURE = 'CMFK' TABLES TABLE = T_CMFK.

ARCHIVE_PUT_TABLE





CALL FUNCTION 'ARCHIVE_PUT_TABLE' EXPORTING ARCHIVE_HANDLE = HANDLE RECORD_FLAGS = ' ' RECORD_STRUCTURE = 'CMFP' TABLES TABLE = T_CMFP.

ARCHIVE_SAVE_OBJECT CALL FUNCTION 'ARCHIVE_SAVE_OBJECT' EXPORTING ARCHIVE_HANDLE = HANDLE EXCEPTIONS DATA_OBJECT_NOT_SAVED = 1 TERMINATION_REQUESTED = 2.

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_object = lv_object_id i_text = lv_action_text i_msgtype = 1.

ARCHIVE_PROTOCOL_COLLECT CALL FUNCTION 'ARCHIVE_PROTOCOL_COLLECT' EXPORTING i_object = lv_object_id 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 = '&1% (&2 of &3) of cost estimates processed'(006) "#EC * "text shall be understandable for EN-speaking coleagues i_processed = sel_kekos i_total = lv_total_of_objects IMPORTING e_progress_sent = lv_progress_send.

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

PROGRESS_INDICATOR CALL FUNCTION 'PROGRESS_INDICATOR' EXPORTING i_text = '&1% (&2 of &3) of cost estimates processed'(006) "#EC * "text shall be understandable for EN-speaking coleagues i_processed = sel_kekos i_total = lv_total_of_objects i_output_immediately = 'X'. "force the progress output (but only during the last call!) in order to send the very last progress indication

ARCHIVE_WRITE_STATISTICS CALL FUNCTION 'ARCHIVE_WRITE_STATISTICS' EXPORTING ARCHIVE_HANDLE = HANDLE STATISTICS_ONLY_PER_RUN = SPACE.

ARCHIVE_PROTOCOL_WRITE CALL FUNCTION 'ARCHIVE_PROTOCOL_WRITE'.

ARCHIVE_CLOSE_FILE CALL FUNCTION 'ARCHIVE_CLOSE_FILE' EXPORTING ARCHIVE_HANDLE = HANDLE.



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