Function documentationScript Logic Locate this document in the navigation structure

 

This function allows you to create files containing instructions for performing calculations with special requirements on SAP Business Planning and Consolidation data.

Features

You can perform logic calculations on base level members only. In addition, logic is application-specific.

BPC provides a library of MDX formulas, and the ApShell application set is pre-configured with a number of logic functions.

Note Note

Script logic statements are case-insensitive. However, all appset, application, and dimension and member names in K2 are case-sensitive.

End of the note.

You have two files for each piece of script logic you create:

  • An .LGF file, which is an ASCII file you create and edit when setting up logic calculations. You access the .LGF file through the Script Logic editor in the Admin Console.

  • An .LGX file, which is the compiled logic file created by the system when you validate and save your logic. This is an executable version of the .LGF file that is not stored in BPC.

Default logic is a special logic statement that is executed on every writeback to an application. All logic in Default.LGF is run after data sends. Having all of your logic in the Default.LGF logic file might become unmanageable. Therefore you can create other logic files, such as FXTrans.LGF for foreign currency translation and .ICElim.LGF for inter-company eliminations. Your default logic can contian an INCLUDE statement to execute specific logic in real-time, such as currency translation if desired, rather than having to run a separate batch process.

You access logic files from the Script Logic subdirectory within the hierarchy of an application.

Logic library

BPC has a library of standard logic functions available for your use. The file has the extension .LGF, which can be called at validation by using the INCLUDE function in your logic file. The logic module scans the library file for the appropriate formulas to use based on the information in the .LGF file.

Examples of logic delivered with BPC:

  • Allocation.lgf — Runs an allocation

  • Calcaccount.lgf — Used to prepare Cash Flow; runs a Account Calculation Business Rule

  • Consolidation.lgf — Used to run a Legal Consolidation Business Rule

  • Copy_Opening.lgf — Used to run a Balance Carry Forward business rule

  • FX_Trans.lgf — Used to run currency conversion

  • ICBooking.lgf — Used for running inter-company reconciliation and difference posting

  • ICData.lgf — Used to run inter-company reconciliation

  • ICElim.lgf — Used for running inter-company reconciliation

  • MDXlib.lgf — Library of MDX financial functions

  • System_Constants.lgf — Stores constant values for use within script logic. See the section that follows for more information.

  • System_Library.lgf — Includes basic examples of a set of keywords

  • Validation.lgf — Used for running a Validation rule

System constants file

The system constants file is the logic file that maps your dimension names for an application to the standard BPC logic. By updating the dimension constants file with your dimensions, you avoid having to change or rewrite any of the standard functions that are included with BPC.

The system constants file is located in the \\root\Data\Webfolders\<AppSet>\AdminApp\<App> folder.

Running advanced logic

Advanced logic can be automatically invoked each time the system sends data to the database. Logic contained in the Default logic file is executed immediately after data is sent and you can see the results immediately. Advanced logic can be run from Data Manager for batch processing of formulas. Using Data Manager to execute Logic module formulas is useful for calculations that do not need to be executed immediately. For example, you may decide to wait until all data has been entered in the local currency before generating the translated amounts in reporting currencies.