Skip to content

Billing

Source SQL File - Google Cloud Cortex Data Foundation

Google Cloud Cortex Foudantion - Cortex Reporting - (ecc) - Billing

Overview

This view provides a comprehensive reporting dataset for SAP systems, combining data from the VBRK and VBRP tables along with additional calculations and dimensions. It offers insights into billing documents, customer information, product details, and financial metrics, enabling detailed analysis and reporting.

Data Sources

Source Table/View Description
vbrk Billing Document Header Table
vbrp Billing Document Item Table
aggkonv Custom view for rebate calculation
currency_decimal Currency Decimal Table
currency_conversion Currency Conversion Table
calendar_date_dim Calendar Date Dimension Table

Key Use Cases

  • Sales analysis by customer, product, and region
  • Financial reporting on billing documents and revenue
  • Tracking of billing and payment status
  • Customer segmentation and targeted marketing campaigns
  • Performance monitoring of sales teams and products

Query Logic

The query combines data from the VBRK and VBRP tables using an inner join on the VBELN field. It then performs calculations for rebate, net value, and tax amounts, and joins with the AGGKONV view for rebate information. The query also includes currency conversion logic and joins with the calendar_date_dim table to add temporal dimensions. Finally, it calculates additional metrics such as order counts for different time periods.

Possible relation with SAP Transactions

Transaction Code Transaction Description
VF01 Create Billing Document
VF02 Change Billing Document
VF03 Display Billing Document
FBL1N Display Line Items: Document Overview
FBL3N Display Line Items: G/L Account

Data Lineage

Under Development

Table/View Fields

Field Field Description Description in SAP Dictionary (Comming soon)
Client_MANDT Client
BillingType_FKART Billing Type
BillingCategory_FKTYP Billing Category
SalesOrganization_VKORG Sales Organization
DistributionChannel_VTWEG Distribution Channel
Division_SPART Division
SDDocumentCategory_VBTYP SD Document Category
SalesDistrict_BZIRK Sales District
PriceListType_PLTYP Price List Type
BillingDocumentIsCancelled_FKSTO Billing Document Is Cancelled
Payer_KUNRG Payer
IncotermsPart1_INCO1 Incoterms Part 1
IncotermsPart2_INCO2 Incoterms Part 2
DestinationCountry_LAND1 Destination Country
Region_REGIO Region
CountryCode_COUNC Country Code
CityCode_CITYC City Code
TaxClassification1ForCustomer_TAXK1 Tax Classification 1 For Customer
TaxClassification2ForCustomer_TAXK2 Tax Classification 2 For Customer
TaxClassification3ForCustomer_TAXK3 Tax Classification 3 For Customer
TaxClassification4ForCustomer_TAXK4 Tax Classification 4 For Customer
TaxClassification5ForCustomer_TAXK5 Tax Classification 5 For Customer
TaxDepartureCountry_LANDTX Tax Departure Country
OriginOfSalesTaxIDNumber_STCEG_H Origin Of Sales Tax ID Number
CountryOfSalesTaxIDNumber_STCEG_L Country Of Sales Tax ID Number
ReferenceDocumentNumber_XBLNR Reference Document Number
CustomerPriceGroup_KONDA Customer Price Group
StatusForTransferToAccounting_RFBSK Status For Transfer To Accounting
BillingDate_FKDAT Billing Date
FiscalYear_GJAHR Fiscal Year
PostingPeriod_POPER Posting Period
RecordCreationDate_ERDAT Record Creation Date
LastChangeDate_AEDAT Last Change Date
CustomerGroup_KDGRP Customer Group
PaymentMethod_ZLSCH Payment Method
CompanyCode_BUKRS Company Code
DunningKey_MSCHL Dunning Key
DunningBlock_MANSP Dunning Block
SoldToParty_KUNAG Sold To Party
AccrualBillingType_FKART_AB Accrual Billing Type
AccountingDocumentNumber_BELNR Accounting Document Number
ShippingConditions_VSBED Shipping Conditions
SdDocumentCurrency_WAERK Sd Document Currency
BusinessArea_GSBER Business Area
BillingDocument_VBELN Billing Document
BillingItem_POSNR Billing Item
SalesDocumentItemCategory_PSTYV Sales Document Item Category
ItemType_POSAR Item Type
CostCenter_KOSTL Cost Center
SalesGroup_VKGRP Sales Group
SalesOffice_VKBUR Sales Office
ProfitCenter_PRCTR Profit Center
ControllingArea_KOKRS Controlling Area
DocumentCategoryOfPrecedingSDDocument_VGTYP Document Category Of Preceding SD Document
MaterialNumber_MATNR Material Number
PricingReferenceMaterial_PMATN Pricing Reference Material
BatchNumber_CHARG Batch Number
MaterialGroup_MATKL Material Group
ProductHierarchy_PRODH Product Hierarchy
Plant_WERKS Plant
MaterialPriceGroup_KONDM Material Price Group
StorageLocation_LGORT Storage Location
InternationalArticleNumber_EAN11 International Article Number
MaterialGroup1_MVGR1 Material Group 1
MaterialGroup2_MVGR2 Material Group 2
MaterialGroup3_MVGR3 Material Group 3
MaterialGroup4_MVGR4 Material Group 4
MaterialGroup5_MVGR5 Material Group 5
BOMExplosionNumber_SERNR BOM Explosion Number
CustomerGroup1_KVGR1 Customer Group 1
CustomerGroup2_KVGR2 Customer Group 2
CustomerGroup3_KVGR3 Customer Group 3
CustomerGroup4_KVGR4 Customer Group 4
CustomerGroup5_KVGR5 Customer Group 5
TaxJurisdiction_TXJCD Tax Jurisdiction
ShippingPointReceivingPoint_VSTEL Shipping Point Receiving Point
DocumentNumberOfTheReferenceDocument_VGBEL Document Number Of The Reference Document
ItemNumberOfTheReferenceItem_VGPOS Item Number Of The Reference Item
SalesDocument_AUBEL Sales Document
SalesDocumentItem_AUPOS Sales Document Item
ActualBilledQuantity_FKIMG Actual Billed Quantity
Volume_VOLUM Volume
GrossWeight_BRGEW Gross Weight
NetWeight_NTGEW Net Weight
NumberOfTheDocumentCondition_KNUMV Number Of The Document Condition
ConditionItemNumber_KPOSN Condition Item Number
YearOfBillingDate_FKDAT Year Of Billing Date
MonthOfBillingDate_FKDAT Month Of Billing Date
WeekOfBillingDate_FKDAT Week Of Billing Date
DayOfBillingDate_FKDAT Day Of Billing Date
NetValue_NETWR Net Value
TaxAmount_MWSBK Tax Amount
TaxAmountPos_MWSBP Tax Amount Pos
Rebate Rebate
YearOrderCount Year Order Count
MonthOrderCount Month Order Count
WeekOrderCount Week Order Count

Comments