Knowledge Models in the Parked & Blocked Invoice app
The App comes with one Knowledge Model (KM) called “Knowledge Model - SAP FI & MM”.
Note
The KM is pointing to the Base KMs stored in the Marketplace. You will not be able to update the Base KM. You can overwrite the PQL, names, formatting, etc. using the KM’s visual editor. If you prefer working with the YAML Editor, copy the IDs from the Base KMs (see final model) and overwrite them in the KMs that are accessible to you in the YAML Editor.
To start with, go to the AP KM package and open the Knowledge Model (it should be the only asset inside the app). Go through the Variables section in the View mode and validate whether the input used for the variables is correct. To view all variables in use, navigate to the Variables section of the KM. For the apps, only non-auto generated configurations are used, so you can disable the auto generated definitions .
Tip
You can see which objects refer to a variable by copying the Variable ID, going into the YAML Editor’s View mode (“Final Model without variable replacement”) and search for the copied variable.
Variables
Below is a list and description of the most important variables:
Variables for Table Alias
| _CEL_AP_CASES | The case table in the operational data model (RBKP + BSEG). If this value is changed, the embedded view in the “Vendor Block” view needs to be replaced as it contains an hardcoded Java Script filter. The snippet below shows an example of the BSEG used as case table: layout: rows: - id: row_1afd722c-eaf9-4981-a562-34ec8473da04 growHeight: false columns: - id: column_2c810e46-5b33-4e17-81ba-fa6235f6eb03 componentId: view-replacement size: "1" type: "" order: 100 height: "" order: 250 components: - id: view-replacement type: view settings: key: central-vendor-view shareFilters: false shareVariables: false shareAll: false shareSelections: true filters: - pql: FILTER "BSEG"."LIFNR" = '${record.VENDOR_ID}' |
| EKKO | Purchase document header |
| EKPO | Purchase document item |
| RSEG | Incoming invoice header |
| _CEL_AP_ACTIVITIES | The activity table |
| LFA1 | The vendor master data table across company codes |
| LFB1 | The vendor master data table per company code |
Variables for Thresholds
The threshold variables are configured as runtime variables and can be updated directly in the Settings view.
| 1000 | Parameter used in Cash Discount Prioritization (see Invoice Prioritization) |
| 500 | Parameter used in Cash Discount Prioritization (see Invoice Prioritization) |
| 100 | Parameter used in Cash Discount Prioritization (see Invoice Prioritization) |
| 5 | Parameter used in Cash Discount and On-Time Payment Prioritization (see Invoice Prioritization) |
| 10 | Parameter used in Cash Discount and On-Time Payment Prioritization (see Invoice Prioritization) |
| 3 | Days after the Cash Discount Due date the discount is still realized (SAP setting) |
| 10000 | Parameter used in On-Time Payment Prioritization (see Invoice Prioritization) |
| 14 | Number of days when the priority of an overdue invoice is becoming at least high |
Variables for Currency Conversion
| Parked: RBKP.RMWWR Posted: BSEG.WRBTR | The amount on an invoice that is eligible for realizing the discount |
| WSKTO | Discount field in case of direct cash discount (discount terms are zero and cash discount is entered directly) |
| Parked: RBKP.RMWWR Posted: BSEG.WRBTR | Invoice line value |
KPIs
KPIs in Knowledge Model are not only used for KPIs shown to the business user but also for storing blocks of repeatable business logic, such as for the calculation of due dates.
Formulas that are mainly used as internal functions have the prefix “FORMULA_” in the ID. Often, those formulas are used as an “Indicator” for a binary problem such as an invoice parked (1 = yes, 0 = no), posted, has a price mismatch, etc. Those indicators are then reused in other KPIs.
While this allows you to build a reusable and maintainable knowledge model structure, it can be a bit hard to understand what the full PQL formula looks like. Unfortunately, currently neither the PQL editor nor the KM has an option to look at the full PQL and resolve KPIs (only variables can be resolved), but there is a workaround for this.
Click in the PQL area of the relevant KM object.
Right-click and select Open PQL Editor.
The column header in the preview will contain the fully resolved PQL without any variables and KPIs. Copy and paste the resolved PQL in the YAML Editor.
Records
The central record in the Knowledge Model is the INVOICE_CASE which combines parked invoice headers and posted invoice lines from the table “_CEL_AP_CASES”. The identifier of the record is the column "_CASE_KEY" which is the MM key for parked invoices (Client, Fiscal Year, Document Number) and the FI key for posted invoices (Client, Company Code, Fiscal Year, Document Number, Line Item). The other records are used for providing contextual information in the invoice details view and purchase order details views.
Besides this central record, the app comes with the following additional records:
VENDOR_MASTER_GENERAL (LFA1) mainly used in the the Vendor Details View
PURCHASE_ORDER (EKKO) used for Purchase Order view
PURCHASE_ORDER_ITEM (EKPO) used for Purchase Order view
ACCOUNTING_DOCUMENT (BSEG) used for the FI line items
INCOMING_INVOICE (RSEG) used for MM line item information
GOODS_RECEIPT (EKBE, VGABE = 1) used for showing goods receipt information
INVOICE_HISTORY (EKBE, VGABE IN (2,3,P)) used for showing all invoices for a purchase order