Skip to content

SalesOrders_V2

Source SQL File - Google Cloud Cortex Data Foundation

Google Cloud Cortex Foudantion - Cortex Reporting - (s4) - SalesOrders_V2

Overview

This view is a reporting view for SAP systems that provides detailed information about sales orders and their items. It combines data from the VBAP and VBAK tables to provide a comprehensive view of sales order data.

Data Sources

Source Table/View Description
VBAP Item-level data for sales orders, including material numbers, quantities, prices, and taxes.
VBAK Header-level data for sales orders, including customer information, order dates, and totals.

Key Use Cases

  • Analyzing sales performance by product, customer, or region.
  • Identifying trends and patterns in sales data.
  • Creating reports and dashboards for sales management.
  • Providing data for data warehousing and business intelligence applications.

Query Logic

The view uses a LEFT JOIN to combine data from the VBAP and VBAK tables on the VBELN and MANDT fields. The query also includes several calculated fields, such as NetPrice_NETPR, NetValueOfTheSalesOrderInDocumentCurrency_NETWR, CostInDocumentCurrency_WAVWR, TaxAmountInDocumentCurrency_MWSBP, and SalesOrderValueLineItemSourceCurrency, which are calculated using COALESCE and tcurx_vbak/tcurx_vbap tables.

Possible relation with SAP Transactions

Transaction Code Transaction Description
VA01 Create Sales Order
VA02 Change Sales Order
VA03 Display Sales Order

Data Lineage

Under Development

Table/View Fields

