Credit BW_Blocked orders Workbook Description
Context
We have to provide some statistics in BW about the blocked orders for credit reason.
The indicators will be :
% of blocked orders for credit reasons
Total Number of orders blocked during the period divided by the total number of orders
Total number of blocked orders for limit reason / total number of blocked orders
Total number of blocked orders for overdue reason / total number of blocked orders
Total number of blocked orders for old financial information (expired validity date)
Total number of blocked orders for mix reason / total number of blocked orders
Average duration to release a blocked order by blocking reason
Average time in hours to release an order blocked by blocking reason
Average nbr of orders released in a day
Nbr of orders in average released in a day
Orders reblocked
Nbr and % of reblocked orders compared to total of orders blocked
Source of the data :
The VBUK-VBUP tables have the last status of credit blocks in the following fields :
Field | Explanation |
CMGST | Overall status of credit checks |
CMPSA | Status of static credit limit check |
CMPSB | Status of dynamix credit limit check in the credit horizon |
CMPSC | Status of credit check against maximum document value |
CMPSD | Status of credit check against terms of payment |
CMPSE | Status of credit check against customer review date |
CMPSF | Status of credit check against open items due |
CMPSG | Status of credit check against oldest open items |
CMPSH | Status of credit check against highest dunning level |
CMPSI | Status of credit check against financial document |
CMPSJ | Status of credit check against export credit insurance |
CMPSK | Status of credit check against payment card authorization |
CMPSL | Status of credit check of reserves 4 |
CMPSM | Credit check data is obsolete |
CMPS0 | Tolerance (Status of credit check for customer reserve 1) |
CMPS1 | Advance payment (Status of credit check for reserve 2) |
CMPS2 | Status of credit check for customer reserve 3 |
What already exists on the system :
In PF1, some years ago, an specific extractor has been developped for that purpose.
Prg : ZZV_KPI_CREDITBLOCK_ORDERS
This program fills the table zzv_kpi_creditbl (cfr annexe).
The idea is to read the change log tables (CDHDR and CDPOS) to be able to see when an order has been blocked or deblocked during his live.
Because the idea is the same, we will start from that program, and modify the way to prepare the data.
For our needs, some parts should be adapted :
The date of the blocked order should be a timestamp to be able to extract the average delay to release a blocked order.
The data were extracted on monthly base, we should be able to extract by week. The jobs takes around 17 hours (a lot of data were read by the program), we would like to work in delta mode to be able to limit the loading time. The old program prepared the data by period, we would like to be able to work with all the past data (it will be possible to slide on every periods).
Why not improve the presentation of the data and work with blocking segments instead of having one line for each changes.
Several remarks :
The scope is limited to the orders that :
are not in a state “cancelled”
are elligible for credit management (AUART in TVAK-KLIMP = “D”) (cfr infra)
If an order is created with a blocking code, we will not be able to find the entry in the change log tables. Then the extractor should start from the current situation, and then deduce the starting state of the order.
If an order has no item, it’s also rejected.
The active period of an order is not easy to provide : we will use another blocking code (technical) to be able to have this information. This segment will be filled by reading the items of the order : if all items are delivered, the order is considered as inactive.
The new extraction structure (ZZV_KPI_CREDBL_2) :
Field | Explanation |
MANDT | Client |
VBELN | Sales Document |
BLOCKTYPE | Blocking type |
STARTIME | UTC Timestamp of the begining of the blocking segment |
ENDTIME | UTC Timestamp of the ending of the blocking segment |
LASTCHANGED | UTC Timestamp of the last change of the blocking segment (delta in the ERP) |
LASTUPDATED | UTC Timestamp of the last update of the blocking segment (delta in BW) |
BLOCKVALUE | Overall status of credit checks |
BUKRS_VF | Company code to be billed |
KNKLI | Customer's account number with credit limit reference |
KKBER | Credit Control Area |
KUNRG | Payer |
GSBER | Business Area |
GRUPP | Customer Credit Group |
SBGRP | Credit representative group for credit management |
We will keep all the blocking segments presented by starting and ending timestamp to be able to present the different credit blocks.
The extraction program (ZZV_KPI_CREDITBLOCK_ORDERS2) :
Selection :
The first parameter of the program permit to limit the scope of the data loading. It will permit to extract the orders that must be considered in the current extraction.
3 ways will be used to select the orders :
An order created during this period
An item of an order has been created during this period
A change of credit block status has occured during this period
The second parameter will permit to limit the scope to one sales document to be able to make tests if needed.
With the list of orders, we will make the following operations :
We will see if a previous data load has already occured for these orders (based on the LASTCHANGED timestamp).
If it’s the case, we will continue the previous process without having to go throw the complete live the order.
If there is no entry, we begin the data load from the begining.
The flow to extract the orders is :
Get the last status of the order (VBUK)
Then select on the change tables the changes of the credit block status (from ‘B’ or to ‘B’) to fill the segments (CDHDR-CDPOS)
Complete the uncomplete segments if needed from the creation time of the order (to manage the case when an order has been created with a credit block not present in the change log tables)
The data load can be loaded by period chosen by the users : for example, it’s possible to split the process by week to reduce the loading time.
Output of the program
The program will load the intermediate table ZZV_KPI_CREDBL_2. The data will be presented by segments with a starting/ending dates and time.
Why to work by segment ?
It permits to avoid to duplicate records. If we take a snapshot each month, we will have several time the same order with all the status attached. By segment, the program will automatically fill the old segments if needed without having to repeat the old status.
It will help us to perform the delay calculation without having to fix the number of hours, the calculation can be done at the query level.
Different cases :
Case 1:
The segment starts before the current period, and finish during the month.
The segment will count 2 times : for the month M-1, and for the month M.
Case 2:
The segment starts and finish during the period.
The segment will count 1 time : during the period.
Case 3:
The segment start during the period and finish after the end of the period.
The segment will count several times : during the period M, and M+... until the segment will be ended.
Case 4:
The segment start before the period, and end after the end of the period.
The segment will count several times : M-..., during the period, and M+...
Only the orders released during the period will be counted to provide the average release time of the credit check.
How to know that an order is active or not ?
To check if an order is active or not, there is a status in the table VBUK, but for a reason that I ignore, this field is changed without having a entry in the change log (probably done in an user-exit).
Then the only way to process is to go throw the items, and consider an order with all his items delivered as closed.
To complete this task, we have created a new technical blocking type “CREAT” to store the status active of an order with a start and end time.
The attribution of the GBU
The GBU is attributed in PF1 and RHO by the business area, in WP1, the GBU is attributed by the division and the distribution channel. For the second case, the division is present at the header and item level. The logic is to read first the division at the header level, then replace it by the value found at the item level.
Sales orders elligible for credit management
The sales orders that will be extracted by the program must have a sales document type that are activated for credit managment check (TVAK-KLIMP = ‘D’).
The sales document types are not harmonized, you will find a list by system in the Annexes.
Extra information about particular blocking codes
CREAT : Life of the order (technical field)
This blocking type is a technical blocking type to be able to recognize the active orders during a period.
CMGST : Overall status of credit checks
Main status of the order. This order should reflect the status of the sub-blocking types.
In the ERP, the overall status is sometimes close, but not the sub-blocking types. Then, the extractor automatically close the sub-status if the overall status has been closed to provide correct data in the report.
CMPSL : Status of credit check of reserves 4
Status of credit check of reserves 4 - I do not know this field and it seems there are no programs/FM using or populating it. I checked VBUK and there are no SO with it populated, so I would say, not used in SOLVAY.
CMPS0 : Tolerance (Status of credit check for customer reserve 1)
Tolerance (Status of credit check for customer reserve 1) - Used in SOLVAY - this blocking is activated for risk categories that have a bonus of 5% or 10% of its credit limit (please see risk categories info on page 12 - Dynamic Check table, Column Tolerance). But we set a boundary of 100K€ (Risk categories 3X) or 250K€ (Risk categories 1X and 2X), depending on risk category, for the maximum bonus.
CMPS1 : Advance payment (Status of credit check for reserve 2)
Advance payment (Status of credit check for reserve 2) - Used in SOLVAY - this blocking is activated when you have credit status 003 (Doubtful Customer), 004 (Letter of Credit) or 005 (Payment in Advance) in FD33 transaction.
CMPS2 : Status of credit check for customer reserve 3
Not used for the moment.
In the report
We have to present the following indicators with the corresponding technical field :
Reason in the report | Technical field |
For limit reason | CMPSB |
For overdue reason | CMPSF |
For old financial information (expired validity date) | CMPSE |
For mix reason | One of the blocking type in the list This blocking type will be managed in BW |
For payment term reason | CMPSD |
How to obtain the different indicators :
% of blocked orders for credit reasons
Total Number of orders blocked during the period divided by the total number of orders
By order, check if a blocking segment exists, if yes count it. At the end divide the total by the total of active orders.
Total number of blocked orders for limit reason / total number of blocked orders
By order, check if a blocking segment exists (CMPSB), if yes count i. At the end divide the total by the total of active orders.
Total number of blocked orders for overdue reason / total number of blocked orders
By order, check if a blocking segment exists (CMPSF), if yes count it. At the end divide the total by the total of active orders.
Total number of blocked orders for old financial information (expired validity date)
By order, check if a blocking segment exists (CMPSE), if yes count it. At the end divide the total by the total of active orders.
Total number of blocked orders for mix reason / total number of blocked orders
Same as the first indicator.
Average duration to release a blocked order by blocking reason
Average time in hours to release an order blocked by blocking reason
For each order and segment, calculate the average time (end time – start time)
Average nbr of orders released in a day
Nbr of orders in average released in a day
Count the number of orders with the rule : end time – start time < (3600*24)
Orders reblocked
Nbr and % of reblocked orders compared to total of orders blocked
Based on the overall status of the order (CMGST)
The queries
2 queries have been developped for this subject :
BW_QRY_MVFIAR03_0001 : Detailled query
BW_QRY_MVFIAR03_0002 : Evolution
A workbook has been created to present the both queries.
Selection screen for both reports :
Key date for blocked orders : the period is deduced from the day indicated in this field.
For example, if you indicate the 01.12.2014, the period deduced will be 01.12.2014 to 31.12.2014.
The blocking types in the queries have sometimes other texts as in the ERP :
Field | Text in the queries | Text in the ERP |
CMGST | Overall status of credit checks | |
CMPSA | Status of static credit limit check | |
CMPSB | > Credit Limit | Status of dynamix credit limit check in the credit horizon |
CMPSC | Maximum Document Value | Status of credit check against maximum document value |
CMPSD | Payment Terms Deviation | Status of credit check against terms of payment |
CMPSE | Customer Review Date | Status of credit check against customer review date |
CMPSF | Overdue | Status of credit check against open items due |
CMPSG | Oldest Open Items | Status of credit check against oldest open items |
CMPSH | Status of credit check against highest dunning level | |
CMPSI | Secured Payment | Status of credit check against financial document |
CMPSJ | Status of credit check against export credit insurance | |
CMPSK | Status of credit check against payment card authorization | |
CMPSL | Status of credit check of reserves 4 | |
CMPSM | Obsolete Check | Credit check data is obsolete |
CMPS0 | Tolerance | Tolerance (Status of credit check for customer reserve 1) |
CMPS1 | Customer Credit Status | Advance payment (Status of credit check for reserve 2) |
CMPS2 | Status of credit check for customer reserve 3 |
BW_QRY_MVFIAR03_0001 : Detailled query
Columns | Explanation |
Active orders | This column will present the really active orders in the system. It’s a macro view. If an order is active from several months, you will see in all the period before it’s definitively closed. |
Created in the period | Subset of the previous indicator. This view limit only the view to the orders created during the period you want to see. |
Orders blocked | Number of orders blocked for each blocking type during the period. This indicator is aggregated by order : if an order has been blocked several times, it will be counted for 1. |
Orders blocked during the period | Subset of the previous indicator. The number only keep the activities of the period (ie. the action has begun during the current period) |
Credit blocks | Number of credit blocks. If an order is blocked several times, you will have the real number of credit blocks. |
Credit blocks during the period | Subset of the previous indicator. The number only keep the activities of the period (ie. the action has begun during the current period) |
Orders reblocked | Number of order reblocked. This value is based on the overall status and aggregated by sales order. |
Orders reblocked during the period | Subset of the previous indicator, limited to the current period. |
Avg hours to release | Average time to release a credit block. It’s the time between the beginning of the blocking segment and the end time. |
Released in 24 hours | Number of orders released in 24 hours |
Released in 48 hours | Number of orders released in 48 hours |
Axes | Technical field | Explanation |
BFC Activity 1 | 0G_CWWE01__C_MAGNITU | Based on the sub-activity, the BFC activity 1 |
BFC Activity 2 | 0G_CWWE01__CPFCTR3_2 | Based on the sub-activity, the BFC activity 2 |
BFC GBU | 0G_CWWE01__CPFCTR1_2 | Based on the sub-activity, the BFC GBU |
BFC Group of activ | 0G_CWWE01__CPFCTR2_2 | Based on the sub-activity, the group of activities |
Closed (Time Stamp) | 0CSM_CLTI | Closed time for the current segment |
Country key | C_COMPPRS__0COUNTRY | Country of the company code |
Country of the payer | 0PAYER__0COUNTRY | Country of the payer |
Created (Time Stamp) | 0CSM_CRTI | Create time for the current segment |
Cust.Cred.Grp | 0CRED_GROUP | Credit group |
Customer Group | C_CST_CA2__0CUST_GR_CM | Customer group from Credit account |
Flag Intercompany | C_COMPPRS__C_FLGINT | Status of the company code |
Geography / Zone | C_COMPPRS__C_ZONE | Zone of the company code |
Nb hours to release | C_NBHOURS | Number of hours between the open and close status of the segment |
PRS Company code | C_COMPPRS | Company code |
PRS Customer | C_CUSTPRS | Customer code |
PRS Customer Credit Control Area | C_CST_CA2 | Credit account |
PRS Payer | C_CUSTPR | Payer |
Rating | C_CST_CA2__0RATING | Rating from Credit account |
Rep. group | 0REPR_GROUP | Representative group |
Risk category | C_CST_CA2__0RISK_CATEG | Risk category from Credit account |
Sales document | 0DOC_NUMBER | Sales document number |
Source System | 0LOGSYS | Source system of the data |
Sub-activity | 0G_VWWE01 | Sub-activity retrieved from BA in PF1 world, and Division and Distribution channel in RCS |
Valid from | 0DATEFROM | Start date of the segment |
Valid to | 0DATETO | End date of the segment |
BW_QRY_MVFIAR03_0002 : Evolution
This report presents data by period calculated from the calendar day chosen in the selection screen.
The blocking types are represented by columns instead of lines in the previous report.
Annexes
Sales document types
PF1 :
Sales document type | Text |
BV | BV Cash Sale |
CRMC | CRM Complaints |
CRMR | CRM Returns |
KBCC | KBCC CC Consign Sto |
SB | SB Third-p dir order |
SO | SO Rush Order |
T1 | T1 T1 Fictiv DebitRequ |
TD | TD Standard Order |
TDIV | TDIV Misc Op |
TSC | CRM Sales/Complaints |
ZIND | Industr. Façon BR |
ZITI | Sales Order ITI BR |
ZORB | Standard Order BR |
ZPVA | ZPVA Ord.immed.ship |
ZPVK | ZPVK On contract |
ZRCM | Sales Accnt/Order BR |
ZTD | ZTD Std Order Val=0 |
ZTDL | ZTDL Std Order w/o GI |
ZTDR | ZTDR TDR w. value 0 |
ZVEX | Fut. Dely Invoice BR |
ZVNP | Non Product Order BR |
WP1 :
Sales document type | Text |
COB | Schedule agreementBR |
KB | Consignment Fill-up |
KBB | BR Consig&Loan Deliv |
LP | Scheduling Agreement |
NL | Replenishment Dlv. |
ORB | BR Standard order |
RCM | BR Cta.&Ord. Sales |
TA | Standard Order |
TAM | Delivery Order |
VDOR | Venda à Ordem BR |
VEF | BR Anticip. Sales |
ZCSB | Service/Qty Contract |
ZEXP | BR Export |
ZFAC | BR Standard order |
ZFEF | fut del tolling |
ZLMB | Deb.MemoReq. f.Ctrct |
ZLS | Deb.MemoReq. service |
ZOR | Immediate delivery |
ZPF | Std Ord. Bill.Price |
ZPRS | |
ZRG | Scheduling Agreement |
ZSO | |
ZSUC | Service/Scr.Contract |
ZVAO | Venda à Ordem BR |
Structure of the table zzv_kpi_creditbl (old structure)
Field | Type | Length | Explanation |
MANDT | CLNT | 3 | Client |
PERIO | NUMC | 6 | Calendar year / month |
KKBER | CHAR | 4 | Credit Control Area |
GSBER | CHAR | 4 | Business Area |
BUKRS_VF | CHAR | 4 | Company code to be billed |
KNKLI | CHAR | 10 | Customer's account number with credit limit reference |
CESSION_KZ | CHAR | 2 | Accounts Receivable Pledging Indicator |
KUNRG | CHAR | 10 | Payer |
SBGRP | CHAR | 3 | Credit representative group for credit management |
VBELN | CHAR | 10 | Sales Document |
CMGST | CHAR | 1 | Overall status of credit checks |
CMPSB | CHAR | 1 | Status of dynamic credit limit check in the credit horizon |
CMPSF | CHAR | 1 | Status of credit check against open items due |
CMPSI | CHAR | 1 | Status of credit check against financial document |
CMPSM | CHAR | 1 | Credit check data is obsolete |
CMPSX | CHAR | 12 | Character Field of Length 12 |
NBLOC | INT4 | 10 | Number of such block or unblock configuration |
CMGS1 | CHAR | 1 | Overall status of credit checks |
NDLM1 | INT4 | 10 | Not delivered at end of M-1 |
NDL_M | INT4 | 10 | Not delivered (at end of M) |
DEL_M | CLNT | 10 | Delivered |
CRNDL | INT4 | 10 | Created and not delivered (during the preiod M) |
CRDEL | INT4 | 10 | Created and delivered |
TOTAL | INT4 | 10 | Total of credit relevant orders |
PERVE | NUMC | 8 | Personnel Number |
PERVW | NUMC | 8 | Personnel Number |
ERDAT | DATS | 8 | Date on Which Record Was Created |