├── AccountingDocuments.sql ├── AccountingDocumentsReceivable.sql ├── AccountsPayable.sql ├── AccountsPayableOverview.sql ├── AccountsPayableTurnover.sql ├── AddressesMD.sql ├── AggregateMonthlyInventory.sql ├── AggregateWeeklyInventory.sql ├── BalanceSheet.sql ├── BatchesMD.sql ├── BillOfMaterialsMD.sql ├── Billing.sql ├── BillingBlockingReasonsMD.sql ├── BusinessPartnersMD.sql ├── CashDiscountUtilization.sql ├── CompaniesMD.sql ├── CostCenterAmountsHierarchy_SAMPLE.sql ├── CostCenterHierarchiesMD.sql ├── CostCenterHierarchyFlattened.sql ├── CostCentersMD.sql ├── CountriesMD.sql ├── CurrenciesMD.sql ├── CurrencyConvUtil.sql ├── CurrencyConversion.sql ├── CustomerClearedItems_BSAD.sql ├── CustomerOpenItems_BSID.sql ├── CustomersMD.sql ├── DaysPayableOutstanding.sql ├── Deliveries.sql ├── DeliveriesStatus_PerSalesOrg.sql ├── DeliveryBlockingReasonsMD.sql ├── DistributionChannelsMD.sql ├── DivisionsMD.sql ├── DueDateForCashDiscount1.sql ├── DueDateForCashDiscount2.sql ├── FSVHierarchyFlattened.sql ├── FSVTextsMD.sql ├── FinancialStatement.sql ├── FixedAssetsMD.sql ├── GLAccountsMD.sql ├── GLDocumentsHdr.sql ├── GrossProfitOverview.sql ├── InventoryByPlant.sql ├── InventoryKeyMetrics.sql ├── InvoiceDocuments_Flow.sql ├── LICENSE ├── Languages_T002.sql ├── LedgersMD.sql ├── MaterialGroupsMD.sql ├── MaterialLedger.sql ├── MaterialMovementTypesMD.sql ├── MaterialPlantsMD.sql ├── MaterialTypesMD.sql ├── MaterialsBatchMD.sql ├── MaterialsMD.sql ├── MaterialsMovement.sql ├── MaterialsValuation.sql ├── NetDueDateCalc.sql ├── NetProfitOverview.sql ├── OneTouchOrder.sql ├── OrderToCash.sql ├── POFulfillment.sql ├── POOrderHistory.sql ├── POSchedule.sql ├── POScheduleLine.sql ├── POVendorConfirmation.sql ├── PlantsMD.sql ├── PricingConditions.sql ├── ProductHierarchiesMD.sql ├── ProductHierarchy_Flatten.sql ├── ProductionOrders.sql ├── ProfitAndLoss.sql ├── ProfitAndLossOverview.sql ├── ProfitAndLossOverview_CostCenterHierarchy.sql ├── ProfitAndLossOverview_ProfitCenterHierarchy.sql ├── ProfitCenterAmountsHierarchy_SAMPLE.sql ├── ProfitCenterHierarchiesMD.sql ├── ProfitCenterHierarchyFlattened.sql ├── ProfitCentersMD.sql ├── PurchaseDocumentTypesMD.sql ├── PurchaseDocuments.sql ├── PurchaseDocumentsHistory.sql ├── PurchaseDocuments_Flow.sql ├── PurchasingGroupsMD.sql ├── PurchasingOrganizationsMD.sql ├── README.md ├── ReasonForMovementTypesMD.sql ├── RegionsMD.sql ├── Regions_T005S.sql ├── SDDocumentFlow.sql ├── SDStatus_Items.sql ├── SalesFulfillment.sql ├── SalesFulfillment_perOrder.sql ├── SalesOrderDetails_SAMPLE.sql ├── SalesOrderHeaderStatus.sql ├── SalesOrderPartnerFunction.sql ├── SalesOrderPricing.sql ├── SalesOrderScheduleLine.sql ├── SalesOrderStatus.sql ├── SalesOrders.sql ├── SalesOrders_V2.sql ├── SalesOrganizationsMD.sql ├── SalesStatus_Items.sql ├── SlowMovingThreshold.sql ├── SpecialStocksMD.sql ├── StockCharacteristicsConfig.sql ├── StockInHand.sql ├── StockMonthlySnapshots.sql ├── StockWeeklySnapshots.sql ├── Stock_NonValuated.sql ├── Stock_PerPlant.sql ├── Stock_Unrestricted_vs_Sales.sql ├── StorageLocationsMD.sql ├── TelephoneCodes_T005K.sql ├── UniversalLedgersMD.sql ├── UoMConversion.sql ├── UoMConversionUtil.sql ├── UoMMD.sql ├── UoMUsage_SAMPLE.sql ├── UpdateMonthlyInventoryAggregation.sql ├── UpdateStockMonthlySnapshots.sql ├── UpdateStockWeeklySnapshots.sql ├── UpdateWeeklyInventoryAggregation.sql ├── ValuationAreasMD.sql ├── VendorConfig.sql ├── VendorLeadTimeOverview.sql ├── VendorPerformance.sql ├── VendorPerformanceOverview.sql ├── VendorsMD.sql ├── cloudbuild.reporting.yaml ├── common ├── __init__.py ├── annotations_loader.py ├── create_test_harness.py ├── data_mesh │ ├── __init__.py │ ├── config │ │ ├── lakes │ │ │ └── lakes.yaml │ │ ├── policy_taxonomies │ │ │ └── policy_taxonomies.yaml │ │ └── tag_templates │ │ │ └── tag_templates.yaml │ ├── deploy_data_mesh.py │ └── src │ │ ├── __init__.py │ │ ├── data_mesh_client.py │ │ ├── data_mesh_types.py │ │ └── data_mesh_types_util.py ├── init_deployment_config.py ├── materializer │ ├── __init__.py │ ├── create_bq_object.py │ ├── dag_types.py │ ├── dependent_dags.py │ ├── deploy.sh │ ├── deploy_local_k9.py │ ├── generate_assets.py │ ├── generate_build_files.py │ ├── generate_dependent_dags.py │ └── templates │ │ ├── airflow_dag_template_reporting.py │ │ ├── airflow_task_dep_dag_template_reporting.py │ │ ├── bq_insert_job_template.txt │ │ └── cloudbuild_materializer.yaml.jinja └── py_libs │ ├── __init__.py │ ├── bq_helper.py │ ├── bq_materializer.py │ ├── cdc.py │ ├── config_spec.py │ ├── configs.py │ ├── constants.py │ ├── cortex_bq_client.py │ ├── cortex_exceptions.py │ ├── cortex_types.py │ ├── dag_generator.py │ ├── jinja.py │ ├── k9_deployer.py │ ├── logging.py │ ├── resource_validation_helper.py │ ├── schema_reader.py │ ├── test_harness.py │ └── yaml_util.py ├── config ├── config.json ├── ecc │ ├── annotations │ │ ├── AccountingDocuments.yaml │ │ ├── AccountingDocumentsReceivable.yaml │ │ ├── AccountsPayable.yaml │ │ ├── AccountsPayableOverview.yaml │ │ ├── AccountsPayableTurnover.yaml │ │ ├── AddressesMD.yaml │ │ ├── BalanceSheet.yaml │ │ ├── BatchesMD.yaml │ │ ├── BillOfMaterialsMD.yaml │ │ ├── Billing.yaml │ │ ├── BillingBlockingReasonsMD.yaml │ │ ├── BusinessPartnersMD.yaml │ │ ├── CashDiscountUtilization.yaml │ │ ├── CompaniesMD.yaml │ │ ├── CostCenterAmountsHierarchy_SAMPLE.yaml │ │ ├── CostCenterHierarchiesMD.yaml │ │ ├── CostCenterHierarchyFlattened.yaml │ │ ├── CostCentersMD.yaml │ │ ├── CountriesMD.yaml │ │ ├── CurrenciesMD.yaml │ │ ├── CurrencyConvUtil.yaml │ │ ├── CurrencyConversion.yaml │ │ ├── CustomerClearedItems_BSAD.yaml │ │ ├── CustomerOpenItems_BSID.yaml │ │ ├── CustomersMD.yaml │ │ ├── DaysPayableOutstanding.yaml │ │ ├── Deliveries.yaml │ │ ├── DeliveriesStatus_PerSalesOrg.yaml │ │ ├── DeliveryBlockingReasonsMD.yaml │ │ ├── DistributionChannelsMD.yaml │ │ ├── DivisionsMD.yaml │ │ ├── FSVHierarchyFlattened.yaml │ │ ├── FSVTextsMD.yaml │ │ ├── FinancialStatement.yaml │ │ ├── FixedAssetsMD.yaml │ │ ├── GLAccountsMD.yaml │ │ ├── GLDocumentsHdr.yaml │ │ ├── InventoryByPlant.yaml │ │ ├── InventoryKeyMetrics.yaml │ │ ├── InvoiceDocuments_Flow.yaml │ │ ├── Languages_T002.yaml │ │ ├── LedgersMD.yaml │ │ ├── MaterialGroupsMD.yaml │ │ ├── MaterialLedger.yaml │ │ ├── MaterialMovementTypesMD.yaml │ │ ├── MaterialPlantsMD.yaml │ │ ├── MaterialTypesMD.yaml │ │ ├── MaterialsBatchMD.yaml │ │ ├── MaterialsMD.yaml │ │ ├── MaterialsMovement.yaml │ │ ├── MaterialsValuation.yaml │ │ ├── OneTouchOrder.yaml │ │ ├── OrderToCash.yaml │ │ ├── POFulfillment.yaml │ │ ├── POOrderHistory.yaml │ │ ├── POSchedule.yaml │ │ ├── POScheduleLine.yaml │ │ ├── POVendorConfirmation.yaml │ │ ├── PlantsMD.yaml │ │ ├── PricingConditions.yaml │ │ ├── ProductHierarchiesMD.yaml │ │ ├── ProductHierarchy_Flatten.yaml │ │ ├── ProductionOrders.yaml │ │ ├── ProfitAndLoss.yaml │ │ ├── ProfitCenterAmountsHierarchy_SAMPLE.yaml │ │ ├── ProfitCenterHierarchiesMD.yaml │ │ ├── ProfitCenterHierarchyFlattened.yaml │ │ ├── ProfitCentersMD.yaml │ │ ├── PurchaseDocumentTypesMD.yaml │ │ ├── PurchaseDocuments.yaml │ │ ├── PurchaseDocumentsHistory.yaml │ │ ├── PurchaseDocuments_Flow.yaml │ │ ├── PurchasingGroupsMD.yaml │ │ ├── PurchasingOrganizationsMD.yaml │ │ ├── ReasonForMovementTypesMD.yaml │ │ ├── RegionsMD.yaml │ │ ├── Regions_T005S.yaml │ │ ├── SDDocumentFlow.yaml │ │ ├── SDStatus_Items.yaml │ │ ├── SalesFulfillment.yaml │ │ ├── SalesFulfillment_perOrder.yaml │ │ ├── SalesOrderDetails_SAMPLE.yaml │ │ ├── SalesOrderHeaderStatus.yaml │ │ ├── SalesOrderPartnerFunction.yaml │ │ ├── SalesOrderPricing.yaml │ │ ├── SalesOrderScheduleLine.yaml │ │ ├── SalesOrderStatus.yaml │ │ ├── SalesOrders.yaml │ │ ├── SalesOrders_V2.yaml │ │ ├── SalesOrganizationsMD.yaml │ │ ├── SalesStatus_Items.yaml │ │ ├── SlowMovingThreshold.yaml │ │ ├── SpecialStocksMD.yaml │ │ ├── StockCharacteristicsConfig.yaml │ │ ├── StockInHand.yaml │ │ ├── StockMonthlySnapshots.yaml │ │ ├── StockWeeklySnapshots.yaml │ │ ├── Stock_NonValuated.yaml │ │ ├── Stock_OnHand.yaml │ │ ├── Stock_PerPlant.yaml │ │ ├── Stock_Unrestricted_vs_Sales.yaml │ │ ├── StorageLocationsMD.yaml │ │ ├── TelephoneCodes_T005K.yaml │ │ ├── UniversalLedgersMD.yaml │ │ ├── UoMConversion.yaml │ │ ├── UoMConversionUtil.yaml │ │ ├── UoMMD.yaml │ │ ├── UoMUsage_SAMPLE.yaml │ │ ├── ValuationAreasMD.yaml │ │ ├── VendorConfig.yaml │ │ ├── VendorLeadTimeOverview.yaml │ │ ├── VendorPerformance.yaml │ │ ├── VendorPerformanceOverview.yaml │ │ ├── VendorsMD.yaml │ │ ├── cost_centers.yaml │ │ ├── costcenter_flattened.yaml │ │ ├── currency_conversion.yaml │ │ ├── currency_decimal.yaml │ │ ├── financial_statement.yaml │ │ ├── fiscal_date_dim.yaml │ │ ├── fsv_flattened.yaml │ │ ├── fsv_glaccounts.yaml │ │ ├── monthly_inventory_aggregation.yaml │ │ ├── prod_hierarchy_texts.yaml │ │ ├── profit_centers.yaml │ │ ├── profitcenter_flattened.yaml │ │ ├── stock_monthly_snapshots.yaml │ │ ├── stock_weekly_snapshots.yaml │ │ └── weekly_inventory_aggregation.yaml │ ├── lakes │ │ └── lakes.yaml │ ├── policy_taxonomies │ │ └── policy_taxonomies.yaml │ └── tag_templates │ │ └── templates.yaml ├── k9_placeholder_settings.yaml ├── reporting_settings_common_prereqs.yaml └── s4 │ ├── annotations │ ├── AccountingDocuments.yaml │ ├── AccountingDocumentsReceivable.yaml │ ├── AccountsPayable.yaml │ ├── AccountsPayableOverview.yaml │ ├── AccountsPayableTurnover.yaml │ ├── AddressesMD.yaml │ ├── BalanceSheet.yaml │ ├── BatchesMD.yaml │ ├── BillOfMaterialsMD.yaml │ ├── Billing.yaml │ ├── BillingBlockingReasonsMD.yaml │ ├── BusinessPartnersMD.yaml │ ├── CashDiscountUtilization.yaml │ ├── CompaniesMD.yaml │ ├── CostCenterAmountsHierarchy_SAMPLE.yaml │ ├── CostCenterHierarchiesMD.yaml │ ├── CostCenterHierarchyFlattened.yaml │ ├── CostCentersMD.yaml │ ├── CountriesMD.yaml │ ├── CurrenciesMD.yaml │ ├── CurrencyConvUtil.yaml │ ├── CurrencyConversion.yaml │ ├── CustomerClearedItems_BSAD.yaml │ ├── CustomerOpenItems_BSID.yaml │ ├── CustomersMD.yaml │ ├── DaysPayableOutstanding.yaml │ ├── Deliveries.yaml │ ├── DeliveriesStatus_PerSalesOrg.yaml │ ├── DeliveryBlockingReasonsMD.yaml │ ├── DistributionChannelsMD.yaml │ ├── DivisionsMD.yaml │ ├── FSVHierarchyFlattened.yaml │ ├── FSVTextsMD.yaml │ ├── FinancialStatement.yaml │ ├── FixedAssetsMD.yaml │ ├── GLAccountsMD.yaml │ ├── GLDocumentsHdr.yaml │ ├── InventoryByPlant.yaml │ ├── InventoryKeyMetrics.yaml │ ├── InvoiceDocuments_Flow.yaml │ ├── Languages_T002.yaml │ ├── LedgersMD.yaml │ ├── MaterialGroupsMD.yaml │ ├── MaterialLedger.yaml │ ├── MaterialMovementTypesMD.yaml │ ├── MaterialPlantsMD.yaml │ ├── MaterialTypesMD.yaml │ ├── MaterialsBatchMD.yaml │ ├── MaterialsMD.yaml │ ├── MaterialsMovement.yaml │ ├── MaterialsValuation.yaml │ ├── OneTouchOrder.yaml │ ├── OrderToCash.yaml │ ├── POFulfillment.yaml │ ├── POOrderHistory.yaml │ ├── POSchedule.yaml │ ├── POScheduleLine.yaml │ ├── POVendorConfirmation.yaml │ ├── PlantsMD.yaml │ ├── PricingConditions.yaml │ ├── ProductHierarchiesMD.yaml │ ├── ProductHierarchy_Flatten.yaml │ ├── ProductionOrders.yaml │ ├── ProfitAndLoss.yaml │ ├── ProfitCenterAmountsHierarchy_SAMPLE.yaml │ ├── ProfitCenterHierarchiesMD.yaml │ ├── ProfitCenterHierarchyFlattened.yaml │ ├── ProfitCentersMD.yaml │ ├── PurchaseDocumentTypesMD.yaml │ ├── PurchaseDocuments.yaml │ ├── PurchaseDocumentsHistory.yaml │ ├── PurchaseDocuments_Flow.yaml │ ├── PurchasingGroupsMD.yaml │ ├── PurchasingOrganizationsMD.yaml │ ├── ReasonForMovementTypesMD.yaml │ ├── RegionsMD.yaml │ ├── Regions_T005S.yaml │ ├── SDDocumentFlow.yaml │ ├── SDStatus_Items.yaml │ ├── SalesFulfillment.yaml │ ├── SalesFulfillment_perOrder.yaml │ ├── SalesOrderDetails_SAMPLE.yaml │ ├── SalesOrderHeaderStatus.yaml │ ├── SalesOrderPartnerFunction.yaml │ ├── SalesOrderPricing.yaml │ ├── SalesOrderScheduleLine.yaml │ ├── SalesOrderStatus.yaml │ ├── SalesOrders.yaml │ ├── SalesOrders_V2.yaml │ ├── SalesOrganizationsMD.yaml │ ├── SalesStatus_Items.yaml │ ├── SlowMovingThreshold.yaml │ ├── SpecialStocksMD.yaml │ ├── StockCharacteristicsConfig.yaml │ ├── StockInHand.yaml │ ├── StockMonthlySnapshots.yaml │ ├── StockWeeklySnapshots.yaml │ ├── Stock_NonValuated.yaml │ ├── Stock_OnHand.yaml │ ├── Stock_PerPlant.yaml │ ├── Stock_Unrestricted_vs_Sales.yaml │ ├── StorageLocationsMD.yaml │ ├── TelephoneCodes_T005K.yaml │ ├── UniversalLedgersMD.yaml │ ├── UoMConversion.yaml │ ├── UoMConversionUtil.yaml │ ├── UoMMD.yaml │ ├── UoMUsage_SAMPLE.yaml │ ├── ValuationAreasMD.yaml │ ├── VendorConfig.yaml │ ├── VendorLeadTimeOverview.yaml │ ├── VendorPerformance.yaml │ ├── VendorPerformanceOverview.yaml │ ├── VendorsMD.yaml │ ├── cost_centers.yaml │ ├── costcenter_flattened.yaml │ ├── currency_conversion.yaml │ ├── currency_decimal.yaml │ ├── financial_statement.yaml │ ├── fiscal_date_dim.yaml │ ├── fsv_flattened.yaml │ ├── fsv_glaccounts.yaml │ ├── monthly_inventory_aggregation.yaml │ ├── prod_hierarchy_texts.yaml │ ├── profit_centers.yaml │ ├── profitcenter_flattened.yaml │ ├── stock_monthly_snapshots.yaml │ ├── stock_weekly_snapshots.yaml │ └── weekly_inventory_aggregation.yaml │ ├── lakes │ └── lakes.yaml │ ├── policy_taxonomies │ └── policy_taxonomies.yaml │ └── tag_templates │ └── templates.yaml ├── config_validator.py ├── docs ├── code-of-conduct.md └── contributing.md ├── ecc ├── AccountingDocuments.sql ├── AccountingDocumentsReceivable.sql ├── AccountsPayable.sql ├── AccountsPayableOverview.sql ├── AccountsPayableTurnover.sql ├── AddressesMD.sql ├── AggregateMonthlyInventory.sql ├── AggregateWeeklyInventory.sql ├── BalanceSheet.sql ├── BatchesMD.sql ├── BillOfMaterialsMD.sql ├── Billing.sql ├── BillingBlockingReasonsMD.sql ├── BusinessPartnersMD.sql ├── CashDiscountUtilization.sql ├── CompaniesMD.sql ├── CostCenterAmountsHierarchy_SAMPLE.sql ├── CostCenterHierarchiesMD.sql ├── CostCenterHierarchyFlattened.sql ├── CostCentersMD.sql ├── CountriesMD.sql ├── CurrenciesMD.sql ├── CurrencyConvUtil.sql ├── CurrencyConversion.sql ├── CustomerClearedItems_BSAD.sql ├── CustomerOpenItems_BSID.sql ├── CustomersMD.sql ├── DaysPayableOutstanding.sql ├── Deliveries.sql ├── DeliveriesStatus_PerSalesOrg.sql ├── DeliveryBlockingReasonsMD.sql ├── DistributionChannelsMD.sql ├── DivisionsMD.sql ├── FSVHierarchyFlattened.sql ├── FSVTextsMD.sql ├── FinancialStatement.sql ├── GLAccountsMD.sql ├── GrossProfitOverview.sql ├── InventoryByPlant.sql ├── InventoryKeyMetrics.sql ├── InvoiceDocuments_Flow.sql ├── Languages_T002.sql ├── LedgersMD.sql ├── MaterialGroupsMD.sql ├── MaterialLedger.sql ├── MaterialMovementTypesMD.sql ├── MaterialPlantsMD.sql ├── MaterialTypesMD.sql ├── MaterialsBatchMD.sql ├── MaterialsMD.sql ├── MaterialsMovement.sql ├── MaterialsValuation.sql ├── NetProfitOverview.sql ├── OneTouchOrder.sql ├── OrderToCash.sql ├── POFulfillment.sql ├── POOrderHistory.sql ├── POSchedule.sql ├── POScheduleLine.sql ├── POVendorConfirmation.sql ├── PlantsMD.sql ├── PricingConditions.sql ├── ProductHierarchiesMD.sql ├── ProductHierarchy_Flatten.sql ├── ProductionOrders.sql ├── ProfitAndLoss.sql ├── ProfitAndLossOverview.sql ├── ProfitAndLossOverview_CostCenterHierarchy.sql ├── ProfitAndLossOverview_ProfitCenterHierarchy.sql ├── ProfitCenterAmountsHierarchy_SAMPLE.sql ├── ProfitCenterHierarchiesMD.sql ├── ProfitCenterHierarchyFlattened.sql ├── ProfitCentersMD.sql ├── PurchaseDocumentTypesMD.sql ├── PurchaseDocuments.sql ├── PurchaseDocumentsHistory.sql ├── PurchaseDocuments_Flow.sql ├── PurchasingGroupsMD.sql ├── PurchasingOrganizationsMD.sql ├── ReasonForMovementTypesMD.sql ├── RegionsMD.sql ├── Regions_T005S.sql ├── SDDocumentFlow.sql ├── SDStatus_Items.sql ├── SalesFulfillment.sql ├── SalesFulfillment_perOrder.sql ├── SalesOrderDetails_SAMPLE.sql ├── SalesOrderHeaderStatus.sql ├── SalesOrderPartnerFunction.sql ├── SalesOrderPricing.sql ├── SalesOrderScheduleLine.sql ├── SalesOrderStatus.sql ├── SalesOrders.sql ├── SalesOrders_V2.sql ├── SalesOrganizationsMD.sql ├── SalesStatus_Items.sql ├── SlowMovingThreshold.sql ├── SpecialStocksMD.sql ├── StockCharacteristicsConfig.sql ├── StockInHand.sql ├── StockMonthlySnapshots.sql ├── StockWeeklySnapshots.sql ├── Stock_NonValuated.sql ├── Stock_PerPlant.sql ├── Stock_Unrestricted_vs_Sales.sql ├── StorageLocationsMD.sql ├── TelephoneCodes_T005K.sql ├── UniversalLedgersMD.sql ├── UoMConversion.sql ├── UoMConversionUtil.sql ├── UoMMD.sql ├── UoMUsage_SAMPLE.sql ├── UpdateMonthlyInventoryAggregation.sql ├── UpdateStockMonthlySnapshots.sql ├── UpdateStockWeeklySnapshots.sql ├── UpdateWeeklyInventoryAggregation.sql ├── ValuationAreasMD.sql ├── VendorConfig.sql ├── VendorLeadTimeOverview.sql ├── VendorPerformance.sql ├── VendorPerformanceOverview.sql └── VendorsMD.sql ├── financial_statement.sql ├── fiscal_date_dim.sql ├── is_leap_year.sql ├── k9_manifest.yaml ├── local_k9 ├── costcenter_hierarchy │ ├── costcenter_hierarchy.py │ ├── costcenter_hierarchy.sql │ ├── costcenter_node_deletion.sql │ └── costcenter_node_mapping.sql ├── currency_conversion │ ├── currency_conversion.py │ ├── currency_conversion.sql │ └── currency_decimal.sql ├── financial_statement │ ├── financial_statement_initial_load.py │ ├── financial_statement_initial_load.sql │ ├── financial_statement_periodical_load.py │ └── financial_statement_periodical_load.templatesql ├── fsv_hierarchy │ ├── financial_statement_version.py │ ├── financial_statement_version.sql │ ├── fsv_delete_node.sql │ └── fsv_glaccounts_mapping.sql ├── inventory_snapshots │ ├── stock_monthly_snapshots_initial.py │ ├── stock_monthly_snapshots_initial.sql │ ├── stock_monthly_snapshots_periodical_update.py │ ├── stock_monthly_snapshots_periodical_update.templatesql │ ├── stock_monthly_snapshots_update_daily.py │ ├── stock_monthly_snapshots_update_daily.templatesql │ ├── stock_weekly_snapshots_initial.py │ ├── stock_weekly_snapshots_initial.sql │ ├── stock_weekly_snapshots_periodical_update.py │ ├── stock_weekly_snapshots_periodical_update.templatesql │ ├── stock_weekly_snapshots_update_daily.py │ └── stock_weekly_snapshots_update_daily.templatesql ├── prod_hierarchy_texts │ ├── prod_hierarchy_texts.py │ └── prod_hierarchy_texts.sql └── profitcenter_hierarchy │ ├── profitcenter_hierarchy.py │ ├── profitcenter_hierarchy.sql │ ├── profitcenter_node_deletion.sql │ └── profitcenter_node_mapping.sql ├── placeholders └── calendar_date_dim.sql ├── reporting_settings_ecc.yaml ├── reporting_settings_ecc_task_dep.yaml ├── reporting_settings_s4.yaml ├── reporting_settings_s4_task_dep.yaml ├── reporting_settings_union.yaml └── s4 ├── AccountingDocuments.sql ├── AccountingDocumentsReceivable.sql ├── AccountsPayable.sql ├── AccountsPayableOverview.sql ├── AccountsPayableTurnover.sql ├── AddressesMD.sql ├── AggregateMonthlyInventory.sql ├── AggregateWeeklyInventory.sql ├── BalanceSheet.sql ├── BatchesMD.sql ├── BillOfMaterialsMD.sql ├── Billing.sql ├── BillingBlockingReasonsMD.sql ├── BusinessPartnersMD.sql ├── CashDiscountUtilization.sql ├── CompaniesMD.sql ├── CostCenterAmountsHierarchy_SAMPLE.sql ├── CostCenterHierarchiesMD.sql ├── CostCenterHierarchyFlattened.sql ├── CostCentersMD.sql ├── CountriesMD.sql ├── CurrenciesMD.sql ├── CurrencyConvUtil.sql ├── CurrencyConversion.sql ├── CustomerClearedItems_BSAD.sql ├── CustomerOpenItems_BSID.sql ├── CustomersMD.sql ├── DaysPayableOutstanding.sql ├── Deliveries.sql ├── DeliveriesStatus_PerSalesOrg.sql ├── DeliveryBlockingReasonsMD.sql ├── DistributionChannelsMD.sql ├── DivisionsMD.sql ├── FSVHierarchyFlattened.sql ├── FSVTextsMD.sql ├── FinancialStatement.sql ├── GLAccountsMD.sql ├── GrossProfitOverview.sql ├── InventoryByPlant.sql ├── InventoryKeyMetrics.sql ├── InvoiceDocuments_Flow.sql ├── Languages_T002.sql ├── LedgersMD.sql ├── MaterialGroupsMD.sql ├── MaterialLedger.sql ├── MaterialMovementTypesMD.sql ├── MaterialPlantsMD.sql ├── MaterialTypesMD.sql ├── MaterialsBatchMD.sql ├── MaterialsMD.sql ├── MaterialsMovement.sql ├── MaterialsValuation.sql ├── NetProfitOverview.sql ├── OneTouchOrder.sql ├── OrderToCash.sql ├── POFulfillment.sql ├── POOrderHistory.sql ├── POSchedule.sql ├── POScheduleLine.sql ├── POVendorConfirmation.sql ├── PlantsMD.sql ├── PricingConditions.sql ├── ProductHierarchiesMD.sql ├── ProductHierarchy_Flatten.sql ├── ProductionOrders.sql ├── ProfitAndLoss.sql ├── ProfitAndLossOverview.sql ├── ProfitAndLossOverview_CostCenterHierarchy.sql ├── ProfitAndLossOverview_ProfitCenterHierarchy.sql ├── ProfitCenterAmountsHierarchy_SAMPLE.sql ├── ProfitCenterHierarchiesMD.sql ├── ProfitCenterHierarchyFlattened.sql ├── ProfitCentersMD.sql ├── PurchaseDocumentTypesMD.sql ├── PurchaseDocuments.sql ├── PurchaseDocumentsHistory.sql ├── PurchaseDocuments_Flow.sql ├── PurchasingGroupsMD.sql ├── PurchasingOrganizationsMD.sql ├── ReasonForMovementTypesMD.sql ├── RegionsMD.sql ├── Regions_T005S.sql ├── SDDocumentFlow.sql ├── SDStatus_Items.sql ├── SalesFulfillment.sql ├── SalesFulfillment_perOrder.sql ├── SalesOrderDetails_SAMPLE.sql ├── SalesOrderHeaderStatus.sql ├── SalesOrderPartnerFunction.sql ├── SalesOrderPricing.sql ├── SalesOrderScheduleLine.sql ├── SalesOrderStatus.sql ├── SalesOrders.sql ├── SalesOrders_V2.sql ├── SalesOrganizationsMD.sql ├── SalesStatus_Items.sql ├── SlowMovingThreshold.sql ├── SpecialStocksMD.sql ├── StockCharacteristicsConfig.sql ├── StockInHand.sql ├── StockMonthlySnapshots.sql ├── StockWeeklySnapshots.sql ├── Stock_NonValuated.sql ├── Stock_OnHand.sql ├── Stock_PerPlant.sql ├── Stock_Unrestricted_vs_Sales.sql ├── StorageLocationsMD.sql ├── TelephoneCodes_T005K.sql ├── UniversalLedgersMD.sql ├── UoMConversion.sql ├── UoMConversionUtil.sql ├── UoMMD.sql ├── UoMUsage_SAMPLE.sql ├── UpdateMonthlyInventoryAggregation.sql ├── UpdateStockMonthlySnapshots.sql ├── UpdateStockWeeklySnapshots.sql ├── UpdateWeeklyInventoryAggregation.sql ├── ValuationAreasMD.sql ├── VendorConfig.sql ├── VendorLeadTimeOverview.sql ├── VendorPerformance.sql ├── VendorPerformanceOverview.sql └── VendorsMD.sql /AccountingDocuments.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | 16 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 17 | ({% include './ecc/AccountingDocuments.sql' -%}) 18 | {% endif -%} 19 | 20 | {% if sql_flavour == 'union' -%} 21 | UNION ALL 22 | {% endif -%} 23 | 24 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 25 | ({% include './s4/AccountingDocuments.sql' -%}) 26 | {% endif -%} 27 | 28 | -------------------------------------------------------------------------------- /AccountingDocumentsReceivable.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' -%} 16 | {% include './ecc/AccountingDocumentsReceivable.sql' -%} 17 | {% endif -%} 18 | 19 | 20 | {% if sql_flavour == 's4' -%} 21 | {% include './s4/AccountingDocumentsReceivable.sql' -%} 22 | {% endif -%} 23 | 24 | -------------------------------------------------------------------------------- /AccountsPayable.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | ( {% include './ecc/AccountsPayable.sql' -%} ) 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | 21 | UNION ALL 22 | {% endif -%} 23 | 24 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 25 | ( {% include './s4/AccountsPayable.sql' -%} ) 26 | {% endif -%} 27 | -------------------------------------------------------------------------------- /AccountsPayableOverview.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' -%} 16 | {% include './ecc/AccountsPayableOverview.sql' -%} 17 | {% endif -%} 18 | 19 | 20 | {% if sql_flavour == 's4' -%} 21 | {% include './s4/AccountsPayableOverview.sql' -%} 22 | {% endif -%} 23 | -------------------------------------------------------------------------------- /AccountsPayableTurnover.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/AccountsPayableTurnover.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | {% include './s4/AccountsPayableTurnover.sql' -%} 25 | {% endif -%} 26 | -------------------------------------------------------------------------------- /AddressesMD.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/AddressesMD.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | {% include './s4/AddressesMD.sql' -%} 25 | {% endif -%} 26 | 27 | -------------------------------------------------------------------------------- /AggregateMonthlyInventory.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2024 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | 16 | {% if sql_flavour == 'ecc' -%} 17 | {% include './ecc/AggregateMonthlyInventory.sql' -%} 18 | {% endif -%} 19 | 20 | {% if sql_flavour == 's4' -%} 21 | {% include './s4/AggregateMonthlyInventory.sql' -%} 22 | {% endif -%} 23 | 24 | -------------------------------------------------------------------------------- /AggregateWeeklyInventory.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2024 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | 16 | {% if sql_flavour == 'ecc' -%} 17 | {% include './ecc/AggregateWeeklyInventory.sql' -%} 18 | {% endif -%} 19 | 20 | {% if sql_flavour == 's4' -%} 21 | {% include './s4/AggregateWeeklyInventory.sql' -%} 22 | {% endif -%} 23 | 24 | -------------------------------------------------------------------------------- /BalanceSheet.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2023 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/BalanceSheet.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | {% include './s4/BalanceSheet.sql' -%} 25 | {% endif -%} 26 | 27 | -------------------------------------------------------------------------------- /BatchesMD.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/BatchesMD.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | {% include './s4/BatchesMD.sql' -%} 25 | {% endif -%} 26 | 27 | -------------------------------------------------------------------------------- /BillOfMaterialsMD.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/BillOfMaterialsMD.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | {% include './s4/BillOfMaterialsMD.sql' -%} 25 | {% endif -%} 26 | 27 | -------------------------------------------------------------------------------- /Billing.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | ({% include './ecc/Billing.sql' -%}) 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | ({% include './s4/Billing.sql' -%}) 25 | {% endif -%} 26 | 27 | -------------------------------------------------------------------------------- /BillingBlockingReasonsMD.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/BillingBlockingReasonsMD.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | {% include './s4/BillingBlockingReasonsMD.sql' -%} 25 | {% endif -%} 26 | 27 | -------------------------------------------------------------------------------- /BusinessPartnersMD.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/BusinessPartnersMD.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | {% include './s4/BusinessPartnersMD.sql' -%} 25 | {% endif -%} 26 | 27 | -------------------------------------------------------------------------------- /CompaniesMD.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/CompaniesMD.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | {% include './s4/CompaniesMD.sql' -%} 25 | {% endif -%} 26 | 27 | -------------------------------------------------------------------------------- /CostCenterAmountsHierarchy_SAMPLE.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2024 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' -%} 16 | ({% include './ecc/CostCenterAmountsHierarchy_SAMPLE.sql' -%}) 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 's4' -%} 20 | ({% include './s4/CostCenterAmountsHierarchy_SAMPLE.sql' -%}) 21 | {% endif -%} 22 | 23 | -------------------------------------------------------------------------------- /CostCenterHierarchiesMD.sql: -------------------------------------------------------------------------------- 1 | -- Copyright 2024 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' -%} 16 | {% include './ecc/CostCenterHierarchiesMD.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 's4' -%} 20 | {% include './s4/CostCenterHierarchiesMD.sql' -%} 21 | {% endif -%} 22 | -------------------------------------------------------------------------------- /CostCenterHierarchyFlattened.sql: -------------------------------------------------------------------------------- 1 | -- Copyright 2024 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' -%} 16 | {% include './ecc/CostCenterHierarchyFlattened.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 's4' -%} 20 | {% include './s4/CostCenterHierarchyFlattened.sql' -%} 21 | {% endif -%} 22 | -------------------------------------------------------------------------------- /CostCentersMD.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/CostCentersMD.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | {% include './s4/CostCentersMD.sql' -%} 25 | {% endif -%} 26 | 27 | -------------------------------------------------------------------------------- /CountriesMD.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/CountriesMD.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | {% include './s4/CountriesMD.sql' -%} 25 | {% endif -%} 26 | 27 | -------------------------------------------------------------------------------- /CurrenciesMD.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/CurrenciesMD.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | {% include './s4/CurrenciesMD.sql' -%} 25 | {% endif -%} 26 | 27 | -------------------------------------------------------------------------------- /CurrencyConvUtil.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | ({% include './ecc/CurrencyConvUtil.sql' -%}) 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | ({% include './s4/CurrencyConvUtil.sql' -%}) 25 | {% endif -%} 26 | 27 | -------------------------------------------------------------------------------- /CurrencyConversion.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/CurrencyConversion.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | {% include './s4/CurrencyConversion.sql' -%} 25 | {% endif -%} 26 | -------------------------------------------------------------------------------- /CustomerOpenItems_BSID.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | 16 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 17 | ({% include './ecc/CustomerOpenItems_BSID.sql' -%}) 18 | {% endif -%} 19 | 20 | {% if sql_flavour == 'union' -%} 21 | UNION ALL 22 | {% endif -%} 23 | 24 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 25 | ({% include './s4/CustomerOpenItems_BSID.sql' -%}) 26 | {% endif -%} 27 | 28 | -------------------------------------------------------------------------------- /CustomersMD.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | ({% include './ecc/CustomersMD.sql' -%}) 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | ({% include './s4/CustomersMD.sql' -%}) 25 | {% endif -%} 26 | 27 | -------------------------------------------------------------------------------- /Deliveries.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | ({% include './ecc/Deliveries.sql' -%}) 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | ({% include './s4/Deliveries.sql' -%}) 25 | {% endif -%} 26 | 27 | -------------------------------------------------------------------------------- /DeliveryBlockingReasonsMD.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/DeliveryBlockingReasonsMD.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | {% include './s4/DeliveryBlockingReasonsMD.sql' -%} 25 | {% endif -%} 26 | 27 | -------------------------------------------------------------------------------- /DistributionChannelsMD.sql: -------------------------------------------------------------------------------- 1 | #-- 2 | #-- https://www.apache.org/licenses/LICENSE-2.0 3 | #-- 4 | #-- Unless required by applicable law or agreed to in writing, software 5 | #-- distributed under the License is distributed on an "AS IS" BASIS, 6 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7 | #-- See the License for the specific language governing permissions and 8 | #-- limitations under the License. 9 | 10 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 11 | {% include './ecc/DistributionChannelsMD.sql' -%} 12 | {% endif -%} 13 | 14 | {% if sql_flavour == 'union' -%} 15 | UNION ALL 16 | {% endif -%} 17 | 18 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 19 | {% include './s4/DistributionChannelsMD.sql' -%} 20 | {% endif -%} 21 | 22 | -------------------------------------------------------------------------------- /DivisionsMD.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/DivisionsMD.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | {% include './s4/DivisionsMD.sql' -%} 25 | {% endif -%} 26 | 27 | -------------------------------------------------------------------------------- /DueDateForCashDiscount1.sql: -------------------------------------------------------------------------------- 1 | CREATE OR REPLACE FUNCTION 2 | `{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.DueDateForCashDiscount1` 3 | ( 4 | Ip_Koart STRING, 5 | Ip_ZFBDT DATE, 6 | Ip_BLDAT DATE, 7 | Ip_Shkzg STRING, 8 | Ip_REBZG STRING, 9 | Ip_ZBD3T NUMERIC, 10 | Ip_ZBD2T NUMERIC, 11 | Ip_ZBD1T NUMERIC 12 | ) 13 | AS ( 14 | ( 15 | SELECT 16 | CASE 17 | WHEN 18 | Ip_ZBD1T IS NOT NULL OR Ip_ZBD2T IS NOT NULL THEN date_add( 19 | Ip_ZFBDT, INTERVAL cast(Ip_ZBD1T AS INT64) DAY 20 | ) 21 | ELSE 22 | `{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.NetDueDateCalc`( 23 | Ip_Koart, Ip_ZFBDT, Ip_BLDAT, Ip_Shkzg, Ip_REBZG, Ip_ZBD3T, Ip_ZBD2T, Ip_ZBD1T 24 | ) 25 | END AS SK1DT 26 | ) 27 | ) 28 | OPTIONS (description = "This function returns date for which cash discount 1 is due."); 29 | -------------------------------------------------------------------------------- /DueDateForCashDiscount2.sql: -------------------------------------------------------------------------------- 1 | CREATE OR REPLACE FUNCTION `{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.DueDateForCashDiscount2`( 2 | Ip_Koart STRING, 3 | Ip_ZFBDT DATE, 4 | Ip_BLDAT DATE, 5 | Ip_Shkzg STRING, 6 | Ip_REBZG STRING, 7 | Ip_ZBD3T NUMERIC, 8 | Ip_ZBD2T NUMERIC, 9 | Ip_ZBD1T NUMERIC 10 | ) AS ( 11 | ( 12 | SELECT 13 | CASE 14 | WHEN 15 | Ip_ZBD2T IS NOT NULL THEN date_add( 16 | Ip_ZFBDT, INTERVAL cast(coalesce(Ip_ZBD2T, 0) AS INT64) DAY 17 | ) 18 | ELSE 19 | `{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.NetDueDateCalc`( 20 | Ip_Koart, Ip_ZFBDT, Ip_BLDAT, Ip_Shkzg, Ip_REBZG, Ip_ZBD3T, Ip_ZBD2T, Ip_ZBD1T 21 | ) 22 | END AS SK2DT 23 | 24 | ) 25 | ) 26 | OPTIONS (description = "This function returns date for which cash discount 2 is due.") 27 | -------------------------------------------------------------------------------- /FSVHierarchyFlattened.sql: -------------------------------------------------------------------------------- 1 | -- Copyright 2024 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' -%} 16 | {% include './ecc/FSVHierarchyFlattened.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 's4' -%} 20 | {% include './s4/FSVHierarchyFlattened.sql' -%} 21 | {% endif -%} 22 | -------------------------------------------------------------------------------- /FSVTextsMD.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2023 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/FSVTextsMD.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | ({% include './s4/FSVTextsMD.sql' -%}) 25 | {% endif -%} 26 | 27 | -------------------------------------------------------------------------------- /FinancialStatement.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2023 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/FinancialStatement.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | ({% include './s4/FinancialStatement.sql' -%}) 25 | {% endif -%} 26 | 27 | -------------------------------------------------------------------------------- /GLAccountsMD.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/GLAccountsMD.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | {% include './s4/GLAccountsMD.sql' -%} 25 | {% endif -%} 26 | 27 | -------------------------------------------------------------------------------- /GrossProfitOverview.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2024 2 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 3 | #-- you may not use this file except in compliance with the License. 4 | #-- You may obtain a copy of the License at 5 | #-- 6 | #-- https://www.apache.org/licenses/LICENSE-2.0 7 | #-- 8 | #-- Unless required by applicable law or agreed to in writing, software 9 | #-- distributed under the License is distributed on an "AS IS" BASIS, 10 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | #-- See the License for the specific language governing permissions and 12 | #-- limitations under the License. 13 | 14 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 15 | {% include './ecc/GrossProfitOverview.sql' -%} 16 | {% endif -%} 17 | 18 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 19 | {% include './s4/GrossProfitOverview.sql' -%} 20 | {% endif -%} 21 | 22 | -------------------------------------------------------------------------------- /InventoryByPlant.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2023 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 15 | {% include './ecc/InventoryByPlant.sql' -%} 16 | {% endif -%} 17 | 18 | {% if sql_flavour == 'union' -%} 19 | UNION ALL 20 | {% endif -%} 21 | 22 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 23 | {% include './s4/InventoryByPlant.sql' -%} 24 | {% endif -%} 25 | -------------------------------------------------------------------------------- /InventoryKeyMetrics.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2023 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 15 | {% include './ecc/InventoryKeyMetrics.sql' -%} 16 | {% endif -%} 17 | 18 | {% if sql_flavour == 'union' -%} 19 | UNION ALL 20 | {% endif -%} 21 | 22 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 23 | {% include './s4/InventoryKeyMetrics.sql' -%} 24 | {% endif -%} 25 | -------------------------------------------------------------------------------- /InvoiceDocuments_Flow.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | ({% include './ecc/InvoiceDocuments_Flow.sql' -%}) 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | ({% include './s4/InvoiceDocuments_Flow.sql' -%}) 25 | {% endif -%} 26 | 27 | -------------------------------------------------------------------------------- /Languages_T002.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/Languages_T002.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | {% include './s4/Languages_T002.sql' -%} 25 | {% endif -%} 26 | 27 | -------------------------------------------------------------------------------- /LedgersMD.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/LedgersMD.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | {% include './s4/LedgersMD.sql' -%} 25 | {% endif -%} 26 | 27 | -------------------------------------------------------------------------------- /MaterialGroupsMD.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/MaterialGroupsMD.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | {% include './s4/MaterialGroupsMD.sql' -%} 25 | {% endif -%} 26 | 27 | -------------------------------------------------------------------------------- /MaterialMovementTypesMD.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/MaterialMovementTypesMD.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | {% include './s4/MaterialMovementTypesMD.sql' -%} 25 | {% endif -%} 26 | 27 | -------------------------------------------------------------------------------- /MaterialPlantsMD.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/MaterialPlantsMD.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | {% include './s4/MaterialPlantsMD.sql' -%} 25 | {% endif -%} 26 | 27 | -------------------------------------------------------------------------------- /MaterialTypesMD.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/MaterialTypesMD.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | {% include './s4/MaterialTypesMD.sql' -%} 25 | {% endif -%} 26 | 27 | -------------------------------------------------------------------------------- /MaterialsBatchMD.sql: -------------------------------------------------------------------------------- 1 | 2 | #-- Copyright 2022 Google LLC 3 | #-- 4 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 5 | #-- you may not use this file except in compliance with the License. 6 | #-- You may obtain a copy of the License at 7 | #-- 8 | #-- https://www.apache.org/licenses/LICENSE-2.0 9 | #-- 10 | #-- Unless required by applicable law or agreed to in writing, software 11 | #-- distributed under the License is distributed on an "AS IS" BASIS, 12 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | #-- See the License for the specific language governing permissions and 14 | #-- limitations under the License. 15 | 16 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 17 | {% include './ecc/MaterialsBatchMD.sql' -%} 18 | {% endif -%} 19 | 20 | {% if sql_flavour == 'union' -%} 21 | UNION ALL 22 | {% endif -%} 23 | 24 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 25 | {% include './s4/MaterialsBatchMD.sql' -%} 26 | {% endif -%} 27 | -------------------------------------------------------------------------------- /MaterialsMD.sql: -------------------------------------------------------------------------------- 1 | 2 | #-- Copyright 2022 Google LLC 3 | #-- 4 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 5 | #-- you may not use this file except in compliance with the License. 6 | #-- You may obtain a copy of the License at 7 | #-- 8 | #-- https://www.apache.org/licenses/LICENSE-2.0 9 | #-- 10 | #-- Unless required by applicable law or agreed to in writing, software 11 | #-- distributed under the License is distributed on an "AS IS" BASIS, 12 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | #-- See the License for the specific language governing permissions and 14 | #-- limitations under the License. 15 | 16 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 17 | {% include './ecc/MaterialsMD.sql' -%} 18 | {% endif -%} 19 | 20 | {% if sql_flavour == 'union' -%} 21 | UNION ALL 22 | {% endif -%} 23 | 24 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 25 | {% include './s4/MaterialsMD.sql' -%} 26 | {% endif -%} 27 | 28 | -------------------------------------------------------------------------------- /MaterialsMovement.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/MaterialsMovement.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | {% include './s4/MaterialsMovement.sql' -%} 25 | {% endif -%} 26 | 27 | -------------------------------------------------------------------------------- /MaterialsValuation.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/MaterialsValuation.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | {% include './s4/MaterialsValuation.sql' -%} 25 | {% endif -%} 26 | 27 | -------------------------------------------------------------------------------- /NetDueDateCalc.sql: -------------------------------------------------------------------------------- 1 | CREATE OR REPLACE FUNCTION `{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.NetDueDateCalc`( 2 | ip_koart STRING, 3 | ip_ZFBDT DATE, 4 | ip_BLDAT DATE, 5 | ip_shkzg STRING, 6 | ip_REBZG STRING, 7 | ip_ZBD3T NUMERIC, 8 | ip_ZBD2T NUMERIC, 9 | ip_ZBD1T NUMERIC 10 | ) AS ( 11 | ( 12 | SELECT date_add(if(Ip_Koart = 'D' AND Ip_ZFBDT IS NULL, Ip_BLDAT, Ip_ZFBDT), 13 | INTERVAL cast(if(Ip_Koart = 'D' AND Ip_Shkzg = 'H' AND Ip_REBZG IS NULL, 0, CASE 14 | WHEN Ip_Koart = 'D' AND Ip_ZBD3T IS NOT NULL THEN Ip_ZBD3T 15 | WHEN Ip_Koart = 'D' AND Ip_ZBD2T IS NOT NULL THEN Ip_ZBD2T 16 | WHEN Ip_Koart = 'D' AND Ip_ZBD1T IS NOT NULL THEN Ip_ZBD1T 17 | WHEN Ip_ZBD1T IS NULL THEN 0 18 | END) AS INT64) DAY) 19 | ) 20 | ) 21 | OPTIONS (description = "This function returns date for which actual payment is due.") 22 | -------------------------------------------------------------------------------- /NetProfitOverview.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2024 2 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 3 | #-- you may not use this file except in compliance with the License. 4 | #-- You may obtain a copy of the License at 5 | #-- 6 | #-- https://www.apache.org/licenses/LICENSE-2.0 7 | #-- 8 | #-- Unless required by applicable law or agreed to in writing, software 9 | #-- distributed under the License is distributed on an "AS IS" BASIS, 10 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | #-- See the License for the specific language governing permissions and 12 | #-- limitations under the License. 13 | 14 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 15 | {% include './ecc/NetProfitOverview.sql' -%} 16 | {% endif -%} 17 | 18 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 19 | {% include './s4/NetProfitOverview.sql' -%} 20 | {% endif -%} 21 | 22 | -------------------------------------------------------------------------------- /OneTouchOrder.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' -%} 16 | ({% include './ecc/OneTouchOrder.sql' -%}) 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 's4' -%} 20 | ({% include './s4/OneTouchOrder.sql' -%}) 21 | {% endif -%} 22 | 23 | -------------------------------------------------------------------------------- /OrderToCash.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' -%} 16 | ({% include './ecc/OrderToCash.sql' -%}) 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 's4' -%} 20 | ({% include './s4/OrderToCash.sql' -%}) 21 | {% endif -%} 22 | 23 | -------------------------------------------------------------------------------- /POFulfillment.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | 16 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 17 | {% include './ecc/POFulfillment.sql' -%} 18 | {% endif -%} 19 | 20 | {% if sql_flavour == 'union' -%} 21 | UNION ALL 22 | {% endif -%} 23 | 24 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 25 | {% include './s4/POFulfillment.sql' -%} 26 | {% endif -%} 27 | -------------------------------------------------------------------------------- /POOrderHistory.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | 16 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 17 | {% include './ecc/POOrderHistory.sql' -%} 18 | {% endif -%} 19 | 20 | {% if sql_flavour == 'union' -%} 21 | UNION ALL 22 | {% endif -%} 23 | 24 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 25 | {% include './s4/POOrderHistory.sql' -%} 26 | {% endif -%} 27 | -------------------------------------------------------------------------------- /POSchedule.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | 16 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 17 | {% include './ecc/POSchedule.sql' -%} 18 | {% endif -%} 19 | 20 | {% if sql_flavour == 'union' -%} 21 | UNION ALL 22 | {% endif -%} 23 | 24 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 25 | {% include './s4/POSchedule.sql' -%} 26 | {% endif -%} 27 | -------------------------------------------------------------------------------- /POScheduleLine.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | 16 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 17 | {% include './ecc/POScheduleLine.sql' -%} 18 | {% endif -%} 19 | 20 | {% if sql_flavour == 'union' -%} 21 | UNION ALL 22 | {% endif -%} 23 | 24 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 25 | {% include './s4/POScheduleLine.sql' -%} 26 | {% endif -%} 27 | -------------------------------------------------------------------------------- /POVendorConfirmation.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | 16 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 17 | {% include './ecc/POVendorConfirmation.sql' -%} 18 | {% endif -%} 19 | 20 | {% if sql_flavour == 'union' -%} 21 | UNION ALL 22 | {% endif -%} 23 | 24 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 25 | {% include './s4/POVendorConfirmation.sql' -%} 26 | {% endif -%} 27 | -------------------------------------------------------------------------------- /PlantsMD.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/PlantsMD.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | {% include './s4/PlantsMD.sql' -%} 25 | {% endif -%} 26 | 27 | -------------------------------------------------------------------------------- /PricingConditions.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/PricingConditions.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | {% include './s4/PricingConditions.sql' -%} 25 | {% endif -%} 26 | -------------------------------------------------------------------------------- /ProductHierarchiesMD.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | 16 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 17 | {% include './ecc/ProductHierarchiesMD.sql' -%} 18 | {% endif -%} 19 | 20 | {% if sql_flavour == 'union' -%} 21 | UNION ALL 22 | {% endif -%} 23 | 24 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 25 | {% include './s4/ProductHierarchiesMD.sql' -%} 26 | {% endif -%} 27 | -------------------------------------------------------------------------------- /ProductHierarchy_Flatten.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | 16 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 17 | {% include './ecc/ProductHierarchy_Flatten.sql' -%} 18 | {% endif -%} 19 | 20 | {% if sql_flavour == 'union' -%} 21 | UNION ALL 22 | {% endif -%} 23 | 24 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 25 | {% include './s4/ProductHierarchy_Flatten.sql' -%} 26 | {% endif -%} 27 | -------------------------------------------------------------------------------- /ProductionOrders.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 15 | {% include './ecc/ProductionOrders.sql' -%} 16 | {% endif -%} 17 | 18 | {% if sql_flavour == 'union' -%} 19 | UNION ALL 20 | {% endif -%} 21 | 22 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 23 | {% include './s4/ProductionOrders.sql' -%} 24 | {% endif -%} 25 | -------------------------------------------------------------------------------- /ProfitAndLoss.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 20223 2 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 3 | #-- you may not use this file except in compliance with the License. 4 | #-- You may obtain a copy of the License at 5 | #-- 6 | #-- https://www.apache.org/licenses/LICENSE-2.0 7 | #-- 8 | #-- Unless required by applicable law or agreed to in writing, software 9 | #-- distributed under the License is distributed on an "AS IS" BASIS, 10 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | #-- See the License for the specific language governing permissions and 12 | #-- limitations under the License. 13 | 14 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 15 | {% include './ecc/ProfitAndLoss.sql' -%} 16 | {% endif -%} 17 | 18 | {% if sql_flavour == 'union' -%} 19 | UNION ALL 20 | {% endif -%} 21 | 22 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 23 | {% include './s4/ProfitAndLoss.sql' -%} 24 | {% endif -%} 25 | 26 | -------------------------------------------------------------------------------- /ProfitAndLossOverview.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2024 2 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 3 | #-- you may not use this file except in compliance with the License. 4 | #-- You may obtain a copy of the License at 5 | #-- 6 | #-- https://www.apache.org/licenses/LICENSE-2.0 7 | #-- 8 | #-- Unless required by applicable law or agreed to in writing, software 9 | #-- distributed under the License is distributed on an "AS IS" BASIS, 10 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | #-- See the License for the specific language governing permissions and 12 | #-- limitations under the License. 13 | 14 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 15 | {% include './ecc/ProfitAndLossOverview.sql' -%} 16 | {% endif -%} 17 | 18 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 19 | {% include './s4/ProfitAndLossOverview.sql' -%} 20 | {% endif -%} 21 | 22 | -------------------------------------------------------------------------------- /ProfitAndLossOverview_CostCenterHierarchy.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2024 Google LLC 2 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 3 | #-- you may not use this file except in compliance with the License. 4 | #-- You may obtain a copy of the License at 5 | #-- 6 | #-- https://www.apache.org/licenses/LICENSE-2.0 7 | #-- 8 | #-- Unless required by applicable law or agreed to in writing, software 9 | #-- distributed under the License is distributed on an "AS IS" BASIS, 10 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | #-- See the License for the specific language governing permissions and 12 | #-- limitations under the License. 13 | 14 | {% if sql_flavour == 'ecc' -%} 15 | {% include './ecc/ProfitAndLossOverview_CostCenterHierarchy.sql' -%} 16 | {% endif -%} 17 | 18 | {% if sql_flavour == 's4' -%} 19 | {% include './s4/ProfitAndLossOverview_CostCenterHierarchy.sql' -%} 20 | {% endif -%} 21 | -------------------------------------------------------------------------------- /ProfitAndLossOverview_ProfitCenterHierarchy.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2024 Google LLC 2 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 3 | #-- you may not use this file except in compliance with the License. 4 | #-- You may obtain a copy of the License at 5 | #-- 6 | #-- https://www.apache.org/licenses/LICENSE-2.0 7 | #-- 8 | #-- Unless required by applicable law or agreed to in writing, software 9 | #-- distributed under the License is distributed on an "AS IS" BASIS, 10 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | #-- See the License for the specific language governing permissions and 12 | #-- limitations under the License. 13 | 14 | {% if sql_flavour == 'ecc' -%} 15 | {% include './ecc/ProfitAndLossOverview_ProfitCenterHierarchy.sql' -%} 16 | {% endif -%} 17 | 18 | {% if sql_flavour == 's4' -%} 19 | {% include './s4/ProfitAndLossOverview_ProfitCenterHierarchy.sql' -%} 20 | {% endif -%} 21 | -------------------------------------------------------------------------------- /ProfitCenterHierarchiesMD.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2024 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' -%} 16 | {% include './ecc/ProfitCenterHierarchiesMD.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 's4' -%} 20 | {% include './s4/ProfitCenterHierarchiesMD.sql' -%} 21 | {% endif -%} 22 | -------------------------------------------------------------------------------- /ProfitCenterHierarchyFlattened.sql: -------------------------------------------------------------------------------- 1 | -- Copyright 2024 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' -%} 16 | {% include './ecc/ProfitCenterHierarchyFlattened.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 's4' -%} 20 | {% include './s4/ProfitCenterHierarchyFlattened.sql' -%} 21 | {% endif -%} 22 | -------------------------------------------------------------------------------- /ProfitCentersMD.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 15 | {% include './ecc/ProfitCentersMD.sql' -%} 16 | {% endif -%} 17 | 18 | {% if sql_flavour == 'union' -%} 19 | UNION ALL 20 | {% endif -%} 21 | 22 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 23 | {% include './s4/ProfitCentersMD.sql' -%} 24 | {% endif -%} 25 | -------------------------------------------------------------------------------- /PurchaseDocumentTypesMD.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/PurchaseDocumentTypesMD.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | {% include './s4/PurchaseDocumentTypesMD.sql' -%} 25 | {% endif -%} 26 | -------------------------------------------------------------------------------- /PurchaseDocuments.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | 16 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 17 | {% include './ecc/PurchaseDocuments.sql' -%} 18 | {% endif -%} 19 | 20 | {% if sql_flavour == 'union' -%} 21 | UNION ALL 22 | {% endif -%} 23 | 24 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 25 | {% include './s4/PurchaseDocuments.sql' -%} 26 | {% endif -%} 27 | -------------------------------------------------------------------------------- /PurchaseDocumentsHistory.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | 16 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 17 | {% include './ecc/PurchaseDocumentsHistory.sql' -%} 18 | {% endif -%} 19 | 20 | {% if sql_flavour == 'union' -%} 21 | UNION ALL 22 | {% endif -%} 23 | 24 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 25 | {% include './s4/PurchaseDocumentsHistory.sql' -%} 26 | {% endif -%} 27 | -------------------------------------------------------------------------------- /PurchaseDocuments_Flow.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | 16 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 17 | {% include './ecc/PurchaseDocuments_Flow.sql' -%} 18 | {% endif -%} 19 | 20 | {% if sql_flavour == 'union' -%} 21 | UNION ALL 22 | {% endif -%} 23 | 24 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 25 | {% include './s4/PurchaseDocuments_Flow.sql' -%} 26 | {% endif -%} 27 | -------------------------------------------------------------------------------- /PurchasingGroupsMD.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/PurchasingGroupsMD.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | {% include './s4/PurchasingGroupsMD.sql' -%} 25 | {% endif -%} 26 | -------------------------------------------------------------------------------- /PurchasingOrganizationsMD.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/PurchasingOrganizationsMD.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | {% include './s4/PurchasingOrganizationsMD.sql' -%} 25 | {% endif -%} 26 | -------------------------------------------------------------------------------- /ReasonForMovementTypesMD.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/ReasonForMovementTypesMD.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | {% include './s4/ReasonForMovementTypesMD.sql' -%} 25 | {% endif -%} 26 | -------------------------------------------------------------------------------- /RegionsMD.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/RegionsMD.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | {% include './s4/RegionsMD.sql' -%} 25 | {% endif -%} 26 | -------------------------------------------------------------------------------- /Regions_T005S.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | 16 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 17 | {% include './ecc/Regions_T005S.sql' -%} 18 | {% endif -%} 19 | 20 | {% if sql_flavour == 'union' -%} 21 | UNION ALL 22 | {% endif -%} 23 | 24 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 25 | {% include './s4/Regions_T005S.sql' -%} 26 | {% endif -%} 27 | -------------------------------------------------------------------------------- /SDDocumentFlow.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 15 | ({% include './ecc/SDDocumentFlow.sql' -%}) 16 | {% endif -%} 17 | 18 | {% if sql_flavour == 'union' -%} 19 | UNION ALL 20 | {% endif -%} 21 | 22 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 23 | ({% include './s4/SDDocumentFlow.sql' -%}) 24 | {% endif -%} 25 | -------------------------------------------------------------------------------- /SDStatus_Items.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 15 | {% include './ecc/SDStatus_Items.sql' -%} 16 | {% endif -%} 17 | 18 | {% if sql_flavour == 'union' -%} 19 | UNION ALL 20 | {% endif -%} 21 | 22 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 23 | {% include './s4/SDStatus_Items.sql' -%} 24 | {% endif -%} 25 | -------------------------------------------------------------------------------- /SalesFulfillment.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | {% if sql_flavour == 'ecc' -%} 15 | ({% include './ecc/SalesFulfillment.sql' -%}) 16 | {% endif -%} 17 | 18 | {% if sql_flavour == 's4' -%} 19 | ({% include './s4/SalesFulfillment.sql' -%}) 20 | {% endif -%} 21 | -------------------------------------------------------------------------------- /SalesFulfillment_perOrder.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | {% if sql_flavour == 'ecc' -%} 15 | ({% include './ecc/SalesFulfillment_perOrder.sql' -%}) 16 | {% endif -%} 17 | 18 | {% if sql_flavour == 's4' -%} 19 | ({% include './s4/SalesFulfillment_perOrder.sql' -%}) 20 | {% endif -%} 21 | -------------------------------------------------------------------------------- /SalesOrderHeaderStatus.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/SalesOrderHeaderStatus.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | {% include './s4/SalesOrderHeaderStatus.sql' -%} 25 | {% endif -%} 26 | -------------------------------------------------------------------------------- /SalesOrderPartnerFunction.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/SalesOrderPartnerFunction.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | {% include './s4/SalesOrderPartnerFunction.sql' -%} 25 | {% endif -%} 26 | -------------------------------------------------------------------------------- /SalesOrderPricing.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/SalesOrderPricing.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | {% include './s4/SalesOrderPricing.sql' -%} 25 | {% endif -%} 26 | -------------------------------------------------------------------------------- /SalesOrderScheduleLine.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/SalesOrderScheduleLine.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | {% include './s4/SalesOrderScheduleLine.sql' -%} 25 | {% endif -%} 26 | -------------------------------------------------------------------------------- /SalesOrderStatus.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/SalesOrderStatus.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | {% include './s4/SalesOrderStatus.sql' -%} 25 | {% endif -%} 26 | -------------------------------------------------------------------------------- /SalesOrders.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | ({% include './ecc/SalesOrders.sql' -%}) 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | ({% include './s4/SalesOrders.sql' -%}) 25 | {% endif -%} 26 | -------------------------------------------------------------------------------- /SalesOrders_V2.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | ( {% include './ecc/SalesOrders_V2.sql' -%} ) 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | 21 | UNION ALL 22 | 23 | {% endif -%} 24 | 25 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 26 | ( {% include './s4/SalesOrders_V2.sql' -%} ) 27 | {% endif -%} 28 | -------------------------------------------------------------------------------- /SalesOrganizationsMD.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | 16 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 17 | {% include './ecc/SalesOrganizationsMD.sql' %} 18 | {% endif -%} 19 | 20 | {% if sql_flavour == 'union' -%} 21 | UNION ALL 22 | {% endif -%} 23 | 24 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 25 | {% include './s4/SalesOrganizationsMD.sql' %} 26 | {% endif -%} 27 | 28 | -------------------------------------------------------------------------------- /SalesStatus_Items.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 15 | ({% include './ecc/SalesStatus_Items.sql' -%}) 16 | {% endif -%} 17 | 18 | {% if sql_flavour == 'union' -%} 19 | UNION ALL 20 | {% endif -%} 21 | 22 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 23 | ({% include './s4/SalesStatus_Items.sql' -%}) 24 | {% endif -%} 25 | -------------------------------------------------------------------------------- /SlowMovingThreshold.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2024 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | 16 | {% if sql_flavour == 'ecc' -%} 17 | {% include './ecc/SlowMovingThreshold.sql' -%} 18 | {% endif -%} 19 | 20 | {% if sql_flavour == 's4' -%} 21 | {% include './s4/SlowMovingThreshold.sql' -%} 22 | {% endif -%} 23 | 24 | -------------------------------------------------------------------------------- /SpecialStocksMD.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/SpecialStocksMD.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | {% include './s4/SpecialStocksMD.sql' -%} 25 | {% endif -%} 26 | -------------------------------------------------------------------------------- /StockCharacteristicsConfig.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2024 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | 16 | {% if sql_flavour == 'ecc' -%} 17 | {% include './ecc/StockCharacteristicsConfig.sql' -%} 18 | {% endif -%} 19 | 20 | {% if sql_flavour == 's4' -%} 21 | {% include './s4/StockCharacteristicsConfig.sql' -%} 22 | {% endif -%} 23 | 24 | -------------------------------------------------------------------------------- /StockMonthlySnapshots.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/StockMonthlySnapshots.sql' -%} 17 | {% endif -%} 18 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 19 | {% include './s4/StockMonthlySnapshots.sql' -%} 20 | {% endif -%} 21 | -------------------------------------------------------------------------------- /StockWeeklySnapshots.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/StockWeeklySnapshots.sql' -%} 17 | {% endif -%} 18 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 19 | {% include './s4/StockWeeklySnapshots.sql' -%} 20 | {% endif -%} 21 | -------------------------------------------------------------------------------- /Stock_NonValuated.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | 16 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 17 | {% include './ecc/Stock_NonValuated.sql' -%} 18 | {% endif -%} 19 | 20 | {% if sql_flavour == 'union' -%} 21 | UNION ALL 22 | {% endif -%} 23 | 24 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 25 | {% include './s4/Stock_NonValuated.sql' -%} 26 | {% endif -%} 27 | -------------------------------------------------------------------------------- /Stock_PerPlant.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 15 | {% include './ecc/Stock_PerPlant.sql' -%} 16 | {% endif -%} 17 | 18 | {% if sql_flavour == 'union' -%} 19 | UNION ALL 20 | {% endif -%} 21 | 22 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 23 | {% include './s4/Stock_PerPlant.sql' -%} 24 | {% endif -%} 25 | -------------------------------------------------------------------------------- /Stock_Unrestricted_vs_Sales.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | 16 | {% if sql_flavour == 'ecc' -%} 17 | ({% include './ecc/Stock_Unrestricted_vs_Sales.sql' -%}) 18 | {% endif -%} 19 | 20 | {% if sql_flavour == 's4' -%} 21 | ({% include './s4/Stock_Unrestricted_vs_Sales.sql' -%}) 22 | {% endif -%} 23 | -------------------------------------------------------------------------------- /StorageLocationsMD.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/StorageLocationsMD.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | {% include './s4/StorageLocationsMD.sql' -%} 25 | {% endif -%} 26 | -------------------------------------------------------------------------------- /TelephoneCodes_T005K.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 15 | {% include './ecc/TelephoneCodes_T005K.sql' -%} 16 | {% endif -%} 17 | 18 | {% if sql_flavour == 'union' -%} 19 | UNION ALL 20 | {% endif -%} 21 | 22 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 23 | {% include './s4/TelephoneCodes_T005K.sql' -%} 24 | {% endif -%} 25 | -------------------------------------------------------------------------------- /UniversalLedgersMD.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2024 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | {% if sql_flavour == 'ecc' -%} 15 | {% include './ecc/UniversalLedgersMD.sql' -%} 16 | {% endif -%} 17 | 18 | {% if sql_flavour == 's4' -%} 19 | {% include './s4/UniversalLedgersMD.sql' -%} 20 | {% endif -%} 21 | -------------------------------------------------------------------------------- /UoMConversionUtil.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | 16 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 17 | {% include './ecc/UoMConversionUtil.sql' -%} 18 | {% endif -%} 19 | 20 | {% if sql_flavour == 'union' -%} 21 | UNION ALL 22 | {% endif -%} 23 | 24 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 25 | {% include './s4/UoMConversionUtil.sql' -%} 26 | {% endif -%} 27 | -------------------------------------------------------------------------------- /UoMMD.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 15 | {% include './ecc/UoMMD.sql' -%} 16 | {% endif -%} 17 | 18 | {% if sql_flavour == 'union' -%} 19 | UNION ALL 20 | {% endif -%} 21 | 22 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 23 | {% include './s4/UoMMD.sql' -%} 24 | {% endif -%} 25 | -------------------------------------------------------------------------------- /UoMUsage_SAMPLE.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | 16 | {% if sql_flavour == 'ecc' -%} 17 | {% include './ecc/UoMUsage_SAMPLE.sql' -%} 18 | {% endif -%} 19 | 20 | {% if sql_flavour == 's4' -%} 21 | {% include './s4/UoMUsage_SAMPLE.sql' -%} 22 | {% endif -%} 23 | -------------------------------------------------------------------------------- /UpdateMonthlyInventoryAggregation.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2024 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | 16 | {% if sql_flavour == 'ecc' -%} 17 | {% include './ecc/UpdateMonthlyInventoryAggregation.sql' -%} 18 | {% endif -%} 19 | 20 | {% if sql_flavour == 's4' -%} 21 | {% include './s4/UpdateMonthlyInventoryAggregation.sql' -%} 22 | {% endif -%} 23 | 24 | -------------------------------------------------------------------------------- /UpdateStockMonthlySnapshots.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2024 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | 16 | {% if sql_flavour == 'ecc' -%} 17 | {% include './ecc/UpdateStockMonthlySnapshots.sql' -%} 18 | {% endif -%} 19 | 20 | {% if sql_flavour == 's4' -%} 21 | {% include './s4/UpdateStockMonthlySnapshots.sql' -%} 22 | {% endif -%} 23 | 24 | -------------------------------------------------------------------------------- /UpdateStockWeeklySnapshots.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2024 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | 16 | {% if sql_flavour == 'ecc' -%} 17 | {% include './ecc/UpdateStockWeeklySnapshots.sql' -%} 18 | {% endif -%} 19 | 20 | {% if sql_flavour == 's4' -%} 21 | {% include './s4/UpdateStockWeeklySnapshots.sql' -%} 22 | {% endif -%} 23 | 24 | -------------------------------------------------------------------------------- /UpdateWeeklyInventoryAggregation.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2024 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | 16 | {% if sql_flavour == 'ecc' -%} 17 | {% include './ecc/UpdateWeeklyInventoryAggregation.sql' -%} 18 | {% endif -%} 19 | 20 | {% if sql_flavour == 's4' -%} 21 | {% include './s4/UpdateWeeklyInventoryAggregation.sql' -%} 22 | {% endif -%} 23 | 24 | -------------------------------------------------------------------------------- /ValuationAreasMD.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 15 | {% include './ecc/ValuationAreasMD.sql' -%} 16 | {% endif -%} 17 | 18 | {% if sql_flavour == 'union' -%} 19 | UNION ALL 20 | {% endif -%} 21 | 22 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 23 | {% include './s4/ValuationAreasMD.sql' -%} 24 | {% endif -%} 25 | -------------------------------------------------------------------------------- /VendorConfig.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/VendorConfig.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | {% include './s4/VendorConfig.sql' -%} 25 | {% endif -%} 26 | -------------------------------------------------------------------------------- /VendorLeadTimeOverview.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/VendorLeadTimeOverview.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | {% include './s4/VendorLeadTimeOverview.sql' -%} 25 | {% endif -%} 26 | -------------------------------------------------------------------------------- /VendorPerformance.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/VendorPerformance.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | {% include './s4/VendorPerformance.sql' -%} 25 | {% endif -%} 26 | -------------------------------------------------------------------------------- /VendorPerformanceOverview.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 16 | {% include './ecc/VendorPerformanceOverview.sql' -%} 17 | {% endif -%} 18 | 19 | {% if sql_flavour == 'union' -%} 20 | UNION ALL 21 | {% endif -%} 22 | 23 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 24 | {% include './s4/VendorPerformanceOverview.sql' -%} 25 | {% endif -%} 26 | -------------------------------------------------------------------------------- /VendorsMD.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2022 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | {% if sql_flavour == 'ecc' or sql_flavour == 'union' -%} 15 | {% include './ecc/VendorsMD.sql' -%} 16 | {% endif -%} 17 | 18 | {% if sql_flavour == 'union' -%} 19 | UNION ALL 20 | {% endif -%} 21 | 22 | {% if sql_flavour == 's4' or sql_flavour == 'union' -%} 23 | {% include './s4/VendorsMD.sql' -%} 24 | {% endif -%} 25 | -------------------------------------------------------------------------------- /common/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /common/data_mesh/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GoogleCloudPlatform/cortex-reporting/800506fc87ae08a89e7f63dae81c080b9ec2bd8c/common/data_mesh/__init__.py -------------------------------------------------------------------------------- /common/data_mesh/config/lakes/lakes.yaml: -------------------------------------------------------------------------------- 1 | # Lakes dataclass. 2 | # TODO: clean up with recommended structure. 3 | project: {{ project_id_tgt }} 4 | lakes: 5 | - display_name: "sap" 6 | region: "us-central1" 7 | description: "Cortex SAP datasets" 8 | labels: 9 | - name: "lake_label" 10 | value: "l1" 11 | zones: 12 | - display_name: "zone-1" 13 | description: "zone one" 14 | zone_type: RAW 15 | labels: 16 | - name: "zone_label" 17 | value: "l2" 18 | - display_name: "zone-2" 19 | description: "zone two" 20 | zone_type: CURATED 21 | location_type: MULTI_REGION 22 | - display_name: "sfdc" 23 | region: "us-central1" 24 | description: "Cortex SFDC datasets" -------------------------------------------------------------------------------- /common/data_mesh/config/tag_templates/tag_templates.yaml: -------------------------------------------------------------------------------- 1 | # CatalogTagTemplates dataclass. 2 | # TODO: clean up with recommended templates. 3 | project: {{ project_id_tgt }} 4 | templates: 5 | - display_name: "data_governance" 6 | level: ASSET 7 | fields: 8 | - display_name: "retention_date" 9 | field_type: TIMESTAMP 10 | - display_name: "pii" 11 | level: FIELD 12 | fields: 13 | - display_name: "has_pii" 14 | field_type: BOOL 15 | - display_name: "pii_type" 16 | field_type: 17 | enum_allowed_values: ["EMAIL", "ADDRESS", "SSN"] -------------------------------------------------------------------------------- /common/data_mesh/src/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Google LLC 2 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | """Data Mesh __init__""" 15 | 16 | import pathlib 17 | import sys 18 | 19 | # Add cortex /src to the sys path. 20 | sys.path.append(str(pathlib.Path(__file__).parent.parent.parent.parent)) 21 | -------------------------------------------------------------------------------- /common/materializer/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 Google LLC 2 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /common/materializer/templates/bq_insert_job_template.txt: -------------------------------------------------------------------------------- 1 | refresh_${table_name} = BigQueryInsertJobOperator( 2 | task_id="refresh_${table_name}", 3 | configuration={ 4 | "query": { 5 | "query": "${query_file}", 6 | "useLegacySql": False, 7 | }, 8 | "labels": _BQ_LABELS, 9 | "location": _BQ_LOCATION 10 | }, 11 | gcp_conn_id=_GCP_CONN_ID) -------------------------------------------------------------------------------- /common/py_libs/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 Google LLC 2 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /config/ecc/annotations/AccountsPayableOverview.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.AccountsPayableOverview" 2 | description: "Overview view for Accounts Payable. This view mimics the logic in Looker and is not meant to be deployed." 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Finance" 8 | - display_name: "domain" 9 | value: "Accounts Payable" 10 | -------------------------------------------------------------------------------- /config/ecc/annotations/BillingBlockingReasonsMD.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.BillingBlockingReasonsMD" 2 | description: "This view contains the details of billing blocks to the business analyst at the granularity of Client(Mandant), billing block and Language key." 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Master Data" 8 | fields: 9 | - name: "Client_MANDT" 10 | description: "Client (Mandant), PK" 11 | - name: "LanguageKey_SPRAS" 12 | description: "Language Key, PK" 13 | - name: "Block_FAKSP" 14 | description: "Billing Block, PK" 15 | - name: "BillingBlockReason_VTEXT" 16 | description: "Billing Block Description" 17 | -------------------------------------------------------------------------------- /config/ecc/annotations/CostCenterAmountsHierarchy_SAMPLE.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.CostCenterAmountsHierarchy_SAMPLE" 2 | description: "Sample view using Python-based hierarchy flattener (local k9). Not meant to be deployed." 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Finance" 8 | - display_name: "domain" 9 | value: "Cost Accounting" 10 | -------------------------------------------------------------------------------- /config/ecc/annotations/CustomerClearedItems_BSAD.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.CustomerClearedItems_BSAD" 2 | catalog_tags: 3 | - display_name: "line_of_business" 4 | fields: 5 | - display_name: "group" 6 | value: "Finance" 7 | -------------------------------------------------------------------------------- /config/ecc/annotations/CustomerOpenItems_BSID.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.CustomerOpenItems_BSID" 2 | catalog_tags: 3 | - display_name: "line_of_business" 4 | fields: 5 | - display_name: "group" 6 | value: "Finance" 7 | -------------------------------------------------------------------------------- /config/ecc/annotations/DeliveryBlockingReasonsMD.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.DeliveryBlockingReasonsMD" 2 | description: "This view provides the master data of reasons (descriptions) for various delivery blocks. The granularity is Client(System), Language key and delivery block." 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Master Data" 8 | fields: 9 | - name: "Client_MANDT" 10 | description: "Client (Mandant), PK" 11 | - name: "LanguageKey_SPRAS" 12 | description: "Language Key, PK" 13 | - name: "DefaultDeliveryBlock_LIFSP" 14 | description: "Default Delivery Block, PK" 15 | - name: "DeliveryBlockReason_VTEXT" 16 | description: "Delivery Block Description" 17 | -------------------------------------------------------------------------------- /config/ecc/annotations/DistributionChannelsMD.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.DistributionChannelsMD" 2 | description: "This view shows the master data about the different distribution channels. The granularity is client(System), language key and distribution channel." 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Master Data" 8 | fields: 9 | - name: "Client_MANDT" 10 | description: "Client (Mandant), PK" 11 | - name: "DistributionChannel_VTWEG" 12 | description: "Distribution Channel, PK" 13 | - name: "Language_SPRAS" 14 | description: "Language Key, PK" 15 | - name: "DistributionChannelName_VTEXT" 16 | description: "Distribution Channel Name" 17 | -------------------------------------------------------------------------------- /config/ecc/annotations/DivisionsMD.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.DivisionsMD" 2 | description: "This view shows the master data related to the Divisions of products in the system. The granularity is Client(system), language key and division." 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Master Data" 8 | fields: 9 | - name: "Client_MANDT" 10 | description: "Client (Mandant), PK" 11 | - name: "Division_SPART" 12 | description: "Division, PK" 13 | - name: "LanguageKey_SPRAS" 14 | description: "Language Key, PK" 15 | - name: "DivisionName_VTEXT" 16 | description: "Division Name" 17 | -------------------------------------------------------------------------------- /config/ecc/annotations/FixedAssetsMD.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.FixedAssetsMD" 2 | catalog_tags: 3 | - display_name: "line_of_business" 4 | fields: 5 | - display_name: "group" 6 | value: "Master Data" 7 | -------------------------------------------------------------------------------- /config/ecc/annotations/GLDocumentsHdr.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.GLDocumentsHdr" 2 | catalog_tags: 3 | - display_name: "line_of_business" 4 | fields: 5 | - display_name: "group" 6 | value: "Finance" 7 | - display_name: "domain" 8 | value: "GL Accounting" 9 | -------------------------------------------------------------------------------- /config/ecc/annotations/Languages_T002.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.Languages_T002" 2 | description: "This view showcases details about languages supported by the system. It has a granularity of language key." 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Master Data" 8 | fields: 9 | - name: "LanguageKey_SPRAS" 10 | description: "Language Key, PK" 11 | - name: "LanguageSpecifications_LASPEZ" 12 | description: "Language Specifications" 13 | - name: "DegreeOfTranslationOfLanguage_LAHQ" 14 | description: "Degree of Translation of Language" 15 | - name: "TwoCharacterSapLanguageCode_LAISO" 16 | description: "2-Character SAP Language Code" 17 | -------------------------------------------------------------------------------- /config/ecc/annotations/MaterialTypesMD.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.MaterialTypesMD" 2 | description: "MaterialTypesMD view gives details about different material types and their descriptions at the granularity of Client(System), Material Type and Language Key" 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Master Data" 8 | fields: 9 | - name: "Client_MANDT" 10 | description: "Client (Mandant), PK" 11 | - name: "MaterialType_MTART" 12 | description: "Material Type, PK" 13 | - name: "LanguageKey_SPRAS" 14 | description: "Language Key, PK" 15 | - name: "ReferenceMaterialType_MTREF" 16 | description: "Reference Material Type" 17 | - name: "ScreenReferenceDependingOnTheMaterialType_MBREF" 18 | description: "Screen Reference Depending On The Material Type" 19 | - name: "DescriptionOfMaterialType_MTBEZ" 20 | description: "Description Of Material Type" 21 | -------------------------------------------------------------------------------- /config/ecc/annotations/ProductHierarchiesMD.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.ProductHierarchiesMD" 2 | description: "This view gives details about the product hierarchies master data at the granularity of Client(System), product hierarchy and language key." 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Master Data" 8 | fields: 9 | - name: "Client_MANDT" 10 | description: "Client (Mandant), PK" 11 | - name: "Hierarchy_PRODH" 12 | description: "Product Hierarchy, PK" 13 | - name: "Language_SPRAS" 14 | description: "Language Key, PK" 15 | - name: "Level_STUFE" 16 | description: "Number of the level in the product hierarchy" 17 | - name: "Description_VTEXT" 18 | description: "Description" 19 | -------------------------------------------------------------------------------- /config/ecc/annotations/ProductHierarchy_Flatten.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.ProductHierarchy_Flatten" 2 | description: "This view shows flattened product hierarchy at level 3." 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Utility" 8 | fields: 9 | - name: "prodh1" 10 | description: "Product Hierarchy at level 1" 11 | - name: "prodh2" 12 | description: "Product Hierarchy at level 2" 13 | - name: "prodh3" 14 | description: "Product Hierarchy at level 3" 15 | -------------------------------------------------------------------------------- /config/ecc/annotations/ProfitCenterAmountsHierarchy_SAMPLE.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.ProfitCenterAmountsHierarchy_SAMPLE" 2 | description: "Sample view using Python-based profit center hierarchy flattener (local k9). Not meant to be deployed." 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Finance" 8 | - display_name: "domain" 9 | value: "Profit Accounting" 10 | -------------------------------------------------------------------------------- /config/ecc/annotations/PurchaseDocumentTypesMD.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.PurchaseDocumentTypesMD" 2 | description: "This view gives details about the purchasing doucment types master data at the granularity of Client(System), purchasing document type, language key and purchasing document category." 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Master Data" 8 | fields: 9 | - name: "Client_MANDT" 10 | description: "Client (Mandant), PK" 11 | - name: "PurchasingDocumentType_BSART" 12 | description: "Purchasing Document Type, PK" 13 | - name: "Language_SPRAS" 14 | description: "Language Key, PK" 15 | - name: "PurchasingDocumentCategory_BSTYP" 16 | description: "Purchasing Document Category, PK" 17 | - name: "PurchasingDocumentTypeText_BATXT" 18 | description: "Name of Purchasing Doucment Type" 19 | -------------------------------------------------------------------------------- /config/ecc/annotations/PurchasingGroupsMD.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.PurchasingGroupsMD" 2 | description: "This view gives details about the purchasing group master data at the granularity of Client(System) and purchasing group." 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Master Data" 8 | fields: 9 | - name: "Client_MANDT" 10 | description: "Client (Mandant), PK" 11 | - name: "PurchasingGroup_EKGRP" 12 | description: "Purchasing Group, PK" 13 | - name: "PurchasingGroupText_EKNAM" 14 | description: "Description of Purchasing Group" 15 | -------------------------------------------------------------------------------- /config/ecc/annotations/PurchasingOrganizationsMD.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.PurchasingOrganizationsMD" 2 | description: "This view gives details about the purchasing organization master data at the granularity of Client(System) and purchasing organization." 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Master Data" 8 | fields: 9 | - name: "Client_MANDT" 10 | description: "Client (Mandant), PK" 11 | - name: "PurchasingOrganization_EKORG" 12 | description: "Purchasing Organization, PK" 13 | - name: "PurchasingOrganizationText_EKOTX" 14 | description: "Description of Purchasing Organization" 15 | - name: "CompanyCode_BUKRS" 16 | description: "Company Code" 17 | -------------------------------------------------------------------------------- /config/ecc/annotations/ReasonForMovementTypesMD.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.ReasonForMovementTypesMD" 2 | description: "This view gives details about the reasons for movement type master data at the granularity of Client(System), movement type, reason for movement and language key." 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Master Data" 8 | fields: 9 | - name: "Client_MANDT" 10 | description: "Client (Mandant), PK" 11 | - name: "LanguageKey_SPRAS" 12 | description: "Language Key, PK" 13 | - name: "MovementType_BWART" 14 | description: "Movement Type, PK" 15 | - name: "ReasonForMovement_GRUND" 16 | description: "Reason For Movement, PK" 17 | - name: "ReasonForGoodsMovement_GRTXT" 18 | description: "Name Of Reason For Goods Movement" 19 | -------------------------------------------------------------------------------- /config/ecc/annotations/RegionsMD.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.RegionsMD" 2 | catalog_tags: 3 | - display_name: "line_of_business" 4 | fields: 5 | - display_name: "group" 6 | value: "Master Data" 7 | -------------------------------------------------------------------------------- /config/ecc/annotations/Regions_T005S.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.Regions_T005S" 2 | description: "This view gives details about the regions master data at the granularity of Client(System), country key and region." 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Master Data" 8 | fields: 9 | - name: "Client_MANDT" 10 | description: "Client (Mandant), PK" 11 | - name: "CountryKey_LAND1" 12 | description: "Country Key, PK" 13 | - name: "Region_BLAND" 14 | description: "Region, PK" 15 | - name: "ProvincialTaxCode_FPRCD" 16 | description: "Provincial Tax Code" 17 | - name: "StateOfManufacture_HERBL" 18 | description: "State Of Manufacture" 19 | -------------------------------------------------------------------------------- /config/ecc/annotations/SalesOrderDetails_SAMPLE.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.SalesOrderDetails_SAMPLE" 2 | description: "View for sample Looker Studio report. If interested in the report, please contact cortex-support@google.com." 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Sales" 8 | - display_name: "domain" 9 | value: "Order to Cash" 10 | fields: 11 | - name: "Customer" 12 | ## CORTEX-CUSTOMER: Update policy tag example to fit your use case. 13 | policy_tag_id: 14 | display_name: "low" 15 | taxonomy: "data_sensitivity" 16 | -------------------------------------------------------------------------------- /config/ecc/annotations/SlowMovingThreshold.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.SlowMovingThreshold" 2 | description: "This view contains the user-defined threshold for slow moving material categories. The granularity is Client(System) and material type" 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Supply Chain" 8 | - display_name: "domain" 9 | value: "Procurement" 10 | fields: 11 | - name: "Client_MANDT" 12 | description: "Client (Mandant), PK" 13 | - name: "MaterialType_MTART" 14 | description: "Material Type, PK" 15 | - name: "ThresholdValue" 16 | description: "User-defined Slow Moving Inventory threshold. Goods with less inventory turnover than this threshold will be marked as slow moving goods" -------------------------------------------------------------------------------- /config/ecc/annotations/SpecialStocksMD.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.SpecialStocksMD" 2 | description: "This view showcases special stock master data and includes information such as consignment stocks, in-transit stocks, orders on hand, etc. This view has a granularity of Client(System), language key and special stock indicator." 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Master Data" 8 | fields: 9 | - name: "Client_MANDT" 10 | description: "Client (Mandant), PK" 11 | - name: "LanguageKey_SPRAS" 12 | description: "Language Key, PK" 13 | - name: "SpecialStockIndicator_SOBKZ" 14 | description: "Special Stock Indicator, PK" 15 | - name: "DescriptionOfSpecialStock_SOTXT" 16 | description: "Description of Special Stock" 17 | -------------------------------------------------------------------------------- /config/ecc/annotations/Stock_OnHand.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.Stock_OnHand" 2 | catalog_tags: 3 | - display_name: "line_of_business" 4 | fields: 5 | - display_name: "group" 6 | value: "Supply Chain" 7 | - display_name: "domain" 8 | value: "Inventory Management" 9 | -------------------------------------------------------------------------------- /config/ecc/annotations/StorageLocationsMD.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.StorageLocationsMD" 2 | description: "This view gives storage locations master data, i.e., where the stocks are physically stored within a plant. This view is at the granularity of Client(System), plant and storage location." 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Master Data" 8 | fields: 9 | - name: "Client_MANDT" 10 | description: "Client (Mandant), PK" 11 | - name: "Plant_WERKS" 12 | description: "Plant, PK" 13 | - name: "StorageLocation_LGORT" 14 | description: "Storage Location, PK" 15 | - name: "StorageLocationText_LGOBE" 16 | description: "Name of Storage Location" 17 | -------------------------------------------------------------------------------- /config/ecc/annotations/UoMConversion.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.UoMConversion" 2 | catalog_tags: 3 | - display_name: "line_of_business" 4 | fields: 5 | - display_name: "group" 6 | value: "Utility" 7 | -------------------------------------------------------------------------------- /config/ecc/annotations/UoMConversionUtil.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.UoMConversionUtil" 2 | description: "This view gives details about converted unit of measurement value details at the granularity of Client(System), unit from and unit to." 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Utility" 8 | fields: 9 | - name: "mandt" 10 | description: "Client (Mandant), PK" 11 | - name: "unit_to" 12 | description: "Unit To, PK" 13 | - name: "unit_from" 14 | description: "Unit From, PK" 15 | - name: "dimension" 16 | description: "Description of Dimension" 17 | - name: "val_out" 18 | description: "Converted Value" 19 | -------------------------------------------------------------------------------- /config/ecc/annotations/UoMUsage_SAMPLE.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.UoMUsage_SAMPLE" 2 | catalog_tags: 3 | - display_name: "line_of_business" 4 | fields: 5 | - display_name: "group" 6 | value: "Utility" 7 | -------------------------------------------------------------------------------- /config/ecc/annotations/VendorConfig.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.VendorConfig" 2 | description: "This view provides vendor configuration variable details. The granularity is Client(System) and variable name." 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Finance" 8 | - display_name: "domain" 9 | value: "Accounts Payable" 10 | fields: 11 | - name: "Client_MANDT" 12 | description: "Client (Mandant), PK" 13 | - name: "NameOfVariantVariable_NAME" 14 | description: "Variable Name, PK" 15 | - name: "LowField_LOW" 16 | description: "Low Field Value" 17 | - name: "HighField_HIGH" 18 | description: "High Field Value" 19 | -------------------------------------------------------------------------------- /config/ecc/annotations/VendorLeadTimeOverview.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.VendorLeadTimeOverview" 2 | catalog_tags: 3 | - display_name: "line_of_business" 4 | fields: 5 | - display_name: "group" 6 | value: "Supply Chain" 7 | - display_name: "domain" 8 | value: "Vendor Performance" 9 | -------------------------------------------------------------------------------- /config/ecc/annotations/VendorPerformanceOverview.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.VendorPerformanceOverview" 2 | description: "Overview view for Vendor Performance. This view is not meant to be deployed, it is a sample to mimic the report delivered in Looker as part of the SAP block." 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Supply Chain" 8 | - display_name: "domain" 9 | value: "Vendor Performance" 10 | -------------------------------------------------------------------------------- /config/ecc/annotations/currency_decimal.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.currency_decimal" 2 | description: "This table gives information about the decimal factors needed for certain specific currencies, for example JPY, which is required for displaying the amounts correctly. The granularity of this table is at currency key." 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Utility" 8 | fields: 9 | - name: "CURRKEY" 10 | description: "Currency Key, PK" 11 | - name: "CURRFIX" 12 | description: "Number of Decimal Places" 13 | -------------------------------------------------------------------------------- /config/ecc/annotations/prod_hierarchy_texts.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.prod_hierarchy_texts" 2 | description: "This table shows text descriptions for flattened product hierarchy." 3 | fields: 4 | - name: "mandt" 5 | description: "Client (Mandant), PK" 6 | - name: "prodh1" 7 | description: "Product Hierarchy at level 1, PK" 8 | - name: "prodh2" 9 | description: "Product Hierarchy at level 2, PK" 10 | - name: "prodh3" 11 | description: "Product Hierarchy at level 3, PK" 12 | - name: "prodh4" 13 | description: "Product Hierarchy at level 4, PK" 14 | - name: "HierText1" 15 | description: "Product Hierarchy Text at level 1" 16 | - name: "HierText2" 17 | description: "Product Hierarchy Text at level 2" 18 | -------------------------------------------------------------------------------- /config/ecc/lakes/lakes.yaml: -------------------------------------------------------------------------------- 1 | # Lakes dataclass. 2 | project: {{ project_id_tgt }} 3 | lakes: 4 | - display_name: "sap" 5 | ## CORTEX-CUSTOMER: Update with specific region, even if deployment is multiregion. 6 | region: "" 7 | description: "Cortex SAP datasets" 8 | labels: 9 | - name: "sql_flavor" 10 | value: "ecc" 11 | zones: 12 | - display_name: "reporting-sap" 13 | description: "Cortex SAP Reporting dataset" 14 | zone_type: CURATED 15 | ## CORTEX-CUSTOMER: Update to SINGLE_REGION or MULTI_REGION depending on Cortex deployment. 16 | location_type: 17 | assets: 18 | - display_name: "reporting-bq-dataset" 19 | asset_name: "{{ dataset_reporting_tgt }}" -------------------------------------------------------------------------------- /config/ecc/policy_taxonomies/policy_taxonomies.yaml: -------------------------------------------------------------------------------- 1 | project: {{ project_id_tgt }} 2 | ## CORTEX-CUSTOMER: Update policy taxonomies to fit your use case. 3 | taxonomies: 4 | - display_name: "data_sensitivity" 5 | description: "pii data taxonomy" 6 | policy_tags: 7 | - display_name: "low" 8 | description: "PII data with low sensitivity" 9 | # unmasked_readers: ["group:low_pii_unmasked_readers@example.com"] 10 | data_policies: 11 | - display_name: "hash_mask" 12 | masking_rule: SHA256 13 | # masked_readers: ["group:low_pii_masked_readers@example.com"] 14 | -------------------------------------------------------------------------------- /config/ecc/tag_templates/templates.yaml: -------------------------------------------------------------------------------- 1 | project: {{ project_id_tgt }} 2 | templates: 3 | - display_name: "line_of_business" 4 | level: ASSET 5 | fields: 6 | - display_name: "group" 7 | field_type: STRING 8 | - display_name: "domain" 9 | field_type: STRING -------------------------------------------------------------------------------- /config/k9_placeholder_settings.yaml: -------------------------------------------------------------------------------- 1 | # This settings file ensures the existence of required K9 dependencies by 2 | # creating the K9 Processing dataset plus any placeholders for all 3 | # required tables / views, in case any does not yet exist. 4 | 5 | bq_independent_objects: 6 | 7 | - sql_file: placeholders/calendar_date_dim.sql 8 | type: script 9 | -------------------------------------------------------------------------------- /config/reporting_settings_common_prereqs.yaml: -------------------------------------------------------------------------------- 1 | # This settings file drives how the the Localized K9s (formerly known as 2 | # External DAGs) are deployed. 3 | # This deployment needs to happen before actual Reporting as some Reporting 4 | # views / tables depend on tables generated by these DAGs. 5 | 6 | # The following k9s will be deployed in parallel 7 | bq_independent_objects: 8 | 9 | - type: k9_dawg 10 | k9_id: currency_conversion 11 | 12 | - type: k9_dawg 13 | k9_id: prod_hierarchy_texts 14 | 15 | - sql_file: is_leap_year.sql 16 | type: script 17 | 18 | - type: k9_dawg 19 | k9_id: fsv_hierarchy 20 | 21 | - type: k9_dawg 22 | k9_id: costcenter_hierarchy 23 | 24 | - type: k9_dawg 25 | k9_id: profitcenter_hierarchy 26 | -------------------------------------------------------------------------------- /config/s4/annotations/AccountsPayableOverview.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.AccountsPayableOverview" 2 | description: "Overview view for Accounts Payable. This view mimics the logic in Looker and is not meant to be deployed." 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Finance" 8 | - display_name: "domain" 9 | value: "Accounts Payable" 10 | -------------------------------------------------------------------------------- /config/s4/annotations/BillingBlockingReasonsMD.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.BillingBlockingReasonsMD" 2 | description: "This view contains the details of billing blocks to the business analyst at the granularity of Client(Mandant), billing block and Language key." 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Master Data" 8 | fields: 9 | - name: "Client_MANDT" 10 | description: "Client (Mandant), PK" 11 | - name: "LanguageKey_SPRAS" 12 | description: "Language Key, PK" 13 | - name: "Block_FAKSP" 14 | description: "Billing Block, PK" 15 | - name: "BillingBlockReason_VTEXT" 16 | description: "Billing Block Description" 17 | -------------------------------------------------------------------------------- /config/s4/annotations/CostCenterAmountsHierarchy_SAMPLE.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.CostCenterAmountsHierarchy_SAMPLE" 2 | description: "Sample view using Python-based hierarchy flattener (local k9). Not meant to be deployed." 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Finance" 8 | - display_name: "domain" 9 | value: "Cost Accounting" 10 | -------------------------------------------------------------------------------- /config/s4/annotations/CustomerClearedItems_BSAD.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.CustomerClearedItems_BSAD" 2 | catalog_tags: 3 | - display_name: "line_of_business" 4 | fields: 5 | - display_name: "group" 6 | value: "Finance" 7 | -------------------------------------------------------------------------------- /config/s4/annotations/CustomerOpenItems_BSID.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.CustomerOpenItems_BSID" 2 | catalog_tags: 3 | - display_name: "line_of_business" 4 | fields: 5 | - display_name: "group" 6 | value: "Finance" 7 | -------------------------------------------------------------------------------- /config/s4/annotations/DeliveryBlockingReasonsMD.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.DeliveryBlockingReasonsMD" 2 | description: "This view provides the master data of reasons (descriptions) for various delivery blocks. The granularity is Client(System), Language key and delivery block." 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Master Data" 8 | fields: 9 | - name: "Client_MANDT" 10 | description: "Client (Mandant), PK" 11 | - name: "LanguageKey_SPRAS" 12 | description: "Language Key, PK" 13 | - name: "DefaultDeliveryBlock_LIFSP" 14 | description: "Default Delivery Block, PK" 15 | - name: "DeliveryBlockReason_VTEXT" 16 | description: "Delivery Block Description" 17 | -------------------------------------------------------------------------------- /config/s4/annotations/DistributionChannelsMD.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.DistributionChannelsMD" 2 | description: "This view shows the master data about the different distribution channels. The granularity is client(System), language key and distribution channel." 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Master Data" 8 | fields: 9 | - name: "Client_MANDT" 10 | description: "Client (Mandant), PK" 11 | - name: "DistributionChannel_VTWEG" 12 | description: "Distribution Channel, PK" 13 | - name: "Language_SPRAS" 14 | description: "Language Key, PK" 15 | - name: "DistributionChannelName_VTEXT" 16 | description: "Distribution Channel Name" 17 | -------------------------------------------------------------------------------- /config/s4/annotations/DivisionsMD.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.DivisionsMD" 2 | description: "This view shows the master data related to the Divisions of products in the system. The granularity is Client(system), language key and division." 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Master Data" 8 | fields: 9 | - name: "Client_MANDT" 10 | description: "Client (Mandant), PK" 11 | - name: "Division_SPART" 12 | description: "Division, PK" 13 | - name: "LanguageKey_SPRAS" 14 | description: "Language Key, PK" 15 | - name: "DivisionName_VTEXT" 16 | description: "Division Name" 17 | -------------------------------------------------------------------------------- /config/s4/annotations/FixedAssetsMD.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.FixedAssetsMD" 2 | catalog_tags: 3 | - display_name: "line_of_business" 4 | fields: 5 | - display_name: "group" 6 | value: "Master Data" 7 | -------------------------------------------------------------------------------- /config/s4/annotations/GLDocumentsHdr.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.GLDocumentsHdr" 2 | catalog_tags: 3 | - display_name: "line_of_business" 4 | fields: 5 | - display_name: "group" 6 | value: "Finance" 7 | - display_name: "domain" 8 | value: "GL Accounting" 9 | -------------------------------------------------------------------------------- /config/s4/annotations/Languages_T002.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.Languages_T002" 2 | description: "This view showcases details about languages supported by the system. It has a granularity of language key." 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Master Data" 8 | fields: 9 | - name: "LanguageKey_SPRAS" 10 | description: "Language Key, PK" 11 | - name: "LanguageSpecifications_LASPEZ" 12 | description: "Language Specifications" 13 | - name: "DegreeOfTranslationOfLanguage_LAHQ" 14 | description: "Degree of Translation of Language" 15 | - name: "TwoCharacterSapLanguageCode_LAISO" 16 | description: "2-Character SAP Language Code" 17 | -------------------------------------------------------------------------------- /config/s4/annotations/MaterialTypesMD.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.MaterialTypesMD" 2 | description: "MaterialTypesMD view gives details about different material types and their descriptions at the granularity of Client(System), Material Type and Language Key" 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Master Data" 8 | fields: 9 | - name: "Client_MANDT" 10 | description: "Client (Mandant), PK" 11 | - name: "MaterialType_MTART" 12 | description: "Material Type, PK" 13 | - name: "LanguageKey_SPRAS" 14 | description: "Language Key, PK" 15 | - name: "ReferenceMaterialType_MTREF" 16 | description: "Reference Material Type" 17 | - name: "ScreenReferenceDependingOnTheMaterialType_MBREF" 18 | description: "Screen Reference Depending On The Material Type" 19 | - name: "DescriptionOfMaterialType_MTBEZ" 20 | description: "Description Of Material Type" 21 | -------------------------------------------------------------------------------- /config/s4/annotations/ProductHierarchiesMD.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.ProductHierarchiesMD" 2 | description: "This view gives details about the product hierarchies master data at the granularity of Client(System), product hierarchy and language key." 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Master Data" 8 | fields: 9 | - name: "Client_MANDT" 10 | description: "Client (Mandant), PK" 11 | - name: "Hierarchy_PRODH" 12 | description: "Product Hierarchy, PK" 13 | - name: "Language_SPRAS" 14 | description: "Language Key, PK" 15 | - name: "Level_STUFE" 16 | description: "Number of the level in the product hierarchy" 17 | - name: "Description_VTEXT" 18 | description: "Description" 19 | -------------------------------------------------------------------------------- /config/s4/annotations/ProductHierarchy_Flatten.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.ProductHierarchy_Flatten" 2 | description: "This view shows flattened product hierarchy at level 3." 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Utility" 8 | fields: 9 | - name: "prodh1" 10 | description: "Product Hierarchy at level 1" 11 | - name: "prodh2" 12 | description: "Product Hierarchy at level 2" 13 | - name: "prodh3" 14 | description: "Product Hierarchy at level 3" 15 | -------------------------------------------------------------------------------- /config/s4/annotations/ProfitCenterAmountsHierarchy_SAMPLE.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.ProfitCenterAmountsHierarchy_SAMPLE" 2 | description: "Sample view using Python-based profit center hierarchy flattener (local k9). Not meant to be deployed." 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Finance" 8 | - display_name: "domain" 9 | value: "Profit Accounting" 10 | -------------------------------------------------------------------------------- /config/s4/annotations/PurchaseDocumentTypesMD.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.PurchaseDocumentTypesMD" 2 | description: "This view gives details about the purchasing doucment types master data at the granularity of Client(System), purchasing document type, language key and purchasing document category." 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Master Data" 8 | fields: 9 | - name: "Client_MANDT" 10 | description: "Client (Mandant), PK" 11 | - name: "PurchasingDocumentType_BSART" 12 | description: "Purchasing Document Type, PK" 13 | - name: "Language_SPRAS" 14 | description: "Language Key, PK" 15 | - name: "PurchasingDocumentCategory_BSTYP" 16 | description: "Purchasing Document Category, PK" 17 | - name: "PurchasingDocumentTypeText_BATXT" 18 | description: "Name of Purchasing Doucment Type" 19 | -------------------------------------------------------------------------------- /config/s4/annotations/PurchasingGroupsMD.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.PurchasingGroupsMD" 2 | description: "This view gives details about the purchasing group master data at the granularity of Client(System) and purchasing group." 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Master Data" 8 | fields: 9 | - name: "Client_MANDT" 10 | description: "Client (Mandant), PK" 11 | - name: "PurchasingGroup_EKGRP" 12 | description: "Purchasing Group, PK" 13 | - name: "PurchasingGroupText_EKNAM" 14 | description: "Description of Purchasing Group" 15 | -------------------------------------------------------------------------------- /config/s4/annotations/PurchasingOrganizationsMD.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.PurchasingOrganizationsMD" 2 | description: "This view gives details about the purchasing organization master data at the granularity of Client(System) and purchasing organization." 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Master Data" 8 | fields: 9 | - name: "Client_MANDT" 10 | description: "Client (Mandant), PK" 11 | - name: "PurchasingOrganization_EKORG" 12 | description: "Purchasing Organization, PK" 13 | - name: "PurchasingOrganizationText_EKOTX" 14 | description: "Description of Purchasing Organization" 15 | - name: "CompanyCode_BUKRS" 16 | description: "Company Code" 17 | -------------------------------------------------------------------------------- /config/s4/annotations/ReasonForMovementTypesMD.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.ReasonForMovementTypesMD" 2 | description: "This view gives details about the reasons for movement type master data at the granularity of Client(System), movement type, reason for movement and language key." 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Master Data" 8 | fields: 9 | - name: "Client_MANDT" 10 | description: "Client (Mandant), PK" 11 | - name: "LanguageKey_SPRAS" 12 | description: "Language Key, PK" 13 | - name: "MovementType_BWART" 14 | description: "Movement Type, PK" 15 | - name: "ReasonForMovement_GRUND" 16 | description: "Reason For Movement, PK" 17 | - name: "ReasonForGoodsMovement_GRTXT" 18 | description: "Name Of Reason For Goods Movement" 19 | -------------------------------------------------------------------------------- /config/s4/annotations/RegionsMD.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.RegionsMD" 2 | catalog_tags: 3 | - display_name: "line_of_business" 4 | fields: 5 | - display_name: "group" 6 | value: "Master Data" 7 | -------------------------------------------------------------------------------- /config/s4/annotations/Regions_T005S.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.Regions_T005S" 2 | description: "This view gives details about the regions master data at the granularity of Client(System), country key and region." 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Master Data" 8 | fields: 9 | - name: "Client_MANDT" 10 | description: "Client (Mandant), PK" 11 | - name: "CountryKey_LAND1" 12 | description: "Country Key, PK" 13 | - name: "Region_BLAND" 14 | description: "Region, PK" 15 | - name: "ProvincialTaxCode_FPRCD" 16 | description: "Provincial Tax Code" 17 | - name: "StateOfManufacture_HERBL" 18 | description: "State Of Manufacture" 19 | -------------------------------------------------------------------------------- /config/s4/annotations/SalesOrderDetails_SAMPLE.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.SalesOrderDetails_SAMPLE" 2 | description: "View for sample Looker Studio report. If interested in the report, please contact cortex-support@google.com." 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Sales" 8 | - display_name: "domain" 9 | value: "Order to Cash" 10 | fields: 11 | - name: "Customer" 12 | ## CORTEX-CUSTOMER: Update policy tag example to fit your use case. 13 | policy_tag_id: 14 | display_name: "low" 15 | taxonomy: "data_sensitivity" 16 | -------------------------------------------------------------------------------- /config/s4/annotations/SlowMovingThreshold.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.SlowMovingThreshold" 2 | description: "This view contains the user-defined threshold for slow moving material categories. The granularity is Client(System) and material type" 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Supply Chain" 8 | - display_name: "domain" 9 | value: "Procurement" 10 | fields: 11 | - name: "Client_MANDT" 12 | description: "Client (Mandant), PK" 13 | - name: "MaterialType_MTART" 14 | description: "Material Type, PK" 15 | - name: "ThresholdValue" 16 | description: "User-defined Slow Moving Inventory threshold. Goods with less inventory turnover than this threshold will be marked as slow moving goods" 17 | -------------------------------------------------------------------------------- /config/s4/annotations/SpecialStocksMD.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.SpecialStocksMD" 2 | description: "This view showcases special stock master data and includes information such as consignment stocks, in-transit stocks, orders on hand, etc. This view has a granularity of Client(System), language key and special stock indicator." 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Master Data" 8 | fields: 9 | - name: "Client_MANDT" 10 | description: "Client (Mandant), PK" 11 | - name: "LanguageKey_SPRAS" 12 | description: "Language Key, PK" 13 | - name: "SpecialStockIndicator_SOBKZ" 14 | description: "Special Stock Indicator, PK" 15 | - name: "DescriptionOfSpecialStock_SOTXT" 16 | description: "Description of Special Stock" 17 | -------------------------------------------------------------------------------- /config/s4/annotations/StockCharacteristicsConfig.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.StockCharacteristicsConfig" 2 | description: "This view stores the configurations for various stock characteristics (blocked, restricted etc) and their associated movement types. The granularity is at Client(System), stock characteristic type and Special Stock Indicator" 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Supply Chain" 8 | - display_name: "domain" 9 | value: "Inventory Management" 10 | fields: 11 | - name: "Client_MANDT" 12 | description: "Client (Mandant), PK" 13 | - name: "StockCharacteristic_BSTAUS_SG" 14 | description: "Stock Characteristic Type, PK" 15 | - name: "SpecialStockIndicator_SOBKZ" 16 | description: "Special Stock Indicator, PK" 17 | - name: "StockCharacteristic" 18 | description: "The characteristics/categories of Inventory the materials are moving into/out of" 19 | -------------------------------------------------------------------------------- /config/s4/annotations/Stock_OnHand.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.Stock_OnHand" 2 | catalog_tags: 3 | - display_name: "line_of_business" 4 | fields: 5 | - display_name: "group" 6 | value: "Supply Chain" 7 | - display_name: "domain" 8 | value: "Inventory Management" 9 | -------------------------------------------------------------------------------- /config/s4/annotations/StorageLocationsMD.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.StorageLocationsMD" 2 | description: "This view gives storage locations master data, i.e., where the stocks are physically stored within a plant. This view is at the granularity of Client(System), plant and storage location." 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Master Data" 8 | fields: 9 | - name: "Client_MANDT" 10 | description: "Client (Mandant), PK" 11 | - name: "Plant_WERKS" 12 | description: "Plant, PK" 13 | - name: "StorageLocation_LGORT" 14 | description: "Storage Location, PK" 15 | - name: "StorageLocationText_LGOBE" 16 | description: "Name of Storage Location" 17 | -------------------------------------------------------------------------------- /config/s4/annotations/UoMConversion.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.UoMConversion" 2 | catalog_tags: 3 | - display_name: "line_of_business" 4 | fields: 5 | - display_name: "group" 6 | value: "Utility" 7 | -------------------------------------------------------------------------------- /config/s4/annotations/UoMConversionUtil.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.UoMConversionUtil" 2 | description: "This view gives details about converted unit of measurement value details at the granularity of Client(System), unit from and unit to." 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Utility" 8 | fields: 9 | - name: "mandt" 10 | description: "Client (Mandant), PK" 11 | - name: "unit_to" 12 | description: "Unit To, PK" 13 | - name: "unit_from" 14 | description: "Unit From, PK" 15 | - name: "dimension" 16 | description: "Description of Dimension" 17 | - name: "val_out" 18 | description: "Converted Value" 19 | -------------------------------------------------------------------------------- /config/s4/annotations/UoMUsage_SAMPLE.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.UoMUsage_SAMPLE" 2 | catalog_tags: 3 | - display_name: "line_of_business" 4 | fields: 5 | - display_name: "group" 6 | value: "Utility" 7 | -------------------------------------------------------------------------------- /config/s4/annotations/VendorConfig.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.VendorConfig" 2 | description: "This view provides vendor configuration variable details. The granularity is Client(System) and variable name." 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Finance" 8 | - display_name: "domain" 9 | value: "Accounts Payable" 10 | fields: 11 | - name: "Client_MANDT" 12 | description: "Client (Mandant), PK" 13 | - name: "NameOfVariantVariable_NAME" 14 | description: "Variable Name, PK" 15 | - name: "LowField_LOW" 16 | description: "Low Field Value" 17 | - name: "HighField_HIGH" 18 | description: "High Field Value" 19 | -------------------------------------------------------------------------------- /config/s4/annotations/VendorLeadTimeOverview.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.VendorLeadTimeOverview" 2 | catalog_tags: 3 | - display_name: "line_of_business" 4 | fields: 5 | - display_name: "group" 6 | value: "Supply Chain" 7 | - display_name: "domain" 8 | value: "Vendor Performance" 9 | -------------------------------------------------------------------------------- /config/s4/annotations/VendorPerformanceOverview.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.VendorPerformanceOverview" 2 | description: "Overview view for Vendor Performance. This view is not meant to be deployed, it is a sample to mimic the report delivered in Looker as part of the SAP block." 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Supply Chain" 8 | - display_name: "domain" 9 | value: "Vendor Performance" 10 | -------------------------------------------------------------------------------- /config/s4/annotations/currency_decimal.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.currency_decimal" 2 | description: "This table gives information about the decimal factors needed for certain specific currencies, for example JPY, which is required for displaying the amounts correctly. The granularity of this table is at currency key." 3 | catalog_tags: 4 | - display_name: "line_of_business" 5 | fields: 6 | - display_name: "group" 7 | value: "Utility" 8 | fields: 9 | - name: "CURRKEY" 10 | description: "Currency Key, PK" 11 | - name: "CURRFIX" 12 | description: "Number of Decimal Places" 13 | -------------------------------------------------------------------------------- /config/s4/annotations/prod_hierarchy_texts.yaml: -------------------------------------------------------------------------------- 1 | name: "{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.prod_hierarchy_texts" 2 | description: "This table shows text descriptions for flattened product hierarchy." 3 | fields: 4 | - name: "mandt" 5 | description: "Client (Mandant), PK" 6 | - name: "prodh1" 7 | description: "Product Hierarchy at level 1, PK" 8 | - name: "prodh2" 9 | description: "Product Hierarchy at level 2, PK" 10 | - name: "prodh3" 11 | description: "Product Hierarchy at level 3, PK" 12 | - name: "prodh4" 13 | description: "Product Hierarchy at level 4, PK" 14 | - name: "HierText1" 15 | description: "Product Hierarchy Text at level 1" 16 | - name: "HierText2" 17 | description: "Product Hierarchy Text at level 2" 18 | -------------------------------------------------------------------------------- /config/s4/lakes/lakes.yaml: -------------------------------------------------------------------------------- 1 | # Lakes dataclass. 2 | project: {{ project_id_tgt }} 3 | lakes: 4 | - display_name: "sap" 5 | ## CORTEX-CUSTOMER: Update with specific region, even if deployment is multiregion. 6 | region: "" 7 | description: "Cortex SAP datasets" 8 | labels: 9 | - name: "sql_flavor" 10 | value: "s4" 11 | zones: 12 | - display_name: "reporting-sap" 13 | description: "Cortex SAP Reporting dataset" 14 | zone_type: CURATED 15 | location_type: MULTI_REGION 16 | assets: 17 | - display_name: "reporting-bq-dataset" 18 | asset_name: "{{ dataset_reporting_tgt }}" -------------------------------------------------------------------------------- /config/s4/policy_taxonomies/policy_taxonomies.yaml: -------------------------------------------------------------------------------- 1 | project: {{ project_id_tgt }} 2 | ## CORTEX-CUSTOMER: Update policy taxonomies to fit your use case. 3 | taxonomies: 4 | - display_name: "data_sensitivity" 5 | description: "pii data taxonomy" 6 | policy_tags: 7 | - display_name: "low" 8 | description: "PII data with low sensitivity" 9 | # unmasked_readers: ["group:low_pii_unmasked_readers@example.com"] 10 | data_policies: 11 | - display_name: "hash_mask" 12 | masking_rule: SHA256 13 | # masked_readers: ["group:low_pii_masked_readers@example.com"] 14 | -------------------------------------------------------------------------------- /config/s4/tag_templates/templates.yaml: -------------------------------------------------------------------------------- 1 | project: {{ project_id_tgt }} 2 | templates: 3 | - display_name: "line_of_business" 4 | level: ASSET 5 | fields: 6 | - display_name: "group" 7 | field_type: STRING 8 | - display_name: "domain" 9 | field_type: STRING -------------------------------------------------------------------------------- /ecc/BillingBlockingReasonsMD.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | TVFST.MANDT AS Client_MANDT, 3 | TVFST.SPRAS AS LanguageKey_SPRAS, 4 | TVFST.FAKSP AS Block_FAKSP, 5 | TVFST.VTEXT AS BillingBlockReason_VTEXT, 6 | FROM `{{ project_id_src }}.{{ dataset_cdc_processed_ecc }}.tvfst` AS TVFST 7 | -------------------------------------------------------------------------------- /ecc/CostCenterAmountsHierarchy_SAMPLE.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | h.ParentNode AS ParentHierarchy, 3 | h.CostCenterNode AS ChildHierarchy, 4 | h.CostCenter_KOSTL, 5 | h.LanguageKey_SPRAS, 6 | h.CostCenterNodeText AS CostCenterDescription, 7 | a.AmountInLocalCurrency_DMBTR, 8 | a.AmountInDocumentCurrency_WRBTR 9 | FROM `{{ project_id_src }}.{{ dataset_reporting_tgt }}.CostCenterHierarchyFlattened` AS h 10 | INNER JOIN `{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.AccountingDocuments` AS a 11 | USING (Client_MANDT, CostCenter_KOSTL) 12 | WHERE 13 | h.HierarchyClass_SETCLASS = '0101' 14 | AND h.IsLeafNode 15 | -------------------------------------------------------------------------------- /ecc/CostCenterHierarchiesMD.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | setheadert.MANDT AS Client_MANDT, 3 | setheadert.SETCLASS AS SetClass_SETCLASS, 4 | setheadert.SUBCLASS AS OrganizationalUnit_SUBCLASS, 5 | setheadert.SETNAME AS SetName_SETNAME, 6 | setheadert.LANGU AS LanguageKey_LANGU, 7 | setheadert.DESCRIPT AS ShortDescriptionOfSet_DESCRIPT 8 | FROM 9 | `{{ project_id_src }}.{{ dataset_cdc_processed_ecc }}.setheadert` AS setheadert 10 | WHERE 11 | setclass = '0101' 12 | -------------------------------------------------------------------------------- /ecc/CurrenciesMD.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | tcurc.mandt AS Client_MANDT, tcurc.waers AS CurrencyCode_WAERS, tcurc.isocd AS CurrencyISO_ISOCD, 3 | tcurx.currdec AS CurrencyDecimals_CURRDEC, tcurt.spras AS Language, 4 | tcurt.ktext AS CurrShortText_KTEXT, tcurt.ltext AS CurrLongText_LTEXT 5 | FROM `{{ project_id_src }}.{{ dataset_cdc_processed_ecc }}.tcurc` AS tcurc 6 | INNER JOIN 7 | `{{ project_id_src }}.{{ dataset_cdc_processed_ecc }}.tcurx` AS tcurx ON tcurc.waers = tcurx.currkey 8 | INNER JOIN 9 | `{{ project_id_src }}.{{ dataset_cdc_processed_ecc }}.tcurt`AS tcurt 10 | ON tcurc.waers = tcurt.waers AND tcurc.mandt = tcurt.mandt 11 | -------------------------------------------------------------------------------- /ecc/DeliveryBlockingReasonsMD.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | TVLST.MANDT AS Client_MANDT, 3 | TVLST.SPRAS AS LanguageKey_SPRAS, 4 | TVLST.LIFSP AS DefaultDeliveryBlock_LIFSP, 5 | TVLST.VTEXT AS DeliveryBlockReason_VTEXT, 6 | FROM `{{ project_id_src }}.{{ dataset_cdc_processed_ecc }}.tvlst` AS TVLST 7 | -------------------------------------------------------------------------------- /ecc/DistributionChannelsMD.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | TVTW.MANDT AS Client_MANDT, 3 | TVTW.VTWEG AS DistributionChannel_VTWEG, 4 | TVTWT.SPRAS AS Language_SPRAS, 5 | TVTWT.VTEXT AS DistributionChannelName_VTEXT 6 | FROM 7 | `{{ project_id_src }}.{{ dataset_cdc_processed_ecc }}.tvtw` AS TVTW 8 | INNER JOIN 9 | `{{ project_id_src }}.{{ dataset_cdc_processed_ecc }}.tvtwt` AS TVTWT 10 | ON 11 | TVTW.MANDT = TVTWT.MANDT 12 | AND TVTW.VTWEG = TVTWT.VTWEG 13 | -------------------------------------------------------------------------------- /ecc/DivisionsMD.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | TSPA.mandt AS Client_MANDT, 3 | TSPA.spart AS Division_SPART, 4 | TSPAT.spras AS LanguageKey_SPRAS, 5 | TSPAT.vtext AS DivisionName_VTEXT 6 | FROM 7 | `{{ project_id_src }}.{{ dataset_cdc_processed_ecc }}.tspa` AS TSPA 8 | LEFT JOIN 9 | `{{ project_id_src }}.{{ dataset_cdc_processed_ecc }}.tspat` AS TSPAT 10 | ON 11 | TSPA.MANDT = TSPAT.MANDT 12 | AND TSPA.SPART = TSPAT.SPART 13 | -------------------------------------------------------------------------------- /ecc/FSVTextsMD.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | fagl_011qt.MANDT AS Client_MANDT, 3 | fagl_011qt.VERSN AS FinancialStatementVersion_VERSN, 4 | fagl_011qt.SPRAS AS LanguageKey_SPRAS, 5 | fagl_011qt.ERGSL AS FinancialStatementItem_ERGSL, 6 | fagl_011qt.TXTYP AS TextType_TXTYP, 7 | fagl_011qt.ZEILE AS FinancialStatementItemLineNumber_ZEILE, 8 | fagl_011qt.TXT45 AS FinancialStatementItemText_TXT45 9 | FROM 10 | `{{ project_id_src }}.{{ dataset_cdc_processed_ecc }}.fagl_011qt` AS fagl_011qt 11 | -------------------------------------------------------------------------------- /ecc/Languages_T002.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | T002.SPRAS AS LanguageKey_SPRAS, 3 | T002.LASPEZ AS LanguageSpecifications_LASPEZ, 4 | T002.LAHQ AS DegreeOfTranslationOfLanguage_LAHQ, 5 | T002.LAISO AS TwoCharacterSapLanguageCode_LAISO 6 | FROM `{{ project_id_src }}.{{ dataset_cdc_processed_ecc }}.t002` AS T002 7 | -------------------------------------------------------------------------------- /ecc/LedgersMD.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | t881.mandt AS Client_MANDT, 3 | t881.rldnr AS Ledger_RLDNR, 4 | t881.gcurr AS Currency_GCURR, 5 | t881.class AS CompanyCurrencyRole_CLASS, 6 | t881.logsys AS LogicalSystem_LOGSYS, 7 | t881.valutyp AS ControllingValuationType_VALUTYP, 8 | t881.xleading AS LeadingLedgerFlag_XLEADING, 9 | t881.appl AS LedgerApplication_APPL, 10 | t881.subappl AS LedgerSubapplication_SUBAPPL, 11 | t881.curt1 AS AddlCurrRole1_CURT1, 12 | t881.curt2 AS AddlCurrRole2_CURT2, 13 | t881.curt3 AS AddlCurrRole3_CURT3, 14 | t881t.langu AS Language_LANGU, 15 | t881t.name AS Name 16 | FROM `{{ project_id_src }}.{{ dataset_cdc_processed_ecc }}.t881` AS t881 17 | INNER JOIN `{{ project_id_src }}.{{ dataset_cdc_processed_ecc }}.t881t` AS t881t 18 | ON t881.rldnr = t881t.rldnr AND t881.mandt = t881t.mandt 19 | -------------------------------------------------------------------------------- /ecc/MaterialGroupsMD.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | t023.MANDT AS Client_MANDT, 3 | t023.MATKL AS MaterialGroup_MATKL, 4 | t023.SPART AS Division_SPART, 5 | t023.WWGDA AS ReferenceGroupRefMaterial_WWGDA, 6 | t023.WWGPA AS GroupMaterial_WWGPA, 7 | t023.ABTNR AS DepartmentNumber_ABTNR, 8 | t023.BEGRU AS AuthorizationGroup_BEGRU, 9 | t023.GEWEI AS DefaultUnitofWeight_GEWEI, 10 | t023.BKLAS AS ValuationClass_BKLAS, 11 | t023.EKWSL AS PurchasingValueKey_EKWSL, 12 | t023.ANLKL AS AssetClass_ANLKL, 13 | t023.PRICE_GROUP AS PriceLevelGroup_PRICE_GROUP, 14 | t023t.wgbez AS MaterialGroupName_WGBEZ, 15 | t023t.spras AS Language_SPRAS 16 | FROM `{{ project_id_src }}.{{ dataset_cdc_processed_ecc }}.t023` AS t023 17 | INNER JOIN `{{ project_id_src }}.{{ dataset_cdc_processed_ecc }}.t023t` AS t023t 18 | ON t023.MANDT = t023t.MANDT 19 | AND t023.MATKL = t023t.MATKL 20 | -------------------------------------------------------------------------------- /ecc/MaterialMovementTypesMD.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | t156t.MANDT AS Client_MANDT, 3 | t156t.SPRAS AS LanguageKey_SPRAS, 4 | t156t.BWART AS MovementType_BWART, 5 | t156t.SOBKZ AS SpecialStock_SOBKZ, 6 | t156t.KZBEW AS MovementIndicator_KZBEW, 7 | t156t.KZZUG AS ReceiptIndicator_KZZUG, 8 | t156t.KZVBR AS ConsumptionPosting_KZVBR, 9 | t156t.BTEXT AS MovementTypeText_BTEXT 10 | FROM `{{ project_id_src }}.{{ dataset_cdc_processed_ecc }}.t156t` AS t156t 11 | -------------------------------------------------------------------------------- /ecc/ProductHierarchiesMD.sql: -------------------------------------------------------------------------------- 1 | SELECT t179.mandt AS Client_MANDT, 2 | t179.prodh AS Hierarchy_PRODH, 3 | t179.stufe AS Level_STUFE, 4 | t179t.spras AS Language_SPRAS, 5 | t179t.vtext AS Description_VTEXT 6 | FROM `{{ project_id_src }}.{{ dataset_cdc_processed_ecc }}.t179` AS t179 7 | INNER JOIN `{{ project_id_src }}.{{ dataset_cdc_processed_ecc }}.t179t` AS t179t 8 | ON t179.mandt = t179t.mandt AND t179.prodh = t179t.prodh 9 | -------------------------------------------------------------------------------- /ecc/ProductHierarchy_Flatten.sql: -------------------------------------------------------------------------------- 1 | (WITH h1_h2 AS ( 2 | SELECT h1.prodh AS prodh1, h2.prodh AS prodh2 3 | FROM `{{ project_id_src }}.{{ dataset_cdc_processed_ecc }}.t179` AS h1 4 | LEFT OUTER JOIN `{{ project_id_src }}.{{ dataset_cdc_processed_ecc }}.t179` AS h2 5 | ON starts_with(h2.prodh, h1.prodh) 6 | WHERE h1.stufe = '1' 7 | AND h2.stufe = '2' 8 | ) 9 | SELECT h1_h2.prodh1 AS prodh1, 10 | h1_h2.prodh2 AS prodh2, 11 | h3.prodh AS prodh3 12 | FROM h1_h2 AS h1_h2 13 | LEFT OUTER JOIN `{{ project_id_src }}.{{ dataset_cdc_processed_ecc }}.t179` AS h3 14 | ON starts_with(h3.prodh, h1_h2.prodh2) 15 | WHERE h3.stufe = '3' 16 | ) 17 | -------------------------------------------------------------------------------- /ecc/ProfitCenterAmountsHierarchy_SAMPLE.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | h.ParentNode AS ParentHierarchy, 3 | h.ProfitCenterNode AS ChildHierarchy, 4 | h.ProfitCenter_PRCTR, 5 | h.LanguageKey_SPRAS, 6 | h.ProfitCenterNodeText AS ProfitCenterDescription, 7 | a.AmountInLocalCurrency_DMBTR, 8 | a.AmountInDocumentCurrency_WRBTR 9 | FROM `{{ project_id_src }}.{{ dataset_reporting_tgt }}.ProfitCenterHierarchyFlattened` AS h 10 | INNER JOIN `{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.AccountingDocuments` AS a 11 | USING (Client_MANDT, ProfitCenter_PRCTR) 12 | WHERE 13 | h.HierarchyClass_SETCLASS = '0106' 14 | AND h.LanguageKey_SPRAS = 'E' 15 | AND h.IsLeafNode 16 | -------------------------------------------------------------------------------- /ecc/ProfitCenterHierarchiesMD.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | setheadert.MANDT AS Client_MANDT, 3 | setheadert.SETCLASS AS SetClass_SETCLASS, 4 | setheadert.SUBCLASS AS OrganizationalUnit_SUBCLASS, 5 | setheadert.SETNAME AS SetName_SETNAME, 6 | setheadert.LANGU AS LanguageKey_LANGU, 7 | setheadert.DESCRIPT AS ShortDescriptionOfSet_DESCRIPT 8 | FROM 9 | `{{ project_id_src }}.{{ dataset_cdc_processed_ecc }}.setheadert` AS setheadert 10 | WHERE 11 | setclass = '0106' 12 | -------------------------------------------------------------------------------- /ecc/PurchasingGroupsMD.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | t024.MANDT AS Client_MANDT, 3 | t024.EKGRP AS PurchasingGroup_EKGRP, 4 | t024.EKNAM AS PurchasingGroupText_EKNAM 5 | -- t024.EKTEL AS TelephoneNumberPurchasingGroup_EKTEL, 6 | -- t024.LDEST AS Spool_LDEST, 7 | -- t024.TELFX AS FaxNumberPurchasingGroup_TELFX, 8 | -- t024.TEL_NUMBER AS TelephoneNo_TEL_NUMBER, 9 | -- t024.TEL_EXTENS AS TelephoneNoExtension_TEL_EXTENS, 10 | -- t024.SMTP_ADDR AS EMailAddress_SMTP_ADDR 11 | FROM 12 | `{{ project_id_src }}.{{ dataset_cdc_processed_ecc }}.t024` AS t024 13 | -------------------------------------------------------------------------------- /ecc/PurchasingOrganizationsMD.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | t024e.MANDT AS Client_MANDT, 3 | t024e.EKORG AS PurchasingOrganization_EKORG, 4 | t024e.EKOTX AS PurchasingOrganizationText_EKOTX, 5 | t024e.BUKRS AS CompanyCode_BUKRS 6 | -- t024e.TXADR AS SenderLineText_TXADR, 7 | -- t024e.TXKOP AS LetterHeadingText_TXKOP, 8 | -- t024e.TXFUS AS FooterLinesText_TXFUS, 9 | -- t024e.TXGRU AS ComplimentaryCloseText_TXGRU, 10 | -- t024e.KALSE AS GroupCalculationSchema_KALSE, 11 | -- t024e.MKALS AS CalculationSchemaMarketPrice_MKALS, 12 | -- t024e.BPEFF AS EffectivePrice_BPEFF, 13 | -- t024e.BUKRS_NTR AS CompanyCodeSubsequentSettlement_BUKRS_NTR 14 | FROM 15 | `{{ project_id_src }}.{{ dataset_cdc_processed_ecc }}.t024e` AS t024e 16 | -------------------------------------------------------------------------------- /ecc/ReasonForMovementTypesMD.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | t157e.MANDT AS Client_MANDT, 3 | t157e.SPRAS AS LanguageKey_SPRAS, 4 | t157e.BWART AS MovementType_BWART, 5 | t157e.GRUND AS ReasonForMovement_GRUND, 6 | t157e.GRTXT AS ReasonForGoodsMovement_GRTXT 7 | FROM `{{ project_id_src }}.{{ dataset_cdc_processed_ecc }}.t157e` AS t157e 8 | -------------------------------------------------------------------------------- /ecc/RegionsMD.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | T005S.MANDT AS Client_MANDT, 3 | T005S.LAND1 AS CountryKey_LAND1, 4 | T005S.BLAND AS Region_BLAND, 5 | T005S.FPRCD AS ProvincialTaxCode_FPRCD, 6 | T005S.HERBL AS StateOfManufacture_HERBL 7 | FROM 8 | `{{ project_id_src }}.{{ dataset_cdc_processed_ecc }}.t005s` AS T005S 9 | -------------------------------------------------------------------------------- /ecc/Regions_T005S.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | T005S.MANDT AS Client_MANDT, 3 | T005S.LAND1 AS CountryKey_LAND1, 4 | T005S.BLAND AS Region_BLAND, 5 | T005S.FPRCD AS ProvincialTaxCode_FPRCD, 6 | T005S.HERBL AS StateOfManufacture_HERBL 7 | FROM `{{ project_id_src }}.{{ dataset_cdc_processed_ecc }}.t005s` AS T005S 8 | -------------------------------------------------------------------------------- /ecc/SDDocumentFlow.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | SO.mandt AS Client_MANDT, 3 | SO.VBELV AS SalesOrder_VBELV, 4 | SO.POSNV AS SalesItem_POSNV, 5 | Deliveries.VBELV AS DeliveryNumber_VBELV, 6 | Deliveries.POSNV AS DeliveryItem_POSNV, 7 | Deliveries.VBELN AS InvoiceNumber_VBELN, 8 | Deliveries.POSNN AS InvoiceItem_POSNN, 9 | SO.RFMNG AS DeliveredQty_RFMNG, 10 | SO.MEINS AS DeliveredUoM_MEINS, 11 | Deliveries.RFMNG AS InvoiceQty_RFMNG, 12 | Deliveries.MEINS AS InvoiceUoM_MEINS, 13 | Deliveries.RFWRT AS InvoiceValue_RFWRT, 14 | Deliveries.WAERS AS InvoiceCurrency_WAERS 15 | FROM `{{ project_id_src }}.{{ dataset_cdc_processed_ecc }}.vbfa` AS SO 16 | LEFT OUTER JOIN `{{ project_id_src }}.{{ dataset_cdc_processed_ecc }}.vbfa` AS Deliveries 17 | ON SO.VBELN = Deliveries.VBELV AND SO.mandt = Deliveries.mandt 18 | AND SO.POSNN = Deliveries.POSNV 19 | WHERE SO.vbtyp_V = 'C' 20 | AND SO.vbtyp_n IN ('J', 'T') 21 | AND Deliveries.vbtyp_n IN ('M') 22 | ORDER BY SO.VBELV 23 | -------------------------------------------------------------------------------- /ecc/SalesOrganizationsMD.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | TVKO.MANDT AS Client_MANDT, 3 | TVKO.VKORG AS SalesOrg_VKORG, 4 | TVKO.WAERS AS SalesOrgCurrency_WAERS, 5 | TVKO.KUNNR AS SalesOrgCustomer_KUNNR, 6 | TVKO.BUKRS AS CompanyCode_BUKRS, 7 | T001.LAND1 AS Country_LAND1, 8 | T001.WAERS AS CoCoCurrency_WAERS, 9 | T001.PERIV AS FiscalYrVariant_PERIV, 10 | T001.BUTXT AS Company_BUTXT, 11 | TVKOT.VTEXT AS SalesOrgName_VTEXT, 12 | TVKOT.SPRAS AS Language_SPRAS 13 | FROM 14 | `{{ project_id_src }}.{{ dataset_cdc_processed_ecc }}.tvko` AS TVKO 15 | LEFT OUTER JOIN 16 | `{{ project_id_src }}.{{ dataset_cdc_processed_ecc }}.t001` AS T001 17 | ON 18 | TVKO.MANDT = T001.MANDT 19 | AND TVKO.BUKRS = T001.BUKRS 20 | INNER JOIN 21 | `{{ project_id_src }}.{{ dataset_cdc_processed_ecc }}.tvkot` AS TVKOT 22 | ON 23 | TVKO.MANDT = TVKOT.MANDT 24 | AND TVKO.VKORG = TVKOT.VKORG 25 | -------------------------------------------------------------------------------- /ecc/SpecialStocksMD.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | t148t.MANDT AS Client_MANDT, 3 | t148t.SPRAS AS LanguageKey_SPRAS, 4 | t148t.SOBKZ AS SpecialStockIndicator_SOBKZ, 5 | t148t.SOTXT AS DescriptionOfSpecialStock_SOTXT 6 | FROM `{{ project_id_src }}.{{ dataset_cdc_processed_ecc }}.t148t` AS t148t 7 | -------------------------------------------------------------------------------- /ecc/TelephoneCodes_T005K.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | T005K.MANDT AS Client_MANDT, 3 | T005K.LAND1 AS CountryKey_LAND1, 4 | T005K.TELEFFROM AS InternationalDialingCodeForTelephonefax_TELEFFROM, 5 | T005K.TELEFTO AS CountryTelephonefaxDiallingCode_TELEFTO, 6 | T005K.TELEFRM AS DigitToBeDeletedForCallsFromAbroad_TELEFRM, 7 | T005K.TELEXFROM AS ForeignDiallingCodeForTelex_TELEXFROM, 8 | T005K.TELEXTO AS ForeignDiallingCodeForTelex_TELEXTO, 9 | T005K.MOBILE_SMS AS Indicator_MobileTelephonesAreSmsEnabledByDefault_MOBILE_SMS 10 | FROM `{{ project_id_src }}.{{ dataset_cdc_processed_ecc }}.t005k` AS T005K 11 | -------------------------------------------------------------------------------- /ecc/UniversalLedgersMD.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | t881.MANDT AS Client_MANDT, 3 | t881.RLDNR AS Ledger_RLDNR, 4 | t881t.LANGU AS Language_LANGU, 5 | t881t.NAME AS Name_NAME, 6 | t881.TYP AS LedgerType, 7 | t881.APPL AS OwnerApplication_APPL, 8 | t881.SUBAPPL AS SubApplication_SUBAPPL, 9 | t881.XLEADING AS LeadingLedgerIndicator_XLEADING, 10 | t881.VALUTYP AS ValuationView_VALUTYP, 11 | t881.XCASH_LEDGER AS CashLedgerIndicator_XCASH_LEDGER, 12 | t881.GCURR AS Currency_GCURR, 13 | t881.CLASS AS CompanyCurrencyRole_CLASS, 14 | t881.LOGSYS AS LogicalSystem_LOGSYS, 15 | t881.CURT1 AS AddlCurrRole1_CURT1, 16 | t881.CURT2 AS AddlCurrRole2_CURT2, 17 | t881.CURT3 AS AddlCurrRole3_CURT3 18 | FROM 19 | `{{ project_id_src }}.{{ dataset_cdc_processed_ecc }}.t881` AS t881 20 | INNER JOIN 21 | `{{ project_id_src }}.{{ dataset_cdc_processed_ecc }}.t881t` AS t881t 22 | ON 23 | t881.MANDT = t881t.MANDT 24 | AND t881.RLDNR = t881t.RLDNR 25 | -------------------------------------------------------------------------------- /ecc/UoMUsage_SAMPLE.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | Salesfull.MaterialNumber_MATNR, 3 | Salesfull.MaterialText_MAKTX, 4 | Salesfull.DeliveredUoM_MEINS, 5 | Salesfull.DeliveredQty, 6 | conv.val_out AS conv_factor, 7 | if( Salesfull.DeliveredUoM_MEINS IN ('G', 'LB', 'KG'), 'LB', Salesfull.DeliveredUoM_MEINS ) AS to_conv, 8 | ( Salesfull.DeliveredQty * conv.val_out ) AS converted 9 | FROM `{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.SalesFulfillment` AS Salesfull 10 | INNER JOIN `{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.UoMConversionUtil` AS conv 11 | ON Salesfull.Client_MANDT = conv.mandt AND Salesfull.DeliveredUoM_MEINS = conv.unit_from 12 | AND conv.unit_to = if( Salesfull.DeliveredUoM_MEINS IN ('G', 'LB', 'KG'), 'LB', Salesfull.DeliveredUoM_MEINS ) 13 | WHERE Salesfull.DeliveredUoM_MEINS IN ('G', 'KG') 14 | -------------------------------------------------------------------------------- /ecc/VendorConfig.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | MANDT AS Client_MANDT, 3 | NAME AS NameOfVariantVariable_NAME, 4 | -- TYPE AS TypeOfSelection_TYPE, 5 | -- NUMB AS CurrentSelecionNumber_NUMB, 6 | -- SIGN AS ID_I_E_SIGN, 7 | -- OPTI AS SelectionOption_OPTI, 8 | LOW AS LowField_LOW, 9 | HIGH AS HighField_HIGH 10 | -- CLIE_INDEP AS CLIE_INDEP 11 | FROM `{{ project_id_src }}.{{ dataset_cdc_processed_ecc }}.tvarvc` 12 | -------------------------------------------------------------------------------- /is_leap_year.sql: -------------------------------------------------------------------------------- 1 | #-- Copyright 2023 Google LLC 2 | #-- 3 | #-- Licensed under the Apache License, Version 2.0 (the "License"); 4 | #-- you may not use this file except in compliance with the License. 5 | #-- You may obtain a copy of the License at 6 | #-- 7 | #-- https://www.apache.org/licenses/LICENSE-2.0 8 | #-- 9 | #-- Unless required by applicable law or agreed to in writing, software 10 | #-- distributed under the License is distributed on an "AS IS" BASIS, 11 | #-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | #-- See the License for the specific language governing permissions and 13 | #-- limitations under the License. 14 | 15 | CREATE OR REPLACE FUNCTION `{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.is_leap_year` 16 | (year INT64) 17 | RETURNS BOOL 18 | AS ( 19 | (MOD(YEAR, 4) = 0 AND MOD(YEAR, 100) != 0) OR MOD(YEAR, 400) = 0 20 | ) 21 | OPTIONS (description = "The function returns 'True' if the provided year is a leap year, or 'False' otherwise."); 22 | -------------------------------------------------------------------------------- /local_k9/currency_conversion/currency_decimal.sql: -------------------------------------------------------------------------------- 1 | CREATE OR REPLACE TABLE `{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.currency_decimal`AS ( 2 | SELECT DISTINCT 3 | tcurx.CURRKEY, 4 | CAST(POWER(10, 2 - COALESCE(tcurx.CURRDEC, 0)) AS NUMERIC) AS CURRFIX 5 | FROM 6 | `{{ project_id_src }}.{{ dataset_cdc_processed }}.tcurx` AS tcurx ); 7 | -------------------------------------------------------------------------------- /local_k9/financial_statement/financial_statement_initial_load.sql: -------------------------------------------------------------------------------- 1 | --## CORTEX-CUSTOMER: Update the start and end date for initial load as per your requirement 2 | CALL `{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.FinancialStatement` ( 3 | {% if sql_flavour == 'ecc' -%} --noqa:LT02 4 | (SELECT MIN(budat) FROM `{{ project_id_src }}.{{ dataset_cdc_processed }}.bkpf`), 5 | {% else %} 6 | (SELECT MIN(budat) FROM `{{ project_id_src }}.{{ dataset_cdc_processed }}.acdoca`), 7 | {% endif %} 8 | CURRENT_DATE() 9 | ); 10 | -------------------------------------------------------------------------------- /local_k9/financial_statement/financial_statement_periodical_load.templatesql: -------------------------------------------------------------------------------- 1 | --## CORTEX-CUSTOMER: Update the start and end date for periodical load as per your requirement 2 | -- For periodical load, start date is current date - 90 days 3 | CALL `{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.FinancialStatement`( 4 | DATE_TRUNC(DATE_SUB(CURRENT_DATE(), INTERVAL 3 MONTH), MONTH), 5 | CURRENT_DATE()); 6 | -------------------------------------------------------------------------------- /s4/BillingBlockingReasonsMD.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | TVFST.MANDT AS Client_MANDT, 3 | TVFST.SPRAS AS LanguageKey_SPRAS, 4 | TVFST.FAKSP AS Block_FAKSP, 5 | TVFST.VTEXT AS BillingBlockReason_VTEXT, 6 | FROM `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.tvfst` AS TVFST -------------------------------------------------------------------------------- /s4/CostCenterAmountsHierarchy_SAMPLE.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | h.ParentNodeText AS ParentHierarchy, 3 | h.CostCenterNode AS ChildHierarchy, 4 | h.CostCenter_KOSTL, 5 | h.LanguageKey_SPRAS, 6 | h.CostCenterNodeText AS CostCenterDescription, 7 | a.AmountInLocalCurrency_DMBTR, 8 | a.AmountInDocumentCurrency_WRBTR 9 | FROM `{{ project_id_src }}.{{ dataset_reporting_tgt }}.CostCenterHierarchyFlattened` AS h 10 | INNER JOIN `{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.AccountingDocuments` AS a 11 | USING (Client_MANDT, CostCenter_KOSTL) 12 | WHERE 13 | h.HierarchyClass_SETCLASS = '0101' 14 | AND h.IsLeafNode 15 | -------------------------------------------------------------------------------- /s4/CostCenterHierarchiesMD.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | sethanahier0101.MANDT AS Client_MANDT, 3 | sethanahier0101.SETCLASS AS SetClass_SETCLASS, 4 | sethanahier0101.SUBCLASS AS OrganizationalUnit_SUBCLASS, 5 | sethanahier0101.HIERBASE AS SetName_HIERBASE, 6 | sethanahier0101.SUCC AS NodeNumber_SUCC, 7 | sethanahier0101.PRED AS NodeNumber_PRED, 8 | sethanahier0101.HLEVEL AS Level_HLEVEL, 9 | sethanahier0101.SETID AS Identification_SETID, 10 | sethanahier0101.SETNAME AS SetName_SETNAME, 11 | sethanahier0101.VCOUNT AS Counter_VCOUNT, 12 | sethanahier0101.SEARCHFLD AS SearchField_SEARCHFLD, 13 | sethanahier0101.OLD_LINE AS LineCounter_OLD_LINE, 14 | sethanahier0101.VALUE_FROM AS FromValue_VALUE_FROM, 15 | sethanahier0101.VALUE_TO AS ToValue_VALUE_TO, 16 | sethanahier0101.OBJNR AS ObjectNumber_OBJNR 17 | FROM 18 | `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.sethanahier0101` AS sethanahier0101 19 | -------------------------------------------------------------------------------- /s4/CurrenciesMD.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | tcurc.mandt AS Client_MANDT, tcurc.waers AS CurrencyCode_WAERS, tcurc.isocd AS CurrencyISO_ISOCD, 3 | tcurx.currdec AS CurrencyDecimals_CURRDEC, tcurt.spras AS Language, 4 | tcurt.ktext AS CurrShortText_KTEXT, tcurt.ltext AS CurrLongText_LTEXT 5 | FROM `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.tcurc` AS tcurc 6 | INNER JOIN 7 | `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.tcurx` AS tcurx ON tcurc.waers = tcurx.currkey 8 | INNER JOIN 9 | `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.tcurt`AS tcurt 10 | ON tcurc.waers = tcurt.waers AND tcurc.mandt = tcurt.mandt 11 | -------------------------------------------------------------------------------- /s4/DeliveryBlockingReasonsMD.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | TVLST.MANDT AS Client_MANDT, 3 | TVLST.SPRAS AS LanguageKey_SPRAS, 4 | TVLST.LIFSP AS DefaultDeliveryBlock_LIFSP, 5 | TVLST.VTEXT AS DeliveryBlockReason_VTEXT, 6 | FROM `{{ project_id_src }}.{{ dataset_cdc_processed_s4}}.tvlst` AS TVLST -------------------------------------------------------------------------------- /s4/DistributionChannelsMD.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | TVTW.MANDT AS Client_MANDT, 3 | TVTW.VTWEG AS DistributionChannel_VTWEG, 4 | TVTWT.SPRAS AS Language_SPRAS, 5 | TVTWT.VTEXT AS DistributionChannelName_VTEXT 6 | FROM 7 | `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.tvtw` AS TVTW 8 | INNER JOIN 9 | `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.tvtwt` AS TVTWT 10 | ON 11 | TVTW.MANDT = TVTWT.MANDT 12 | AND TVTW.VTWEG = TVTWT.VTWEG 13 | -------------------------------------------------------------------------------- /s4/DivisionsMD.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | TSPA.mandt AS Client_MANDT, 3 | TSPA.spart AS Division_SPART, 4 | TSPAT.spras AS LanguageKey_SPRAS, 5 | TSPAT.vtext AS DivisionName_VTEXT 6 | FROM 7 | `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.tspa` AS TSPA 8 | LEFT JOIN 9 | `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.tspat` AS TSPAT 10 | ON 11 | TSPA.MANDT = TSPAT.MANDT 12 | AND TSPA.SPART = TSPAT.SPART 13 | -------------------------------------------------------------------------------- /s4/FSVTextsMD.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | hrrp_nodet.MANDT AS Client_MANDT, 3 | hrrp_nodet.HRYID AS HierarchyID_HRYID, 4 | hrrp_nodet.HRYVER AS HierarchyVersion_HRYVER, 5 | hrrp_nodet.SPRAS AS LanguageKey_SPRAS, 6 | hrrp_nodet.NODECLS AS NodeClass_NODECLS, 7 | hrrp_nodet.HRYNODE AS HierarchyNode_HRYNODE, 8 | hrrp_nodet.PARNODE AS HierarchyParentNode_PARNODE, 9 | hrrp_nodet.HRYVALTO AS ValidTo_HRYVALTO, 10 | hrrp_nodet.HRYVALFROM AS ValidFrom_HRYVALFROM, 11 | hrrp_nodet.NODETXT AS HierarchyNodeDescription_NODETXT 12 | FROM 13 | `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.hrrp_nodet` AS hrrp_nodet 14 | -------------------------------------------------------------------------------- /s4/Languages_T002.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | T002.SPRAS AS LanguageKey_SPRAS, 3 | T002.LASPEZ AS LanguageSpecifications_LASPEZ, 4 | T002.LAHQ AS DegreeOfTranslationOfLanguage_LAHQ, 5 | T002.LAISO AS TwoCharacterSapLanguageCode_LAISO 6 | FROM `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.t002` AS T002 7 | -------------------------------------------------------------------------------- /s4/LedgersMD.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | t881.mandt AS Client_MANDT, 3 | t881.rldnr AS Ledger_RLDNR, 4 | t881.gcurr AS Currency_GCURR, 5 | t881.class AS CompanyCurrencyRole_CLASS, 6 | t881.logsys AS LogicalSystem_LOGSYS, 7 | t881.valutyp AS ControllingValuationType_VALUTYP, 8 | t881.xleading AS LeadingLedgerFlag_XLEADING, 9 | t881.appl AS LedgerApplication_APPL, 10 | t881.subappl AS LedgerSubapplication_SUBAPPL, 11 | t881.curt1 AS AddlCurrRole1_CURT1, 12 | t881.curt2 AS AddlCurrRole2_CURT2, 13 | t881.curt3 AS AddlCurrRole3_CURT3, 14 | t881t.langu AS Language_LANGU, 15 | t881t.name AS Name 16 | FROM `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.t881` AS t881 17 | INNER JOIN `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.t881t` AS t881t 18 | ON t881.rldnr = t881t.rldnr AND t881.mandt = t881t.mandt 19 | -------------------------------------------------------------------------------- /s4/MaterialGroupsMD.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | t023.MANDT AS Client_MANDT, 3 | t023.MATKL AS MaterialGroup_MATKL, 4 | t023.SPART AS Division_SPART, 5 | t023.WWGDA AS ReferenceGroupRefMaterial_WWGDA, 6 | t023.WWGPA AS GroupMaterial_WWGPA, 7 | t023.ABTNR AS DepartmentNumber_ABTNR, 8 | t023.BEGRU AS AuthorizationGroup_BEGRU, 9 | t023.GEWEI AS DefaultUnitofWeight_GEWEI, 10 | t023.BKLAS AS ValuationClass_BKLAS, 11 | t023.EKWSL AS PurchasingValueKey_EKWSL, 12 | t023.ANLKL AS AssetClass_ANLKL, 13 | t023.PRICE_GROUP AS PriceLevelGroup_PRICE_GROUP, 14 | t023t.wgbez AS MaterialGroupName_WGBEZ, 15 | t023t.spras AS Language_SPRAS 16 | FROM `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.t023` AS t023 17 | INNER JOIN `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.t023t` AS t023t 18 | ON t023.MANDT = t023t.MANDT 19 | AND t023.MATKL = t023t.MATKL 20 | -------------------------------------------------------------------------------- /s4/MaterialMovementTypesMD.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | t156t.MANDT AS Client_MANDT, 3 | t156t.SPRAS AS LanguageKey_SPRAS, 4 | t156t.BWART AS MovementType_BWART, 5 | t156t.SOBKZ AS SpecialStock_SOBKZ, 6 | t156t.KZBEW AS MovementIndicator_KZBEW, 7 | t156t.KZZUG AS ReceiptIndicator_KZZUG, 8 | t156t.KZVBR AS ConsumptionPosting_KZVBR, 9 | t156t.BTEXT AS MovementTypeText_BTEXT 10 | FROM `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.t156t` AS t156t 11 | -------------------------------------------------------------------------------- /s4/ProductHierarchiesMD.sql: -------------------------------------------------------------------------------- 1 | SELECT t179.mandt AS Client_MANDT, 2 | t179.prodh AS Hierarchy_PRODH, 3 | t179.stufe AS Level_STUFE, 4 | t179t.spras AS Language_SPRAS, 5 | t179t.vtext AS Description_VTEXT 6 | FROM `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.t179` AS t179 7 | INNER JOIN `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.t179t` AS t179t 8 | ON t179.mandt = t179t.mandt AND t179.prodh = t179t.prodh 9 | -------------------------------------------------------------------------------- /s4/ProductHierarchy_Flatten.sql: -------------------------------------------------------------------------------- 1 | (WITH h1_h2 AS ( 2 | SELECT h1.prodh AS prodh1, h2.prodh AS prodh2 3 | FROM `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.t179` AS h1 4 | LEFT OUTER JOIN `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.t179` AS h2 5 | ON starts_with(h2.prodh, h1.prodh) 6 | WHERE h1.stufe = '1' 7 | AND h2.stufe = '2' 8 | ) 9 | SELECT h1_h2.prodh1 AS prodh1, 10 | h1_h2.prodh2 AS prodh2, 11 | h3.prodh AS prodh3 12 | FROM h1_h2 AS h1_h2 13 | LEFT OUTER JOIN `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.t179` AS h3 14 | ON starts_with(h3.prodh, h1_h2.prodh2) 15 | WHERE h3.stufe = '3' 16 | ) 17 | -------------------------------------------------------------------------------- /s4/ProfitCenterAmountsHierarchy_SAMPLE.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | h.ParentNodeText AS ParentHierarchy, 3 | h.ProfitCenterNode AS ChildHierarchy, 4 | h.ProfitCenter_PRCTR, 5 | h.LanguageKey_SPRAS, 6 | h.ProfitCenterNodeText AS ProfitCenterDescription, 7 | a.AmountInLocalCurrency_DMBTR, 8 | a.AmountInDocumentCurrency_WRBTR 9 | FROM `{{ project_id_src }}.{{ dataset_reporting_tgt }}.ProfitCenterHierarchyFlattened` AS h 10 | INNER JOIN `{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.AccountingDocuments` AS a 11 | USING (Client_MANDT, ProfitCenter_PRCTR) 12 | WHERE 13 | h.HierarchyClass_SETCLASS = '0106' 14 | AND h.LanguageKey_SPRAS = 'E' 15 | AND h.IsLeafNode 16 | -------------------------------------------------------------------------------- /s4/ProfitCenterHierarchiesMD.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | sethanahier0106.MANDT AS Client_MANDT, 3 | sethanahier0106.SETCLASS AS SetClass_SETCLASS, 4 | sethanahier0106.SUBCLASS AS OrganizationalUnit_SUBCLASS, 5 | sethanahier0106.HIERBASE AS SetName_HIERBASE, 6 | sethanahier0106.SUCC AS NodeNumber_SUCC, 7 | sethanahier0106.PRED AS NodeNumber_PRED, 8 | sethanahier0106.HLEVEL AS Level_HLEVEL, 9 | sethanahier0106.SETID AS Identification_SETID, 10 | sethanahier0106.SETNAME AS SetName_SETNAME, 11 | sethanahier0106.VCOUNT AS Counter_VCOUNT, 12 | sethanahier0106.SEARCHFLD AS SearchField_SEARCHFLD, 13 | sethanahier0106.OLD_LINE AS LineCounter_OLD_LINE, 14 | sethanahier0106.VALUE_FROM AS FromValue_VALUE_FROM, 15 | sethanahier0106.VALUE_TO AS ToValue_VALUE_TO 16 | FROM 17 | `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.sethanahier0106` AS sethanahier0106 18 | -------------------------------------------------------------------------------- /s4/PurchasingGroupsMD.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | t024.MANDT AS Client_MANDT, 3 | t024.EKGRP AS PurchasingGroup_EKGRP, 4 | t024.EKNAM AS PurchasingGroupText_EKNAM 5 | -- t024.EKTEL AS TelephoneNumberPurchasingGroup_EKTEL, 6 | -- t024.LDEST AS Spool_LDEST, 7 | -- t024.TELFX AS FaxNumberPurchasingGroup_TELFX, 8 | -- t024.TEL_NUMBER AS TelephoneNo_TEL_NUMBER, 9 | -- t024.TEL_EXTENS AS TelephoneNoExtension_TEL_EXTENS, 10 | -- t024.SMTP_ADDR AS EMailAddress_SMTP_ADDR 11 | FROM 12 | `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.t024` AS t024 13 | -------------------------------------------------------------------------------- /s4/PurchasingOrganizationsMD.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | t024e.MANDT AS Client_MANDT, 3 | t024e.EKORG AS PurchasingOrganization_EKORG, 4 | t024e.EKOTX AS PurchasingOrganizationText_EKOTX, 5 | t024e.BUKRS AS CompanyCode_BUKRS 6 | -- t024e.TXADR AS SenderLineText_TXADR, 7 | -- t024e.TXKOP AS LetterHeadingText_TXKOP, 8 | -- t024e.TXFUS AS FooterLinesText_TXFUS, 9 | -- t024e.TXGRU AS ComplimentaryCloseText_TXGRU, 10 | -- t024e.KALSE AS GroupCalculationSchema_KALSE, 11 | -- t024e.MKALS AS CalculationSchemaMarketPrice_MKALS, 12 | -- t024e.BPEFF AS EffectivePrice_BPEFF, 13 | -- t024e.BUKRS_NTR AS CompanyCodeSubsequentSettlement_BUKRS_NTR 14 | FROM 15 | `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.t024e` AS t024e 16 | -------------------------------------------------------------------------------- /s4/ReasonForMovementTypesMD.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | t157e.MANDT AS Client_MANDT, 3 | t157e.SPRAS AS LanguageKey_SPRAS, 4 | t157e.BWART AS MovementType_BWART, 5 | t157e.GRUND AS ReasonForMovement_GRUND, 6 | t157e.GRTXT AS ReasonForGoodsMovement_GRTXT 7 | FROM `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.t157e` AS t157e 8 | -------------------------------------------------------------------------------- /s4/RegionsMD.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | T005S.MANDT AS Client_MANDT, 3 | T005S.LAND1 AS CountryKey_LAND1, 4 | T005S.BLAND AS Region_BLAND, 5 | T005S.FPRCD AS ProvincialTaxCode_FPRCD, 6 | T005S.HERBL AS StateOfManufacture_HERBL 7 | FROM 8 | `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.t005s` AS T005S 9 | 10 | -------------------------------------------------------------------------------- /s4/Regions_T005S.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | T005S.MANDT AS Client_MANDT, 3 | T005S.LAND1 AS CountryKey_LAND1, 4 | T005S.BLAND AS Region_BLAND, 5 | T005S.FPRCD AS ProvincialTaxCode_FPRCD, 6 | T005S.HERBL AS StateOfManufacture_HERBL 7 | FROM `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.t005s` AS T005S 8 | -------------------------------------------------------------------------------- /s4/SDDocumentFlow.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | SO.mandt AS Client_MANDT, 3 | SO.VBELV AS SalesOrder_VBELV, 4 | SO.POSNV AS SalesItem_POSNV, 5 | Deliveries.VBELV AS DeliveryNumber_VBELV, 6 | Deliveries.POSNV AS DeliveryItem_POSNV, 7 | Deliveries.VBELN AS InvoiceNumber_VBELN, 8 | Deliveries.POSNN AS InvoiceItem_POSNN, 9 | SO.RFMNG AS DeliveredQty_RFMNG, 10 | SO.MEINS AS DeliveredUoM_MEINS, 11 | Deliveries.RFMNG AS InvoiceQty_RFMNG, 12 | Deliveries.MEINS AS InvoiceUoM_MEINS, 13 | Deliveries.RFWRT AS InvoiceValue_RFWRT, 14 | Deliveries.WAERS AS InvoiceCurrency_WAERS 15 | FROM `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.vbfa` AS SO 16 | LEFT OUTER JOIN `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.vbfa` AS Deliveries 17 | ON SO.VBELN = Deliveries.VBELV AND SO.mandt = Deliveries.mandt 18 | AND SO.POSNN = Deliveries.POSNV 19 | WHERE SO.vbtyp_V = 'C' 20 | AND SO.vbtyp_n IN ('J', 'T') 21 | AND Deliveries.vbtyp_n IN ('M') 22 | ORDER BY SO.VBELV 23 | -------------------------------------------------------------------------------- /s4/SalesOrganizationsMD.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | TVKO.MANDT AS Client_MANDT, 3 | TVKO.VKORG AS SalesOrg_VKORG, 4 | TVKO.WAERS AS SalesOrgCurrency_WAERS, 5 | TVKO.KUNNR AS SalesOrgCustomer_KUNNR, 6 | TVKO.BUKRS AS CompanyCode_BUKRS, 7 | T001.LAND1 AS Country_LAND1, 8 | T001.WAERS AS CoCoCurrency_WAERS, 9 | T001.PERIV AS FiscalYrVariant_PERIV, 10 | T001.BUTXT AS Company_BUTXT, 11 | TVKOT.VTEXT AS SalesOrgName_VTEXT, 12 | TVKOT.SPRAS AS Language_SPRAS 13 | FROM 14 | `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.tvko` AS TVKO 15 | LEFT OUTER JOIN 16 | `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.t001` AS T001 17 | ON 18 | TVKO.MANDT = T001.MANDT 19 | AND TVKO.BUKRS = T001.BUKRS 20 | INNER JOIN 21 | `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.tvkot` AS TVKOT 22 | ON 23 | TVKO.MANDT = TVKOT.MANDT 24 | AND TVKO.VKORG = TVKOT.VKORG 25 | -------------------------------------------------------------------------------- /s4/SpecialStocksMD.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | t148t.MANDT AS Client_MANDT, 3 | t148t.SPRAS AS LanguageKey_SPRAS, 4 | t148t.SOBKZ AS SpecialStockIndicator_SOBKZ, 5 | t148t.SOTXT AS DescriptionOfSpecialStock_SOTXT 6 | FROM `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.t148t` AS t148t 7 | -------------------------------------------------------------------------------- /s4/TelephoneCodes_T005K.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | T005K.MANDT AS Client_MANDT, 3 | T005K.LAND1 AS CountryKey_LAND1, 4 | T005K.TELEFFROM AS InternationalDialingCodeForTelephonefax_TELEFFROM, 5 | T005K.TELEFTO AS CountryTelephonefaxDiallingCode_TELEFTO, 6 | T005K.TELEFRM AS DigitToBeDeletedForCallsFromAbroad_TELEFRM, 7 | T005K.TELEXFROM AS ForeignDiallingCodeForTelex_TELEXFROM, 8 | T005K.TELEXTO AS ForeignDiallingCodeForTelex_TELEXTO, 9 | T005K.MOBILE_SMS AS Indicator_MobileTelephonesAreSmsEnabledByDefault_MOBILE_SMS 10 | FROM `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.t005k` AS T005K 11 | -------------------------------------------------------------------------------- /s4/UoMUsage_SAMPLE.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | Salesfull.MaterialNumber_MATNR, 3 | Salesfull.MaterialText_MAKTX, 4 | Salesfull.DeliveredUoM_MEINS, 5 | Salesfull.DeliveredQty, 6 | conv.val_out AS conv_factor, 7 | if( Salesfull.DeliveredUoM_MEINS IN ('G', 'LB', 'KG'), 'LB', Salesfull.DeliveredUoM_MEINS ) AS to_conv, 8 | ( Salesfull.DeliveredQty * conv.val_out ) AS converted 9 | FROM `{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.SalesFulfillment` AS Salesfull 10 | INNER JOIN `{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.UoMConversionUtil` AS conv 11 | ON Salesfull.Client_MANDT = conv.mandt AND Salesfull.DeliveredUoM_MEINS = conv.unit_from 12 | AND conv.unit_to = if( Salesfull.DeliveredUoM_MEINS IN ('G', 'LB', 'KG'), 'LB', Salesfull.DeliveredUoM_MEINS ) 13 | WHERE Salesfull.DeliveredUoM_MEINS IN ('G', 'KG') 14 | -------------------------------------------------------------------------------- /s4/VendorConfig.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | MANDT AS Client_MANDT, 3 | NAME AS NameOfVariantVariable_NAME, 4 | -- TYPE AS TypeOfSelection_TYPE, 5 | -- NUMB AS CurrentSelecionNumber_NUMB, 6 | -- SIGN AS ID_I_E_SIGN, 7 | -- OPTI AS SelectionOption_OPTI, 8 | LOW AS LowField_LOW, 9 | HIGH AS HighField_HIGH 10 | -- CLIE_INDEP AS CLIE_INDEP 11 | FROM `{{ project_id_src }}.{{ dataset_cdc_processed_s4 }}.tvarvc` 12 | --------------------------------------------------------------------------------