Field Field Description Description in SAP Dictionary (Comming soon)
Client_MANDT Client
SalesDocument_VBELN Sales Document
Item_POSNR Item
MaterialNumber_MATNR Material Number
CreationDate_ERDAT Creation Date
CreationTime_ERZET Creation Time
CreatedBy_ERNAM Created By
QuotationDateFrom_ANGDT Quotation Date From
QuotationDateTo_BNDDT Quotation Date To
DocumentDate_AUDAT Document Date
DocumentCategory_VBTYP Document Category
TransactionGroup_TRVOG Transaction Group
SalesDocumentType_AUART Sales Document Type
Reason_AUGRU Reason
WarrantyDate_GWLDT Warranty Date
CollectiveNumber_SUBMI Collective Number
DeliveryBlock_LIFSK Delivery Block
BillingBlock_FAKSK Billing Block
CurrencyHdr_WAERK Currency Hdr
SalesOrganization_VKORG Sales Organization
DistributionChannel_VTWEG Distribution Channel
DivisionHdr_SPART Division Hdr
SalesGroup_VKGRP Sales Group
SalesOffice_VKBUR Sales Office
BusinessAreaHdr_GSBER Business Area Hdr
CostCtrBusinessArea_GSKST Cost Ctr Business Area
AgreementValidFrom_GUEBG Agreement Valid From
AgreementValidTo_GUEEN Agreement Valid To
ConditionNumber_KNUMV Condition Number
RequestedDeliveryDate_VDATU Requested Delivery Date
ProposedDateType_VPRGR Proposed Date Type
CompleteDeliveryFlag_AUTLF Complete Delivery Flag
OriginalSystem_VBKLA Original System
DocumentIndicator_VBKLT Document Indicator
PricingProcedure_KALSM Pricing Procedure
ShippingConditions_VSBED Shipping Conditions
ProposedBillingType_FKARA Proposed Billing Type
SalesProbability_AWAHR Sales Probability
SearchTermForProductProposal_KTEXT Search Term For Product Proposal
CustomerPurchaseOrderNumber_BSTNK Customer Purchase Order Number
CustomerPurchaseOrderType_BSARK Customer Purchase Order Type
CustomerPurchaseOrderDate_BSTDK Customer Purchase Order Date
PurchaseOrderNumberSupplement_BSTZD Purchase Order Number Supplement
YourReference_IHREZ Your Reference
NameOfOrderer_BNAME Name Of Orderer
TelephoneNumber_TELF1 Telephone Number
NumberOfContactsFromTheCustomer_MAHZA Number Of Contacts From The Customer
LastCustomerContactDate_MAHDT Last Customer Contact Date
SoldToParty_KUNNR Sold To Party
CostCenterHdr_KOSTL Cost Center Hdr
UpdateGroupForStatistics_STAFO Update Group For Statistics
StatisticScurrency_STWAE Statistic Scurrency
ChangedOn_AEDAT Changed On
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
Agreement_KNUMA Agreement
ControllingArea_KOKRS Controlling Area
WBSElementHdr_PS_PSP_PNR WBSElement Hdr
ExchangeRateType_KURST Exchange Rate Type
CreditControlArea_KKBER Credit Control Area
CustomerCreditLimitRef_KNKLI Customer Credit Limit Ref
CustomerCreditGroup_GRUPP Customer Credit Group
CreditRepresentativeGroupForCreditManagement_SBGRP Credit Representative Group For Credit Management
RiskCategory_CTLPC Risk Category
CurrencyKeyOfCreditControlArea_CMWAE Currency Key Of Credit Control Area
ReleASeDateOfTheDocumentDeterminedByCreditManagement_CMFRE Rele AS e Date Of The Document Determined By Credit Management
DateOfNextCreditCheckOfDocument_CMNUP Date Of Next Credit Check Of Document
NextDate_CMNGV Next Date
ReleasedCreditValueOfTheDocument_AMTBL Released Credit Value Of The Document
HierarchyTypeForPricing_HITYP_PR Hierarchy Type For Pricing
UsageIndicator_ABRVW Usage Indicator
MRPForDeliveryScheduleTypes_ABDIS MRP For Delivery Schedule Types
DocumentNumberOfTheReferenceDocument_VGBEL Document Number Of The Reference Document
ObjectNumberAtHeaderLevel_OBJNR Object Number At Header Level
CompanyCodeToBeBilled_BUKRS_VF Company Code To Be Billed
AlternativeTaxClassification_TAXK1 Alternative Tax Classification
TaxClassification2_TAXK2 Tax Classification 2
TaxClassification3_TAXK3 Tax Classification 3
TaxClassification4_TAXK4 Tax Classification 4
TaxClassification5_TAXK5 Tax Classification 5
TaxClassification6_TAXK6 Tax Classification 6
TaxClassification7_TAXK7 Tax Classification 7
TaxClassification8_TAXK8 Tax Classification 8
TaxClassification9_TAXK9 Tax Classification 9
ReferenceDocumentNumber_XBLNR Reference Document Number
AssignmentNumber_ZUONR Assignment Number
PreDocCategory_VGTYP Pre Doc Category
OrderNumberHdr_AUFNR Order Number Hdr
NotificationNo_QMNUM Notification No
MasterContractNumber_VBELN_GRP Master Contract Number
TaxDestinationCountry_STCEG_L Tax Destination Country
TaxDepartureCountry_LANDTX Tax Departure Country
InternationalUniqueKey_HANDLE International Unique Key
DangerousGoodsManagementProfile_PROLI Dangerous Goods Management Profile
DangerousGoodsFlag_CONT_DG Dangerous Goods Flag
UTCTimeStampL_UPD_TMSTMP UTC Time Stamp L
MaterialEntered_MATWA Material Entered
PricingReferenceMaterial_PMATN Pricing Reference Material
BatchNumber_CHARG Batch Number
MaterialGroup_MATKL Material Group
ShortText_ARKTX Short Text
ItemCategory_PSTYV Item Category
ItemType_POSAR Item Type
RelevantForDelivery_LFREL Relevant For Delivery
RelevantForBilling_FKREL Relevant For Billing
BOMItemLevel_UEPOS BOM Item Level
AlternativeForItem_GRPOS Alternative For Item
RejectionReason_ABGRU Rejection Reason
ProductHierarchy_PRODH Product Hierarchy
TargetValue_ZWERT Target Value
TargetQuantityUoM_ZMENG Target Quantity UoM
TargetQuantityUoM_ZIEME Target Quantity UoM
BaseTargetConversionFactor_UMZIZ Base Target Conversion Factor
ConversionFactor_UMZIN Conversion Factor
BaseUnitOfMeasure_MEINS Base Unit Of Measure
ScaleQuantity_SMENG Scale Quantity
RoundingQuantityForDelivery_ABLFZ Rounding Quantity For Delivery
ReconciliationDate_ABDAT Reconciliation Date
AllowedDeviation_ABSFZ Allowed Deviation
ItemNumberOfTheUnderlyingPurchaseOrder_POSEX Item Number Of The Underlying Purchase Order
CustomerMaterialNumber_KDMAT Customer Material Number
AllowedDeviationPercent_KBVER Allowed Deviation Percent
DaysByWhichTheQuantityCanBeShifted_KEVER Days By Which The Quantity Can Be Shifted
RepairProcessing_VKGRU Repair Processing
UsageIndicator_VKAUS Usage Indicator
DeliveryGroup_GRKOR Delivery Group
QuantityIsFixed_FMENG Quantity Is Fixed
UnlimitedOverDeliveryAllowed_UEBTK Unlimited Over Delivery Allowed
OverDeliveryToleranceLimit_UEBTO Over Delivery Tolerance Limit
UnderDeliveryToleranceLimit_UNTTO Under Delivery Tolerance Limit
BillingBlockForItem_FAKSP Billing Block For Item
ReplacementPart_ATPKZ Replacement Part
FormOfBillingForCO_RKFKF Form Of Billing For CO
Division_SPART Division
BusinessArea_GSBER Business Area
NetPrice_NETWR Net Price
Currency_WAERK Currency
MaximumPartialDeliveries_ANTLF Maximum Partial Deliveries
PartialDeliveryAtItemLevel_KZTLF Partial Delivery At Item Level
BatchSplitAllowed_CHSPL Batch Split Allowed
CumulativeOrderQuantity_KWMENG Cumulative Order Quantity
CumulativeTargetDeliveryQty_LSMENG Cumulative Target Delivery Qty
CumulativeConfirmedQuantity_KBMENG Cumulative Confirmed Quantity
CumulativeConfirmedQuantityInBASeUoM_KLMENG Cumulative Confirmed Quantity In BAS e UoM
SalesUnit_VRKME Sales Unit
NumeratorQty_UMVKZ Numerator Qty
DenominatorQty_UMVKN Denominator Qty
GrossWeightOfItem_BRGEW Gross Weight Of Item
NetWeightOfItem_NTGEW Net Weight Of Item
WeightUnit_GEWEI Weight Unit
VolumeOfTheItem_VOLUM Volume Of The Item
VolumeUnit_VOLEH Volume Unit
OriginatingDocument_VBELV Originating Document
OriginatingItem_POSNV Originating Item
ReferenceDocument_VGBEL Reference Document
ReferenceItem_VGPOS Reference Item
ReferenceIndicator_VOREF Reference Indicator
UpdateIndicator_UPFLU Update Indicator
CompletionRuleForQuotation_ERLRE Completion Rule For Quotation
DeliveryPriority_LPRIO Delivery Priority
Plant_WERKS Plant
StorageLocation_LGORT Storage Location
ShippingReceivingPoint_VSTEL Shipping Receiving Point
Route_ROUTE Route
BOMOrigin_STKEY BOM Origin
BOMDate_STDAT BOM Date
BOM_STLNR BOM
OrderProbabilityOfTheItem_AWAHR Order Probability Of The Item
TaxClassification1_TAXM1 Tax Classification 1
TaxClassification2_TAXM2 Tax Classification 2
TaxClassification3_TAXM3 Tax Classification 3
TaxClassification4_TAXM4 Tax Classification 4
TaxClassification5_TAXM5 Tax Classification 5
TaxClassification6_TAXM6 Tax Classification 6
TaxClassification7_TAXM7 Tax Classification 7
TaxClassification8_TAXM8 Tax Classification 8
TaxClassification9_TAXM9 Tax Classification 9
FixedShippingProcessingTimeInDays_VBEAF Fixed Shipping Processing Time In Days
VariableShippingProcessingTimeInDays_VBEAV Variable Shipping Processing Time In Days
PrecedingDocumentHasResultedFromReference_VGREF Preceding Document Has Resulted From Reference
ConditionPricingUnit_KPEIN Condition Pricing Unit
ConditionUnit_KMEIN Condition Unit
ReturnsItem_SHKZG Returns Item
CashDiscountIndicator_SKTOF Cash Discount Indicator
CheckingGroupForAvailabilityCheck_MTVFP Checking Group For Availability Check
SummingUpOfRequirements_SUMBD Summing Up Of Requirements
MaterialPricingGroup_KONDM Material Pricing Group
AccountAssignmentGroupForThisMaterial_KTGRM Account Assignment Group For This Material
VolumeRebateGroup_BONUS Volume Rebate Group
CommissionGroup_PROVG Commission Group
PricingIsOK_PRSOK Pricing Is OK
ValuationType_BWTAR Valuation Type
SeparateValuation_BWTEX Separate Valuation
BatchManagementRequirementIndicator_XCHPF Batch Management Requirement Indicator
BatchManagementIndicator_XCHAR Batch Management Indicator
MinimumDeliveryQuantityInDeliveryNoteProcessing_LFMNG Minimum Delivery Quantity In Delivery Note Processing
UpdateGroupForStatisticsUpdate_STAFO Update Group For Statistics Update
SubTotal1FromPricingProcedureForCondition_KZWI1 Sub Total 1 From Pricing Procedure For Condition
SubTotal2FromPricingProcedureForCondition_KZWI2 Sub Total 2 From Pricing Procedure For Condition
SubTotal3FromPricingProcedureForCondition_KZWI3 Sub Total 3 From Pricing Procedure For Condition
SubTotal4FromPricingProcedureForCondition_KZWI4 Sub Total 4 From Pricing Procedure For Condition
SubTotal5FromPricingProcedureForCondition_KZWI5 Sub Total 5 From Pricing Procedure For Condition
SubTotal6FromPricingProcedureForCondition_KZWI6 Sub Total 6 From Pricing Procedure For Condition
ExchangeRateForStatistics_STCUR Exchange Rate For Statistics
LastChangedOn_AEDAT Last Changed On
InternationalArticleNumber_EAN11 International Article Number
DeliveryDateAndQuantityFixed_FIXMG Delivery Date And Quantity Fixed
ProfitCenter_PRCTR Profit Center
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
ComponentQuantity_KMPMG Component Quantity
ReasonForMaterialSubstitution_SUGRD Reason For Material Substitution
SpecialStockIndicator_SOBKZ Special Stock Indicator
AllocationIndicator_VPZUO Allocation Indicator
ProfitabilitySegmentNumber_PAOBJNR Profitability Segment Number
WBSElement_PS_PSP_PNR WBSElement
PlanningMaterial_VPMAT Planning Material
PlanningPlant_VPWRK Planning Plant
BaseUnitOfMeasureForProductGroup_PRBME Base Unit Of Measure For Product Group
ConversionFactorQuantities_UMREF Conversion Factor Quantities
AccountAssignmentCategory_KNTTP Account Assignment Category
ConsumptionPosting_KZVBR Consumption Posting
BOMExplosionNumber_SERNR BOM Explosion Number
ObjectNumberAtItemLevel_OBJNR Object Number At Item Level
ResultsAnalysisKey_ABGRS Results Analysis Key
RequirementsType_BEDAE Requirements Type
ItemCreditPrice_CMPRE Item Credit Price
CreditBlock_CMTFG Credit Block
RelevantForCredit_CMPNT Relevant For Credit
Configuration_CUOBJ Configuration
InternalObjectNumberOfTheBatchClassification_CUOBJ_CH Internal Object Number Of The Batch Classification
StatusExpectedPrice_CEPOK Status Expected Price
ConditionUpdate_KOUPD Condition Update
SerialNumberProfile_SERAIL Serial Number Profile
NumberOfSerialNumbers_ANZSN Number Of Serial Numbers
CustomerHasNotPostedGoodsReceipt_NACHL Customer Has Not Posted Goods Receipt
PackagingMaterials_MAGRV Packaging Materials
StatusManualPriceChange_MPROK Status Manual Price Change
PrecedingDocCategory_VGTYP Preceding Doc Category
CostEstimateNumber_KALNR Cost Estimate Number
CostingVariant_KLVAR Costing Variant
BOMItemNumber_SPOSN BOM Item Number
StatisticalValues_KOWRR Statistical Values
StatisticsDate_STADAT Statistics Date
BusinessTransactionTypeForForeignTrade_EXART Business Transaction Type For Foreign Trade
ImportExportFlag_PREFE Import Export Flag
NumberOfConditionRecord_KNUMH Number Of Condition Record
InternalClassNumber_CLINT Internal Class Number
BOMCategory_STLTY BOM Category
BOMItemNodeNumber_STLKN BOM Item Node Number
InternalCounter_STPOZ Internal Counter
InconsistentConfiguration_STMAN Inconsistent Configuration
OverHeadKey_ZSCHL_K Over Head Key
CostingSheet_KALSM_K Costing Sheet
CostingVariant_KALVAR Costing Variant
ProductAllocation_KOSCH Product Allocation
PricingReferenceMaterial_UPMAT Pricing Reference Material
MaterialPricingGroup_UKONM Material Pricing Group
MaterialFreightGroup_MFRGR Material Freight Group
PlanningReleaseRegulation_PLAVO Planning Release Regulation
KANBAN_KANNR KANBAN
ItemCreditPrice_CMPRE_FLT Item Credit Price
FormOfPaymentGuarantee_ABFOR Form Of Payment Guarantee
GuaranteedFactor_ABGES Guaranteed Factor
ValueContractNo_WKTNR Value Contract No
ValueContractItem_WKTPS Value Contract Item
AssortmentModule_SKOPF Assortment Module
ValuationofSpecialStock_KZBWS ValuationofSpecialStock
MaterialGroupHierarchy1_WGRU1 Material Group Hierarchy 1
MaterialGroupHierarchy2_WGRU2 Material Group Hierarchy 2
Promotion_KNUMA_PI Promotion
SalesDeal_KNUMA_AG Sales Deal
LeadingUoM_KZFME Leading UoM
FreeGoodsDeliveryControl_LSTANR Free Goods Delivery Control
ParameterVariant_TECHS Parameter Variant
MRPArea_BERID MRPArea
ProfitCenterForBilling_PCTRF Profit Center For Billing
ManagingLocation_STOCKLOC Managing Location
TypeOfFirstInventory_SLOCTYPE Type Of First Inventory
ReturnReason_MSR_RET_REASON Return Reason
ReturnsRefundCode_MSR_REFUND_CODE Returns Refund Code
ApprovalBlock_MSR_APPROV_BLOCK Approval Block
ConditionRecordNumber_NRAB_KNUMH Condition Record Number
RiskRelevancyInSales_TRMRISK_RELEVANT Risk Relevancy In Sales
LocationForAPhysicalHandOverOfGoods_HANDOVERLOC Location For A Physical Hand Over Of Goods
HandOverDateAtTheHandOverLocation_HANDOVERDATE Hand Over Date At The Hand Over Location
HandOverTimeAtTheHandOverLocation_HANDOVERTIME Hand Over Time At The Hand Over Location
TaxCodeAutomaticallyDetermined_TC_AUT_DET Tax Code Automatically Determined
ManualTaxCodeReASon_MANUAL_TC_REASON Manual Tax Code Re AS on
TaxIncentiveType_FISCAL_INCENTIVE Tax Incentive Type
IncentiveID_FISCAL_INCENTIVE_ID Incentive ID
NotAFiscalSpecialCaseForCFOPDetermination_SPCSTO Not A Fiscal Special Case For CFOP Determination
CostCenter_KOSTL Cost Center
Fund_FONDS Fund
FundsCenter_FISTL Funds Center
FunctionalArea_FKBER Functional Area
YearOfSalesOrderCreationDate_ERDAT Year Of Sales Order Creation Date
MonthOfSalesOrderCreationDate_ERDAT Month Of Sales Order Creation Date
WeekOfSalesOrderCreationDate_ERDAT Week Of Sales Order Creation Date
DayOfSalesOrderCreationDate_ERDAT Day Of Sales Order Creation Date
QuarterOfSalesOrderCreationDate_ERDAT Quarter Of Sales Order Creation Date
YearOfRequestedDeliveryDate_VDATU Year Of Requested Delivery Date
MonthOfRequestedDeliveryDate_VDATU Month Of Requested Delivery Date
WeekOfRequestedDeliveryDate_VDATU Week Of Requested Delivery Date
DayOfRequestedDeliveryDate_VDATU Day Of Requested Delivery Date
QuarterOfRequestedDeliveryDate_VDATU Quarter Of Requested Delivery Date
NetPrice_NETPR Net Price
NetValueOfTheSalesOrderInDocumentCurrency_NETWR Net Value Of The Sales Order In Document Currency
CostInDocumentCurrency_WAVWR Cost In Document Currency
TaxAmountInDocumentCurrency_MWSBP Tax Amount In Document Currency
SalesOrderValueLineItemSourceCurrency Sales Order Value at item level in Source Currency

Comments