{"audience":"Cost accountants, controllers who want to automate the month-end close, and interface owners.","authorization_objects":[{"note":"Authorization to post to the cost center","object":"K_CSKS"},{"note":"Authorization to post to the internal order","object":"K_ORDER"},{"note":"Cost center accounting transaction authorization","object":"K_CCA"}],"components":[],"countries":[],"effort_days_max":5,"effort_days_min":3,"effort_size":"M","faq":[{"a":"Semicolon-separated CSV or XLSX can be used. If the source system sends its own code instead of the cost center, a mapping table is included in the scope.","q":"What should the file format be?"},{"a":"With P_DELTA on, the difference to the current value is posted, so the second upload has zero difference and the row is skipped. The processed file is moved to the archive folder.","q":"What happens if the same file is processed twice by mistake?"},{"a":"This interface covers actual values. A similar upload for plan statistical key figures (KP46) can be built with a separate BAPI as additional scope.","q":"Can plan values be uploaded too?"}],"features":[{"code":"test_run","label":"Test mode (check without posting)","note":""},{"code":"log","label":"Line-by-line result and error log","note":""},{"code":"background","label":"Runs as a background job","note":"Runs automatically at a set time after the file arrives in the folder."},{"code":"error_file","label":"Download failed lines as a separate file","note":""},{"code":"email","label":"Send the result by email","note":"Failed rows are emailed to the owner."}],"functions":[{"name":"BAPI_ACC_STAT_KEY_FIG_POST","role":"Posts statistical key figure actuals as a CO document"},{"name":"BAPI_TRANSACTION_COMMIT","role":"Saves successful packages permanently"},{"name":"BAPI_TRANSACTION_ROLLBACK","role":"Rolls back the change in test mode and for failed packages"}],"gap":"KB31N enters statistical key figures on screen; it cannot read a file delivered from outside and cannot be scheduled. For hundreds of cost centers the values are keyed in or pasted from Excel every month, with a high risk of errors and gaps. For the cycles to run correctly, the values need to arrive automatically before the close.","id":"co-statistical-key-figure-upload","industries":[],"input_columns":[{"derived":false,"label":"Cost center","required":false,"rule":"","target_field":"KOSTL","target_table":"CSKS"},{"derived":false,"label":"Internal order (when cost center is blank)","required":false,"rule":"","target_field":"AUFNR","target_table":"AUFK"},{"derived":false,"label":"Statistical key figure","required":true,"rule":"","target_field":"STAGR","target_table":"TKA03"},{"derived":true,"label":"Value","required":false,"rule":"Period value; when P_DELTA is set, the difference to the current COSR value is posted","target_field":null,"target_table":null},{"derived":false,"label":"Unit","required":false,"rule":"","target_field":"MSEHI","target_table":"TKA03"},{"derived":false,"label":"Text","required":false,"rule":"","target_field":"SGTXT","target_table":"COEP"}],"kind":"program","language":"en","lastmod":"2026-11-17","logic":"1. The file is read from the inbound folder on the application server (background) or from the user's PC; the processed file is moved to an archive folder.\n2. Every row is checked: the key figure must exist in TKA03, the cost center must be valid in CSKS on the posting date or the internal order must exist in AUFK; the unit must match TKA03-MSEHI.\n3. When P_DELTA is set, for totals-type key figures the current value of the period is read from COSR and only the difference is posted, so uploading the same file twice does not double the value.\n4. Rows are packed into the BAPI_ACC_STAT_KEY_FIG_POST structure; in test mode the BAPI is called and rolled back with BAPI_TRANSACTION_ROLLBACK.\n5. In a real run BAPI_TRANSACTION_COMMIT is called; the resulting CO document number, errors and skipped rows are listed in the log and can be emailed to the owner.","module":"CO","object_type":"interface","output_columns":[{"calculated":true,"formula":"Row number in the file","label":"Row","source_field":null,"source_table":null},{"calculated":false,"formula":"","label":"Cost center","source_field":"KOSTL","source_table":"CSKS"},{"calculated":false,"formula":"","label":"Internal order","source_field":"AUFNR","source_table":"AUFK"},{"calculated":false,"formula":"","label":"Key figure","source_field":"STAGR","source_table":"TKA03"},{"calculated":true,"formula":"File value or the difference calculated with P_DELTA","label":"Posted value","source_field":null,"source_table":null},{"calculated":true,"formula":"From the BAPI return messages: posted, test OK, skipped or error","label":"Status","source_field":null,"source_table":null},{"calculated":false,"formula":"","label":"CO document","source_field":"BELNR","source_table":"COBK"},{"calculated":true,"formula":"First error or success message from the BAPI return table","label":"Message","source_field":null,"source_table":null}],"parameters":[{"example":"1000","kind":"parameter","label":"Controlling area","name":"P_KOKRS","ref_field":"TKA03-KOKRS","required":true},{"example":"/interface/co/skf/in/","kind":"parameter","label":"Inbound folder or file path","name":"P_PATH","ref_field":"","required":true},{"example":"31.10.2026","kind":"parameter","label":"Posting date","name":"P_BUDAT","ref_field":"COBK-BUDAT","required":true},{"example":"X","kind":"checkbox","label":"Post only the difference for totals-type key figures","name":"P_DELTA","ref_field":"","required":false},{"example":"X","kind":"checkbox","label":"Test mode (check without posting)","name":"P_TEST","ref_field":"","required":false}],"part_of":[],"performance":"One CO document can hold hundreds of lines; splitting the file into packages by key figure or cost center group makes reprocessing easier after an error. The COSR read is done in one pass with the object list.","process":"R2R","quote_url":"https://nekuhub.com/en/request-a-quote/?report=co-statistical-key-figure-upload","related":["co-cost-center-plan-upload","co-statistical-key-figures-check"],"releases":[],"source":"custom","standard_alternatives":[{"note":"Enters statistical key figures on screen as one document; reads no file and cannot be scheduled.","tcode":"KB31N"},{"note":"Displays posted key figures; does not upload.","tcode":"KB33N"}],"summary":"A custom interface that reads values such as headcount, kWh or square meters delivered by HR, energy monitoring or facility systems from a file and posts them as statistical key figures to cost centers and internal orders. It runs in the background from an application server folder, with a test mode and a per-row log.","tables":[{"access":"read_write","join_on":"COSR-OBJNR = CSKS-OBJNR veya AUFK-OBJNR AND COSR-STAGR = dosyadaki gösterge","role":"Statistical key figure period values: read for the delta, written through the BAPI","table":"COSR","variant":"both"},{"access":"read","join_on":"TKA03-KOKRS = P_KOKRS AND TKA03-STAGR = dosyadaki gösterge","role":"Key figure definition, unit and category","table":"TKA03","variant":"both"},{"access":"read","join_on":"CSKS-KOKRS = P_KOKRS AND CSKS-KOSTL = dosyadaki masraf yeri","role":"Validity of the cost center on the posting date","table":"CSKS","variant":"both"},{"access":"read","join_on":"AUFK-AUFNR = dosyadaki sipariş AND AUFK-KOKRS = P_KOKRS","role":"Existence and object number of the receiving internal order","table":"AUFK","variant":"both"}],"title":"Statistical Key Figure Actuals Upload Interface","url":"https://nekuhub.com/en/programs/statistical-key-figure-actuals-upload-interface/","vendor_id":"nekudos"}