Billing
Source SQL File - Google Cloud Cortex Data Foundation
Google Cloud Cortex Foudantion - Cortex Reporting - (s4) - Billing
Overview
This reporting view provides a comprehensive dataset for analyzing sales-related data from SAP systems. It combines information from multiple tables, including VBRK, VBRP, and AGG_PRCD_ELEMENTS, to provide a holistic view of billing documents, billing items, and pricing conditions.
Data Sources
Source Table/View | Description |
---|---|
VBRK | Billing Document Header Table |
VBRP | Billing Document Item Table |
AGG_PRCD_ELEMENTS | Aggregated Pricing Condition Elements Table |
Key Use Cases
- Analyzing sales performance by customer, product, and region
- Identifying trends and patterns in billing and pricing
- Monitoring key sales metrics such as order volume, revenue, and profitability
- Supporting decision-making and forecasting for sales and marketing initiatives
Query Logic
The query first calculates the total rebate amount for each billing document item in the AGG_PRCD_ELEMENTS table. It then joins this information with the VBRK and VBRP tables to retrieve detailed data about the billing documents, billing items, and pricing conditions. The query also includes calculations for net value, tax amount, and rebate amount in the target currency, using exchange rates from the currency_conversion table. Finally, the query incorporates data from the calendar_date_dim table to provide temporal dimensions for analysis.
Possible relation with SAP Transactions
Transaction Code | Transaction Description |
---|---|
VF03 | Display Billing Document |
VF04 | Change Billing Document |
VF05 | Park Billing Document |
VF06 | Release Billed Invoices |
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 |