58
 © ACL Services Ltd. 

2013 03 28 Connections Train2 Tips Tricks Creating ACL Scripts

  • Upload
    isack

  • View
    10

  • Download
    4

Embed Size (px)

DESCRIPTION

Audit Accounting

Citation preview

  • ACL Services Ltd.

  • ACL Services Ltd. B O S C H A N D S I E M E N S H O M E A P P L I A N C E S G R O U P

    Anke Giegandt, ACDA Auditor

    Embrace Repeatable Scripts Tips & Tricks for Creating ACL Scripts

  • 3 ACL Services Ltd. ACL | Connections 2013

    AGENDA Data analysis for internal audit at Bosch and Siemens Home Appliances Group

    Methods for creating ACL scripts Best practices for script design Populate a drop down menu with data from a

    table Create dynamic dialog boxes ACL language and ACL version test Summary

  • 4 ACL Services Ltd. ACL | Connections 2013

    Data Analysis for Internal Audit at Bosch and Siemens Home Appliances Group

  • 5 ACL Services Ltd. ACL | Connections 2013

    The BSH shareholders 2011

  • 6 ACL Services Ltd. ACL | Connections 2013

    The BSH product portfolio covers the entire spectrum for daily life

    Cooking

    Washing & Drying

    Dishwashing

    Refrigeration & Freezing

    Consumer products

  • 7 ACL Services Ltd. ACL | Connections 2013

    BSH success worldwide

    13 brands, 42 factories, about 45,000 employees around 9.7 bill. Euro sales in 2011

    about 70 companies in 49 countries Global sales and customer service network

  • 8 ACL Services Ltd. ACL | Connections 2013

    Start: mid 2007 Data analyses mainly based on

    data from: SAP Legacy systems Archived SAP data GDPdU (German format for data

    storage for financial authorities) SQL-databases

    Amount of data for one audit: 500 MB 700 GB

    Scripts used: Purchased scripts Manual analyses Scripts developed by consultants Scripts we developed ourselves

    Support of: Standard audits Special investigations Cycle audits (once per year) External audit Continuous auditing (started 2013)

    History of data analysis at BSH Internal Audit

  • 9 ACL Services Ltd. ACL | Connections 2013

    Accounts Payable Invoices without purchase order Duplicate payments

    Accounts Receivable Open items Changes of customer master data

    Asset Management Assets with wrong useful life Assets which never have been

    depreciated

    Controlling Factory Dummy prices Product calculation date

    FI-General Baseline date changes GL-account overview

    Material Management Scrap postings Defective goods postings

    Purchasing Invoice date before PO date Split purchase orders

    Sales and Sales Admin CPD deliveries Free goods

    Analysis of SAP Access Rights

    Standard-analyses: available analysis topics

  • 10 ACL Services Ltd. ACL | Connections 2013

    Data Analysis at BSH Internal Audit data flow

    Data Sources

    Data Access

    Data Analysis

    dab: exporter (Access-handling with SAP user and password,

    with dab:PrivacyProtection for pseudonymisation)

    Results

    weBSH.net Worldwide

    Finance Facto-ries

    Master-data

    Sales Customer Service

    Slowa-kia

    North America

    Greece China Rest of Asia

    Other BSH-internal Data-

    sources

  • 11 ACL Services Ltd. ACL | Connections 2013

    This presentation shows screenshots and examples based on SAP data, our main data source for data analyses

    In SAP tables and fields are standardized therefore scripting leads to even more synergy effects

    When you start writing scripts Have a good idea what the script should do Use the script as often as possible CHANGE MANAGEMENT: establish a process

    Get feedback about the results Improve the script according to the feedback

    Get rid of errors and too many false positives, improve usability

    Resource Planning!

    Remarks

  • 12 ACL Services Ltd. ACL | Connections 2013

    Methods for Creating ACL Scripts

  • 13 ACL Services Ltd. ACL | Connections 2013

    A series of ACL commands stored as one unit in an ACL project Any ACL command can be used in a script A given script can be executed repeatedly on different data (e.g., every

    month on a file with the same data structure, but with different data content each month)

    What is an ACL script?

  • 14 ACL Services Ltd. ACL | Connections 2013

    Why use ACL scripts? Improves the efficiency of the data analysis team: more can be done with the same

    resources Quality assurance: using the same script for auditing different legal entities assures

    the same quality of the audit Complex analyses can sometimes only be performed by using scripts Less experienced users can start ACL scripts and use the results without knowing

    how to write scripts

    Methods for creating ACL scripts Create a script from table history Usage of the script recorder Use the commands stored in the log Create a script manually

    Methods for creating ACL scripts

  • 15 ACL Services Ltd. ACL | Connections 2013

    Open the table you want to get the history from Go to Tools Create Script from Table History 1.

    Create a script from table history

  • 16 ACL Services Ltd. ACL | Connections 2013

    2.

    3.

    4.

    Create a script from table history

  • 17 ACL Services Ltd. ACL | Connections 2013

    Go to Tools Set Script Recorder On

    Open the table you need for your analysis All commands performed from now on will be written to the new script

    Usage of the script recorder

  • 18 ACL Services Ltd. ACL | Connections 2013

    Usage of the script recorder

    Manual data extraction to a new table with one condition

    (Table LFA1=Vendor Master Data).

    New results table.

  • 19 ACL Services Ltd. ACL | Connections 2013

    When the manual analysis is finished, go again to Tools Set Script Recorder On

    Then you are prompted for a script name:

    And, here is the resulting script:

    Usage of the script recorder

  • 20 ACL Services Ltd. ACL | Connections 2013

    If you want to copy commands from the log, check the required items, right-click the selection and select Copy

    The selected commands can now be copied into a script

    Use the commands stored in the log

  • 21 ACL Services Ltd. ACL | Connections 2013

    To create a script exporting the commands directly from the log, check the required items, right-click the selection and select

    Save Selected Items Script

    Enter the script name and click OK

    Use the commands stored in the log

  • 22 ACL Services Ltd. ACL | Connections 2013

    To create a script manually, right-click the project name in the project navigator and select New > Script

    Create a script manually

  • 23 ACL Services Ltd. ACL | Connections 2013

    There are now three different ways to populate the new script with your commands: Type commands in manually Copy and paste commands from the log (see previous slides) Capture syntax command

    Create a script manually

  • 24 ACL Services Ltd. ACL | Connections 2013

    Click the start button

    Select the commands as required. They are directly written to the script, but not yet executed. These commands will only be executed when the script is started. When the script is finished, select the End Syntax Capture Button.

    Capture syntax command

  • 25 ACL Services Ltd. ACL | Connections 2013

    Best Practices for Script Design

  • 26 ACL Services Ltd. ACL | Connections 2013

    First try to answer the following questions: Begin with the end in mind: how should the result of the script look like?

    Who will use the results of the script? What will the script do?

    Which data are required? What other information is to be collected? Which input parameters are required?

    Who will use the script? Error trapping Languages (dialog, comments, text tables)

    Define naming conventions Use comments within the script code for documentation Modular programming: one main script should call subscripts

    Once the script is finished: in-depth testing of the script with different input parameters, test data and productive data ensures high quality

    Best practices for script design - overview

  • 27 ACL Services Ltd. ACL | Connections 2013

    Naming conventions ACL commands: always in UPPERCASE: CLASSIFY ON company_code TO t_temptable Variables: c_variable_name Calculated fields: c_field_name Calculated fields which are used as key fields: c_kfield_name Indices: i_index_name Temporary tables: t_table_name Try to avoid blanks in names

    Introduce a run ID which will be defined by the user in the dialog E.g., a 4-digit ID which can represent the audit number, company code, . Can be added at the end of variables, temporary tables, indices, results tables, name of the

    results folder Easy differentiation of different script runs with different parameters

    Text tables: let the user prioritize the languages required in the dialog.

    Best practices for script design - details

  • 28 ACL Services Ltd. ACL | Connections 2013

    Create a script template which can be re-used (I) Script header:

    Area of Analysis: Accounts Receivable Name of the script: AR_Cust_Duplicates Version: 0.43 Author: agiegandt Created on: 03.10.2012 Last changes: 23.02.2013 Changed by: agiegandt Uses subscripts: AR_Cust_Dups_Sub01 Uses tables: KNA1, KNB1, KNBK

    Best practices for script design - details

  • 29 ACL Services Ltd. ACL | Connections 2013

    Create a script template which can be re-used (II) Basic settings:

    SET SAFETY OFF SET EXACT OFF DELETE ALL OK (or conditional deletion) CLOSE CLOSE SECONDARY SET DATE "YYYYMMDD Dialog to get the Run_ID SET SESSION ++ Name_of_Analytics_%Run_ID% ++ SET FOLDER / Name_of_Analytics _%Run_ID%

    Best practices for script design - details

  • 30 ACL Services Ltd. ACL | Connections 2013

    Create a script template which can be re-used (III) Cleanup section: delete at the end of the script

    Variables Temporary tables Indices Relations Calculated fields in original tables

    Final settings: SET SAFETY ON CLOSE CLOSE SECONDARY SET FOLDER /

    Best practices for script design - details

  • 31 ACL Services Ltd. ACL | Connections 2013

    Populate a Dropdown Menu from a Table

  • 32 ACL Services Ltd. ACL | Connections 2013

    Scenario: Assume you want to write a script with a dialog box. In this dialog box, the user

    should be able to put in some parameters for the script run One of the selection parameters should be the Company Code for which the

    analysis will be executed

    Desired dialog:

    Traditional approach: a dialog is created and the possible parameters are put in hard-coded

    Populate a dropdown menu from a table

  • 33 ACL Services Ltd. ACL | Connections 2013

    Dialog creation:

    Resulting script code:

    Dropdown values are semi-colon delimited in the dialog command

    Populate a dropdown menu from a table

  • 34 ACL Services Ltd. ACL | Connections 2013

    To get a more flexible dialog (not hard-coded), it is necessary to know which Company Codes are in the data ahead of time and to display only those Company Codes in the dropdown menu for selection by the user

    This requires a unique list of all possible valuesa unique list can be created by using the CLASSIFY command

    Populate a dropdown menu from a table

  • 35 ACL Services Ltd. ACL | Connections 2013

    This table has to be converted into a variable which is semi-colon delimited

    This can be done using the GROUP command or using a subscript Solution with GROUP command:

    Variables v_compcodes_tmp and v_compcodes:

    Populate a dropdown menu from a table

  • 36 ACL Services Ltd. ACL | Connections 2013

    Now this variable containing all possible Company Codes can be used in the DIALOG command:

    Resulting dialog when the script is executed:

    Populate a dropdown menu from a table

  • 37 ACL Services Ltd. ACL | Connections 2013

    Create Dynamic Dialog Boxes

  • 38 ACL Services Ltd. ACL | Connections 2013

    Scenario: Assume you have to write a script with the following requirements:

    Technical parameters for each script run have to be maintained outside of ACL Analytics New analysis topics can be added without additional programming

    Approach: The code must be as flexible as possible Parameter definition will be done in a spreadsheet

    But how can I show an analysis to be selected by the user in a dialog box, which is not known at the time the script is actually written?

    Dynamic Dialog Boxes are required

    Create dynamic dialog boxes

  • 39 ACL Services Ltd. ACL | Connections 2013

    Analysis topic: User Authorizations in SAP In the spreadsheet, two workbooks are defined: Authorizations Overview and

    Authorizations Details Workbook Authorizations Overview:

    Create dynamic dialog boxes

  • 40 ACL Services Ltd. ACL | Connections 2013

    Workbook Authorizations Details :

    The dialog box created by the ACL script allows you to select one or more analyses from the Workbook Authorizations Overview

    The technical details required for the analysis are taken from the Workbook Authorizations Details

    Create dynamic dialog boxes

  • 41 ACL Services Ltd. ACL | Connections 2013

    Import from spreadsheet

    Details

    Overview

  • 42 ACL Services Ltd. ACL | Connections 2013

    What we need: A DIALOG command split into a fixed part and a variable part But: the variable part is not known at start of the script

    We need a script that creates a script with the correct dialog box at runtime

    Create dynamic dialog boxes the result

    Fixed part

    Flexible part

  • 43 ACL Services Ltd. ACL | Connections 2013

    Example DIALOG:

    Corresponding DIALOG command:

    Analysis of the DIALOG command

    x-position y-position

  • 44 ACL Services Ltd. ACL | Connections 2013

    Variable v_dialog = v_dialog_fix + v_dialog_var

    Script with DIALOG command:

    Create dynamic dialog boxes solution

  • 45 ACL Services Ltd. ACL | Connections 2013

    The following data have to be calculated: Total number of checkboxes required Number of rows and number of columns for the checkboxes Maximum width of each checkbox Distance between rows Distance from top of the dialog box Distance from left of the dialog box Height and width of the complete dialog box Location of the OK and Cancel buttons

    Create dynamic dialog boxes solution

  • 46 ACL Services Ltd. ACL | Connections 2013

    ACL Language and ACL Version Test

  • 47 ACL Services Ltd. ACL | Connections 2013

    Why: Different ACL language versions create different column names in the command

    CROSSTAB German: Anzahl English: COUNT

    If you want to use the column names in a script, you need to know ahead of time which ACL language version is used

    ACL language test

  • 48 ACL Services Ltd. ACL | Connections 2013

    Example English:

    Example German:

    ACL language test - CROSSTAB

  • 49 ACL Services Ltd. ACL | Connections 2013

    SET SAFETY OFF OPEN AnyTable EXTRACT "TEST" AS "KEY" 0 AS "TESTVALUE" TO t_languagetest1 FIRST 1 OPEN "t_languagetest1" CROSSTAB ON KEY COLUMNS KEY SUBTOTAL testvalue COUNT TO

    "t_languagetest2.FIL" OPEN

    IF FTYPE("Count_TEST") 'U' Assign v_CountLabel = 'COUNT_' IF FTYPE("Anzahl_TEST") 'U' Assign v_CountLabel = 'ANZAHL_ PAUSE "Label = %v_CountLabel% CLOSE SET SAFETY ON

    ACL language test - script

  • 50 ACL Services Ltd. ACL | Connections 2013

    English German

    ACL language test - screenshots

  • 51 ACL Services Ltd. ACL | Connections 2013

    DISPLAY VERSION Especially required if scripts should run on both the Unicode and the Non-Unicode

    version of ACL Analytics Some commands are different between Unicode and Non-Unicode

    DISPLAY VERSION creates four numeric variables: ACL_Ver_Type: type: 0 is non-unicode, 1 is unicode ACL_Ver_Patch: patch ACL_Ver_Minor: minor version ACL_Ver_Major: major version

    ACL version test

  • 52 ACL Services Ltd. ACL | Connections 2013

    One command to be used differently in the two versions:

    ASCII: ZONED(number, length)

    UNICODE: BINTOSTR(ZONED(number, length), A)

    ACL version test

    string string type (A for ASCII)

  • 53 ACL Services Ltd. ACL | Connections 2013

    Summary

  • 54 ACL Services Ltd. ACL | Connections 2013

    Scripts can be very useful to improve the efficiency of the audit department

    The different methods of script creation when using ACL technology offer a wide range of possibilities and allow the user to start simple and to develop easily to become an advanced script writer

    So lets get started, but

    Summary

  • 55 ACL Services Ltd. ACL | Connections 2013

    How not to perform script writing:

    Summary II

  • 56 ACL Services Ltd. ACL | Connections 2013

    Anke Giegandt Bosch and Siemens Home Appliances Group Internal Audit

    Carl-Wery-Str. 34 81739 Munich Germany Phone: +49 89 - 4590 5093 Fax: +49 89 - 4590 2158 E-Mail: [email protected] Web: www.bsh-group.com ACL User Group D/A/CH: http://www.am-dataconsult.de/acl-usergroup.html

    Contact

  • 57 ACL Services Ltd. ACL | Connections 2013

  • 58 2012 ACL Services Ltd. ACL | Connections 2013

    Slide Number 1Embrace Repeatable Scripts Tips & Tricks for Creating ACL ScriptsAGENDAData Analysis for Internal Audit at Bosch and Siemens Home Appliances GroupThe BSH shareholders 2011The BSH product portfolio covers the entire spectrum for daily lifeBSH success worldwideHistory of data analysis at BSH Internal AuditStandard-analyses: available analysis topicsData Analysis at BSH Internal Audit data flowRemarksMethods for Creating ACL ScriptsWhat is an ACL script?Methods for creating ACL scriptsCreate a script from table historyCreate a script from table historyUsage of the script recorderUsage of the script recorder Usage of the script recorder Use the commands stored in the logUse the commands stored in the logCreate a script manuallyCreate a script manuallyCapture syntax commandBest Practices for Script DesignBest practices for script design - overviewBest practices for script design - detailsBest practices for script design - detailsBest practices for script design - detailsBest practices for script design - detailsPopulate a Dropdown Menu from a TablePopulate a dropdown menu from a tablePopulate a dropdown menu from a tablePopulate a dropdown menu from a tablePopulate a dropdown menu from a tablePopulate a dropdown menu from a tableCreate Dynamic Dialog BoxesCreate dynamic dialog boxesCreate dynamic dialog boxesCreate dynamic dialog boxesImport from spreadsheetCreate dynamic dialog boxes the resultAnalysis of the DIALOG commandCreate dynamic dialog boxes solutionCreate dynamic dialog boxes solutionACL Language and ACL Version TestACL language testACL language test - CROSSTABACL language test - scriptACL language test - screenshotsACL version testACL version testSummarySummarySummary IIContactSlide Number 57Slide Number 58