├── MonthGenericValueHelp ├── readme.txt ├── Z_MONTH_F4_DEMO_TOP.abap ├── Z_MONTH_F4_DEMO.abap ├── Z_MONTH_F4_DEMO_APPL.abap └── Z_MONTH_F4.abap ├── AutomationOfRDASchedulingAndMonitoring ├── Z_EXCEPTION.zip ├── readme.txt ├── Z_RDA_DAEMON_TOP.abap ├── Z_RDA_DAEMON_START.abap ├── Z_RDA_DAEMON_STOP.abap └── Z_RDA_DAEMON_MONITOR.abap ├── ABAPCDSConsumptionViewFeaturesUltimateTest ├── Readme.txt ├── zsapbc_region_text3.abap ├── zsapbc_region_dimension.abap ├── zsapbc_region_dimension3.abap ├── zsapbc_curr_date.abap ├── zsapbc_carr_text.abap ├── zsapbc_curr_year_add_n.abap ├── zsapbc_carr_dimension.abap ├── zsapbc_flight_tabl_func.abap ├── zsapbc_region_hierarchy.abap ├── zsapbc_region_hierarchy3.abap ├── zsapbc_carr.abap ├── zsapbc_region.abap ├── zcl_sapbc_flight_tabl_func.abap ├── zsapbc_flight_fact.abap ├── zsapbc_flight_fact4.abap ├── zsapbc_region3.abap ├── zsapbc_flight_query.abap ├── zsapbc_flight_cube5.abap ├── zsapbc_flight_query5.abap ├── zsapbc_flight_query2.abap ├── zsapbc_flight_query3.abap ├── zsapbc_flight_query4.abap ├── zsapbc_flight_cube3.abap ├── zsapbc_flight_cube.abap └── zsapbc_flight_cube4.abap ├── EmbeddedAnalyticsDateFunction ├── ZDATE_RANGE │ ├── ZDATE_RANGE - Domain.JPG │ ├── ZDATE_RANGE - Data Element.JPG │ ├── CONVERSION_EXIT_ZDTRG_INPUT.txt │ └── CONVERSION_EXIT_ZDTRG_OUTPUT.txt ├── ZCDFLDVALN ZCDFLDVALO │ ├── ZFIELDVAL - Domain.JPG │ ├── ZCDFLDVALN - Data Element.JPG │ ├── ZCDFLDVALO - Data Element.JPG │ ├── CONVERSION_EXIT_ZVAL_INPUT.txt │ └── CONVERSION_EXIT_ZVAL_OUTPUT.txt ├── ZI_ConditionUsageText.txt ├── ZI_TransactionCodeText.txt ├── ZI_ConditionApplicationText.txt ├── ZI_ConditionUsage.txt ├── ZI_DateFunction.txt ├── ZI_ConditionApplication.txt ├── ZI_TransactionCode.txt ├── ZI_ChangeTypeText.txt ├── ZI_ConditionTypeText.txt ├── ZI_ChangeType.txt ├── ZI_TableName.txt ├── ZI_TableNameText.txt ├── ZI_FieldNameText.txt ├── ZI_FieldName.txt ├── ZI_ConditionType.txt ├── ZCONDITION_TABLE_FIELDS.abap ├── ZI_PriceChangeCube.txt └── ZC_PriceChangeQuery.txt ├── AddValuetoYourS4HANAEmbeddedAnalyticsContentwithMaterialHierarchy ├── I_Material Dimension.jpg ├── I_ProductHierarchyNode.jpg ├── z_t179.txt ├── ZI_Material.txt ├── ZI_MaterialHier.txt ├── ZX_Material.txt ├── I_ProductHierarchyNode.txt ├── I_Material.txt └── ZI_ProductHierarchyNodeHier.txt ├── FilteringByShortMaterialProductHierarchyDimensionKeysWithABAPCDSViews ├── ZPRODUCTCLASSDomain.PNG ├── ZPRODUCTFAMILYDomain.PNG ├── ZPRODUCTCLASSDataElement.PNG ├── ZPRODUCTSUBCLASSDomain.PNG ├── ZPRODUCTFAMILYDataElement.PNG ├── ZPRODUCTCATEGORYDataElement.PNG ├── ZPRODUCTSUBCLASSDataElement.PNG ├── CONVERSION_EXIT_ZPH3_INPUT.abap ├── CONVERSION_EXIT_ZPH4_INPUT.abap ├── CONVERSION_EXIT_ZPH2_INPUT.abap ├── CONVERSION_EXIT_ZPH3_OUTPUT.abap ├── CONVERSION_EXIT_ZPH4_OUTPUT.abap ├── CONVERSION_EXIT_ZPH2_OUTPUT.abap ├── ZI_ProductClass.abap ├── ZI_ProductFamily.abap ├── ZI_ProductCategory.abap ├── ZI_ProductSubclass.abap ├── ZI_ProductFamilyText.abap ├── ZI_ProductClassText.abap ├── ZI_ProductCategoryText.abap ├── ZI_ProductSubclassText.abap └── ZX_Material.abap ├── ReportingS4HANADeliveryDataOnSalesOrderScheduleLine ├── ZI_DEMO.abap └── ZCL_DEMO.abap ├── DateToFactoryDateConversionWithS4HANAABAPCDSView ├── ZI_FactoryCalendar.abap └── zcl_factory_calendar.abap ├── S4HANAEmbeddedAnalyticsSpendReporting ├── ZI_Reference3IDByBusPartner.abap ├── ZI_PurchaseType.abap ├── ZI_PurchaseProcess.abap ├── ZI_SpendExceptionJournalEntry1.abap ├── ZI_SpendExceptionJournalEntry2.abap ├── ZI_SpendJournalEntry2.abap ├── ZI_SpendJournalEntry1.abap ├── ZI_PurchaseProcessDocumentType.abap ├── ZCL_RSROA_VARIABLES_EXIT.txt ├── ZI_SpendExceptionFact.abap ├── ZCL_Reference3IDByBusPartner.abap └── ZI_SpendExceptionCube.abap ├── S4HANAEmbeddedAnalyticsInventoryAgingReport ├── ZI_StockType.abap ├── ZI_InventoryAgingFunc.abap ├── ZI_AgingRange.abap ├── ZI_InventoryAgingCube.abap └── ZCL_RSROA_VARIABLES_EXIT.abap ├── CreationOfCompoundedDimensionsWithABAPCDSViews ├── ZI_TableName.abap ├── ZI_TableNameText.abap ├── ZI_FieldNameText.abap └── ZI_FieldName.abap ├── MB5LTransactionCDSViewEquivalent ├── ZP_CompanyCodeGLAccount.txt ├── ZI_CurrentMatlPriceByCostEst.txt ├── ZP_CurrentMatlPriceByCostEst1.txt ├── ZP_MatStkQtyValCur3.txt ├── ZP_MatStkQtyValCur2.txt ├── ZP_MatStkQtyValCur1.txt ├── ZP_CurrentMatlPriceByCostEst2.txt ├── ZC_StockQuantityCurrentValue.txt └── ZI_MaterialStock.txt ├── DisplayShortMaterialProductHierarchyLevelKeysWithABAPCDSViews └── CONVERSION_EXIT_ZPH_OUTPUT.abap ├── AddMultipleT179MaterialProductHierarchiestoS4HANAEmbeddedAnalyticsContent ├── ZI_MaterialHierDir.txt ├── ZI_MaterialHier.txt └── ZI_Material.txt ├── S4HANAEmbeddedAnalyticsInventoryAgingTrendReport └── ZI_InventoryAgingFunc.abap └── AdvancedExceptionAggregationwithABAPCDSView ├── ZI_ExceptionAggregationCube.abap └── ZC_ExceptionAggregationQuery.abap /MonthGenericValueHelp/readme.txt: -------------------------------------------------------------------------------- 1 | Visit following page for more information: 2 | https://blogs.sap.com/2017/02/10/generic-month-value-help/ -------------------------------------------------------------------------------- /AutomationOfRDASchedulingAndMonitoring/Z_EXCEPTION.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UladzislauPralat/ABAP/HEAD/AutomationOfRDASchedulingAndMonitoring/Z_EXCEPTION.zip -------------------------------------------------------------------------------- /AutomationOfRDASchedulingAndMonitoring/readme.txt: -------------------------------------------------------------------------------- 1 | Visit following page for more information: 2 | https://blogs.sap.com/2016/02/13/automation-of-rda-scheduling-and-monitoring/ -------------------------------------------------------------------------------- /ABAPCDSConsumptionViewFeaturesUltimateTest/Readme.txt: -------------------------------------------------------------------------------- 1 | Visit following page to learn more: 2 | https://blogs.sap.com/2017/03/23/abap-cds-consumption-view-features-ultimate-test/ -------------------------------------------------------------------------------- /ABAPCDSConsumptionViewFeaturesUltimateTest/zsapbc_region_text3.abap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UladzislauPralat/ABAP/HEAD/ABAPCDSConsumptionViewFeaturesUltimateTest/zsapbc_region_text3.abap -------------------------------------------------------------------------------- /EmbeddedAnalyticsDateFunction/ZDATE_RANGE/ZDATE_RANGE - Domain.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UladzislauPralat/ABAP/HEAD/EmbeddedAnalyticsDateFunction/ZDATE_RANGE/ZDATE_RANGE - Domain.JPG -------------------------------------------------------------------------------- /ABAPCDSConsumptionViewFeaturesUltimateTest/zsapbc_region_dimension.abap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UladzislauPralat/ABAP/HEAD/ABAPCDSConsumptionViewFeaturesUltimateTest/zsapbc_region_dimension.abap -------------------------------------------------------------------------------- /ABAPCDSConsumptionViewFeaturesUltimateTest/zsapbc_region_dimension3.abap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UladzislauPralat/ABAP/HEAD/ABAPCDSConsumptionViewFeaturesUltimateTest/zsapbc_region_dimension3.abap -------------------------------------------------------------------------------- /EmbeddedAnalyticsDateFunction/ZDATE_RANGE/ZDATE_RANGE - Data Element.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UladzislauPralat/ABAP/HEAD/EmbeddedAnalyticsDateFunction/ZDATE_RANGE/ZDATE_RANGE - Data Element.JPG -------------------------------------------------------------------------------- /EmbeddedAnalyticsDateFunction/ZCDFLDVALN ZCDFLDVALO/ZFIELDVAL - Domain.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UladzislauPralat/ABAP/HEAD/EmbeddedAnalyticsDateFunction/ZCDFLDVALN ZCDFLDVALO/ZFIELDVAL - Domain.JPG -------------------------------------------------------------------------------- /EmbeddedAnalyticsDateFunction/ZCDFLDVALN ZCDFLDVALO/ZCDFLDVALN - Data Element.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UladzislauPralat/ABAP/HEAD/EmbeddedAnalyticsDateFunction/ZCDFLDVALN ZCDFLDVALO/ZCDFLDVALN - Data Element.JPG -------------------------------------------------------------------------------- /EmbeddedAnalyticsDateFunction/ZCDFLDVALN ZCDFLDVALO/ZCDFLDVALO - Data Element.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UladzislauPralat/ABAP/HEAD/EmbeddedAnalyticsDateFunction/ZCDFLDVALN ZCDFLDVALO/ZCDFLDVALO - Data Element.JPG -------------------------------------------------------------------------------- /AddValuetoYourS4HANAEmbeddedAnalyticsContentwithMaterialHierarchy/I_Material Dimension.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UladzislauPralat/ABAP/HEAD/AddValuetoYourS4HANAEmbeddedAnalyticsContentwithMaterialHierarchy/I_Material Dimension.jpg -------------------------------------------------------------------------------- /AddValuetoYourS4HANAEmbeddedAnalyticsContentwithMaterialHierarchy/I_ProductHierarchyNode.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UladzislauPralat/ABAP/HEAD/AddValuetoYourS4HANAEmbeddedAnalyticsContentwithMaterialHierarchy/I_ProductHierarchyNode.jpg -------------------------------------------------------------------------------- /FilteringByShortMaterialProductHierarchyDimensionKeysWithABAPCDSViews/ZPRODUCTCLASSDomain.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UladzislauPralat/ABAP/HEAD/FilteringByShortMaterialProductHierarchyDimensionKeysWithABAPCDSViews/ZPRODUCTCLASSDomain.PNG -------------------------------------------------------------------------------- /FilteringByShortMaterialProductHierarchyDimensionKeysWithABAPCDSViews/ZPRODUCTFAMILYDomain.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UladzislauPralat/ABAP/HEAD/FilteringByShortMaterialProductHierarchyDimensionKeysWithABAPCDSViews/ZPRODUCTFAMILYDomain.PNG -------------------------------------------------------------------------------- /FilteringByShortMaterialProductHierarchyDimensionKeysWithABAPCDSViews/ZPRODUCTCLASSDataElement.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UladzislauPralat/ABAP/HEAD/FilteringByShortMaterialProductHierarchyDimensionKeysWithABAPCDSViews/ZPRODUCTCLASSDataElement.PNG -------------------------------------------------------------------------------- /FilteringByShortMaterialProductHierarchyDimensionKeysWithABAPCDSViews/ZPRODUCTSUBCLASSDomain.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UladzislauPralat/ABAP/HEAD/FilteringByShortMaterialProductHierarchyDimensionKeysWithABAPCDSViews/ZPRODUCTSUBCLASSDomain.PNG -------------------------------------------------------------------------------- /FilteringByShortMaterialProductHierarchyDimensionKeysWithABAPCDSViews/ZPRODUCTFAMILYDataElement.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UladzislauPralat/ABAP/HEAD/FilteringByShortMaterialProductHierarchyDimensionKeysWithABAPCDSViews/ZPRODUCTFAMILYDataElement.PNG -------------------------------------------------------------------------------- /FilteringByShortMaterialProductHierarchyDimensionKeysWithABAPCDSViews/ZPRODUCTCATEGORYDataElement.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UladzislauPralat/ABAP/HEAD/FilteringByShortMaterialProductHierarchyDimensionKeysWithABAPCDSViews/ZPRODUCTCATEGORYDataElement.PNG -------------------------------------------------------------------------------- /FilteringByShortMaterialProductHierarchyDimensionKeysWithABAPCDSViews/ZPRODUCTSUBCLASSDataElement.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UladzislauPralat/ABAP/HEAD/FilteringByShortMaterialProductHierarchyDimensionKeysWithABAPCDSViews/ZPRODUCTSUBCLASSDataElement.PNG -------------------------------------------------------------------------------- /ABAPCDSConsumptionViewFeaturesUltimateTest/zsapbc_curr_date.abap: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZCURR_DATE' 2 | define view zsapbc_curr_date as select from tadir 3 | { 4 | $session.system_date as system_date 5 | } 6 | where obj_name = 'ZSAPBC_CURR_DATE' 7 | and object = 'DDLS' -------------------------------------------------------------------------------- /AddValuetoYourS4HANAEmbeddedAnalyticsContentwithMaterialHierarchy/z_t179.txt: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZT179' 2 | @VDM.viewType: #BASIC 3 | @EndUserText.label: 'Product Hierarchy' 4 | define view z_t179 as select from t179 { 5 | key prodh, 6 | left(prodh,2) as prodh1, 7 | left(prodh,5) as prodh2, 8 | left(prodh,8) as prodh3, 9 | left(prodh,13) as prodh4, 10 | stufe 11 | } -------------------------------------------------------------------------------- /ABAPCDSConsumptionViewFeaturesUltimateTest/zsapbc_carr_text.abap: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZCARR_TEXT' 2 | @Analytics: {dataCategory: #TEXT, dataExtraction.enabled: true} 3 | @AccessControl.authorizationCheck: #NOT_ALLOWED 4 | @EndUserText.label: 'Flight - Carrier Text' 5 | define view zsapbc_carr_text as select from scarr { 6 | key carrid, 7 | @Semantics.text: true 8 | carrname as CarrierName 9 | } -------------------------------------------------------------------------------- /ReportingS4HANADeliveryDataOnSalesOrderScheduleLine/ZI_DEMO.abap: -------------------------------------------------------------------------------- 1 | @EndUserText.label: 'Demo' 2 | define table function zi_demo 3 | returns 4 | { 5 | mandt: abap.clnt; 6 | vbeln: vbeln_va; 7 | posnr: posnr_va; 8 | etenr: etenr; 9 | matnr: matnr; 10 | wmeng: wmeng; 11 | bmeng: bmeng; 12 | bmeng_rt: bmeng; 13 | lfimg: lfimg; 14 | lfimg_t: lfimg; 15 | } 16 | implemented by method 17 | zcl_demo=>function; -------------------------------------------------------------------------------- /EmbeddedAnalyticsDateFunction/ZDATE_RANGE/CONVERSION_EXIT_ZDTRG_INPUT.txt: -------------------------------------------------------------------------------- 1 | FUNCTION conversion_exit_zdtrg_input. 2 | *"---------------------------------------------------------------------- 3 | *"*"Local Interface: 4 | *" IMPORTING 5 | *" REFERENCE(INPUT) 6 | *" EXPORTING 7 | *" REFERENCE(OUTPUT) 8 | *"---------------------------------------------------------------------- 9 | 10 | output = input. 11 | 12 | ENDFUNCTION. -------------------------------------------------------------------------------- /DateToFactoryDateConversionWithS4HANAABAPCDSView/ZI_FactoryCalendar.abap: -------------------------------------------------------------------------------- 1 | @EndUserText.label: 'Factory Calendar' 2 | @ClientHandling.type: #CLIENT_INDEPENDENT 3 | define table function ZI_FactoryCalendar 4 | returns 5 | { 6 | key FactoryCalendar: wfcid; 7 | key CalendarDate: dats; 8 | WeekDay: char1; 9 | FactoryDate: dats; 10 | PreviousFactoryDate: dats; 11 | } 12 | implemented by method 13 | zcl_factory_calendar=>function; -------------------------------------------------------------------------------- /S4HANAEmbeddedAnalyticsSpendReporting/ZI_Reference3IDByBusPartner.abap: -------------------------------------------------------------------------------- 1 | @EndUserText.label: 'Reference key 3' 2 | define table function ZI_Reference3IDByBusPartner 3 | returns 4 | { 5 | mandt: abap.clnt; 6 | Reference3IDByBusinessPartner: xref3; 7 | CompanyCode: bukrs; 8 | GLAccount: fis_racct; 9 | ControllingArea: kokrs; 10 | CostCenter: kostl; 11 | } 12 | implemented by method 13 | zcl_reference3idbybuspartner=>function; -------------------------------------------------------------------------------- /EmbeddedAnalyticsDateFunction/ZCDFLDVALN ZCDFLDVALO/CONVERSION_EXIT_ZVAL_INPUT.txt: -------------------------------------------------------------------------------- 1 | FUNCTION conversion_exit_zval_input. 2 | *"---------------------------------------------------------------------- 3 | *"*"Local Interface: 4 | *" IMPORTING 5 | *" REFERENCE(INPUT) 6 | *" EXPORTING 7 | *" REFERENCE(OUTPUT) 8 | *"---------------------------------------------------------------------- 9 | 10 | output = input. 11 | 12 | ENDFUNCTION. -------------------------------------------------------------------------------- /FilteringByShortMaterialProductHierarchyDimensionKeysWithABAPCDSViews/CONVERSION_EXIT_ZPH3_INPUT.abap: -------------------------------------------------------------------------------- 1 | FUNCTION conversion_exit_zph3_input. 2 | *"-------------------------------------------------------------------- 3 | *"*"Local Interface: 4 | *" IMPORTING 5 | *" REFERENCE(INPUT) 6 | *" EXPORTING 7 | *" REFERENCE(OUTPUT) 8 | *"-------------------------------------------------------------------- 9 | 10 | output = |*{ input }|. 11 | 12 | ENDFUNCTION. -------------------------------------------------------------------------------- /FilteringByShortMaterialProductHierarchyDimensionKeysWithABAPCDSViews/CONVERSION_EXIT_ZPH4_INPUT.abap: -------------------------------------------------------------------------------- 1 | FUNCTION conversion_exit_zph4_input. 2 | *"---------------------------------------------------------------------- 3 | *"*"Local Interface: 4 | *" IMPORTING 5 | *" REFERENCE(INPUT) 6 | *" EXPORTING 7 | *" REFERENCE(OUTPUT) 8 | *"---------------------------------------------------------------------- 9 | 10 | output = |*{ input }|. 11 | 12 | ENDFUNCTION. -------------------------------------------------------------------------------- /ABAPCDSConsumptionViewFeaturesUltimateTest/zsapbc_curr_year_add_n.abap: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName 'ZCURR_YR_ADD_N' 2 | @AbapCatalog.compiler.compareFilter true 3 | @AccessControl.authorizationCheck #CHECK 4 | @EndUserText.label 'Current Year Plus Offset' 5 | define view zsapbc_curr_year_add_n with parameters 6 | p_offset abap.int2 7 | as select from zsapbc_curr_date { 8 | ( cast(cast(substring(system_date,1,4) as abap.numc(4)) as abap.int2) + p_offset ) as p_year 9 | } 10 | -------------------------------------------------------------------------------- /EmbeddedAnalyticsDateFunction/ZI_ConditionUsageText.txt: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZICONDUT' 2 | @AccessControl.authorizationCheck: #NOT_REQUIRED 3 | @ObjectModel.dataCategory: #TEXT 4 | @VDM.viewType: #BASIC 5 | @EndUserText.label: 'Condition Usage' 6 | define view ZI_ConditionUsageText as select from t681w { 7 | key kvewe as ConditionUsage, 8 | @Semantics.language: true 9 | key spras as Language, 10 | @Semantics.text: true 11 | vtext as ApplicationName 12 | } 13 | -------------------------------------------------------------------------------- /FilteringByShortMaterialProductHierarchyDimensionKeysWithABAPCDSViews/CONVERSION_EXIT_ZPH2_INPUT.abap: -------------------------------------------------------------------------------- 1 | FUNCTION conversion_exit_zph2_input. 2 | *"---------------------------------------------------------------------- 3 | *"*"Local Interface: 4 | *" IMPORTING 5 | *" REFERENCE(INPUT) 6 | *" EXPORTING 7 | *" REFERENCE(OUTPUT) 8 | *"---------------------------------------------------------------------- 9 | 10 | output = |*{ input }|. 11 | 12 | ENDFUNCTION. 13 | 14 | . -------------------------------------------------------------------------------- /EmbeddedAnalyticsDateFunction/ZI_TransactionCodeText.txt: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZITRANSCDT' 2 | @EndUserText.label: 'Transaction Code' 3 | @ObjectModel.dataCategory: #TEXT 4 | @VDM.viewType: #BASIC 5 | @ObjectModel.representativeKey: 'TransactionCode' 6 | define view ZI_TransactionCodeText as select from tstct 7 | { 8 | key tcode as TransactionCode, 9 | @Semantics.language: true 10 | key sprsl as Language, 11 | @Semantics.text: true 12 | ttext as TransactionText 13 | } 14 | 15 | -------------------------------------------------------------------------------- /EmbeddedAnalyticsDateFunction/ZI_ConditionApplicationText.txt: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZICONDAPPLT' 2 | @AccessControl.authorizationCheck: #NOT_REQUIRED 3 | @ObjectModel.dataCategory: #TEXT 4 | @VDM.viewType: #BASIC 5 | @EndUserText.label: 'Condition Application' 6 | define view ZI_ConditionApplicationText as select from t681b { 7 | key kappl as ConditionApplication, 8 | @Semantics.language: true 9 | key spras as Language, 10 | @Semantics.text: true 11 | vtext as ApplicationName 12 | } 13 | -------------------------------------------------------------------------------- /EmbeddedAnalyticsDateFunction/ZI_ConditionUsage.txt: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZICONDU' 2 | @AccessControl.authorizationCheck: #NOT_REQUIRED 3 | @VDM.viewType: #BASIC 4 | @Analytics.dataCategory: #DIMENSION 5 | @EndUserText.label: 'Condition Usage' 6 | define view ZI_ConditionUsage as select from t681v 7 | association [0..*] to ZI_ConditionUsageText as _Text on $projection.ConditionUsage = _Text.ConditionUsage 8 | { 9 | @ObjectModel.text.association: '_Text' 10 | key kvewe as ConditionUsage, 11 | _Text 12 | } 13 | -------------------------------------------------------------------------------- /EmbeddedAnalyticsDateFunction/ZI_DateFunction.txt: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZIDATEFUNC' 2 | @EndUserText.label: 'Date Function' 3 | @AccessControl.authorizationCheck: #NOT_REQUIRED 4 | @Analytics.dataCategory: #DIMENSION 5 | @VDM.viewType: #BASIC 6 | @ObjectModel.representativeKey: 'DateFunction' 7 | define view ZI_DateFunction as select from C_GregorianCalDateFunction( P_Language: $session.system_language ) 8 | { 9 | @ObjectModel.text.element:'DateFunctionName' 10 | key DateFunction, 11 | @Semantics.text: true 12 | DateFunctionName 13 | } 14 | -------------------------------------------------------------------------------- /FilteringByShortMaterialProductHierarchyDimensionKeysWithABAPCDSViews/CONVERSION_EXIT_ZPH3_OUTPUT.abap: -------------------------------------------------------------------------------- 1 | FUNCTION conversion_exit_zph3_output. 2 | *"-------------------------------------------------------------------- 3 | *"*"Local Interface: 4 | *" IMPORTING 5 | *" REFERENCE(INPUT) 6 | *" EXPORTING 7 | *" REFERENCE(OUTPUT) 8 | *"-------------------------------------------------------------------- 9 | 10 | output = 11 | SWITCH string( STRLEN( input ) 12 | WHEN 8 THEN input+5(3) 13 | ELSE input ). 14 | 15 | ENDFUNCTION. -------------------------------------------------------------------------------- /FilteringByShortMaterialProductHierarchyDimensionKeysWithABAPCDSViews/CONVERSION_EXIT_ZPH4_OUTPUT.abap: -------------------------------------------------------------------------------- 1 | FUNCTION conversion_exit_zph4_output. 2 | *"-------------------------------------------------------------------- 3 | *"*"Local Interface: 4 | *" IMPORTING 5 | *" REFERENCE(INPUT) 6 | *" EXPORTING 7 | *" REFERENCE(OUTPUT) 8 | *"-------------------------------------------------------------------- 9 | 10 | output = 11 | SWITCH string( STRLEN( input ) 12 | WHEN 13 THEN input+8(5) 13 | ELSE input ). 14 | 15 | ENDFUNCTION. -------------------------------------------------------------------------------- /FilteringByShortMaterialProductHierarchyDimensionKeysWithABAPCDSViews/CONVERSION_EXIT_ZPH2_OUTPUT.abap: -------------------------------------------------------------------------------- 1 | FUNCTION conversion_exit_zph2_output. 2 | *"---------------------------------------------------------------------- 3 | *"*"Local Interface: 4 | *" IMPORTING 5 | *" REFERENCE(INPUT) 6 | *" EXPORTING 7 | *" REFERENCE(OUTPUT) 8 | *"---------------------------------------------------------------------- 9 | 10 | output = 11 | SWITCH string( STRLEN( input ) 12 | WHEN 5 THEN input+2(3) 13 | ELSE input ). 14 | 15 | ENDFUNCTION. -------------------------------------------------------------------------------- /EmbeddedAnalyticsDateFunction/ZI_ConditionApplication.txt: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZICONDAPPL' 2 | @AbapCatalog.compiler.compareFilter: true 3 | @AbapCatalog.preserveKey: true 4 | @AccessControl.authorizationCheck: #CHECK 5 | @EndUserText.label: 'Condition Application' 6 | define view ZI_ConditionApplication as select from t681a 7 | association [0..*] to ZI_ConditionApplicationText as _Text on $projection.ConditionApplication = _Text.ConditionApplication 8 | { 9 | @ObjectModel.text.association: '_Text' 10 | key kappl as ConditionApplication, 11 | _Text 12 | } 13 | -------------------------------------------------------------------------------- /EmbeddedAnalyticsDateFunction/ZI_TransactionCode.txt: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZITRANSCD' 2 | @EndUserText.label: 'Transaction Code' 3 | @Analytics.dataCategory: #DIMENSION 4 | @VDM.viewType: #BASIC 5 | @ObjectModel.representativeKey: 'TransactionCode' 6 | @AccessControl.authorizationCheck: #NOT_REQUIRED 7 | define view ZI_TransactionCode as select from tstc 8 | association [0..*] to ZI_TransactionCodeText as _Text on $projection.TransactionCode = _Text.TransactionCode 9 | { 10 | @ObjectModel.text.association: '_Text' 11 | key tcode as TransactionCode, 12 | _Text 13 | } 14 | -------------------------------------------------------------------------------- /EmbeddedAnalyticsDateFunction/ZDATE_RANGE/CONVERSION_EXIT_ZDTRG_OUTPUT.txt: -------------------------------------------------------------------------------- 1 | FUNCTION conversion_exit_zdtrg_output. 2 | *"---------------------------------------------------------------------- 3 | *"*"Local Interface: 4 | *" IMPORTING 5 | *" REFERENCE(INPUT) 6 | *" EXPORTING 7 | *" REFERENCE(OUTPUT) 8 | *"---------------------------------------------------------------------- 9 | 10 | DATA(w_date_from) = CONV dats( input+0(8) ). 11 | DATA(w_date_to) = CONV dats( input+8(8) ). 12 | output = |{ w_date_from DATE = ENVIRONMENT } - { w_date_to DATE = ENVIRONMENT } |. 13 | 14 | ENDFUNCTION. -------------------------------------------------------------------------------- /EmbeddedAnalyticsDateFunction/ZI_ChangeTypeText.txt: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZICHGTPT' 2 | @AccessControl.authorizationCheck: #NOT_REQUIRED 3 | @ObjectModel.dataCategory: #TEXT 4 | @VDM.viewType: #BASIC 5 | @EndUserText.label: 'Change Type' 6 | define view ZI_ChangeTypeText as select from dd07t 7 | { 8 | key cast(substring(domvalue_l,1,1) as cdchngind) as ChangeType, 9 | @Semantics.language: true 10 | key ddlanguage as Language, 11 | @Semantics.text: true 12 | ddtext as ApplicationName 13 | } 14 | where domname = 'CDCHNGIND' 15 | and as4local = 'A' 16 | and as4vers = '0000' 17 | -------------------------------------------------------------------------------- /EmbeddedAnalyticsDateFunction/ZI_ConditionTypeText.txt: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZICONDTPT' 2 | @ObjectModel.dataCategory: #TEXT 3 | @VDM.viewType: #BASIC 4 | @AccessControl.authorizationCheck: #CHECK 5 | @ObjectModel.representativeKey: 'ConditionType' 6 | @EndUserText.label: 'Condition Type' 7 | define view ZI_ConditionTypeText as select from t685t 8 | { 9 | key kvewe as ConditionUsage, 10 | key kappl as Application, 11 | key kschl as ConditionType, 12 | @Semantics.language: true 13 | key spras as Language, 14 | @Semantics.text: true 15 | vtext as ConditionTypeName 16 | } 17 | -------------------------------------------------------------------------------- /EmbeddedAnalyticsDateFunction/ZI_ChangeType.txt: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZICHGTP' 2 | @AccessControl.authorizationCheck: #NOT_REQUIRED 3 | @VDM.viewType: #BASIC 4 | @Analytics.dataCategory: #DIMENSION 5 | @EndUserText.label: 'Change Type' 6 | define view ZI_ChangeType as select from dd07l 7 | association [0..*] to ZI_ChangeTypeText as _Text on $projection.ChangeType = _Text.ChangeType 8 | { 9 | @ObjectModel.text.association: '_Text' 10 | key cast(substring(domvalue_l,1,1) as cdchngind) as ChangeType, 11 | _Text 12 | } 13 | where domname = 'CDCHNGIND' 14 | and as4local = 'A' 15 | and as4vers = '0000' 16 | 17 | 18 | -------------------------------------------------------------------------------- /ABAPCDSConsumptionViewFeaturesUltimateTest/zsapbc_carr_dimension.abap: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZCARR_DIM' 2 | @Analytics: {dataCategory: #DIMENSION, dataExtraction.enabled: true} 3 | @ObjectModel.representativeKey: 'CARRID' 4 | @AccessControl.authorizationCheck: #NOT_REQUIRED 5 | @EndUserText.label: 'Flight - Carrier Dimension' 6 | define view zsapbc_carr_dimension as select from zsapbc_carr as scarr 7 | association [1..1] to zsapbc_carr_text as _carr on $projection.carrid = scarr.carrid 8 | { 9 | @ObjectModel.text.association: '_carr' 10 | key carrid, 11 | url, 12 | currcode, 13 | @EndUserText.label: 'Region' 14 | region, 15 | _carr 16 | } 17 | -------------------------------------------------------------------------------- /S4HANAEmbeddedAnalyticsInventoryAgingReport/ZI_StockType.abap: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZISTOCKTYPE' 2 | @VDM.viewType: #BASIC 3 | @Analytics.dataCategory: #DIMENSION 4 | @ObjectModel.representativeKey: 'StockType' 5 | @EndUserText.label: 'Stock Type' 6 | define view ZI_StockType 7 | as select from dd07t 8 | { 9 | @EndUserText.label: 'Stock Type' 10 | @ObjectModel.text.element: ['StockTypeDescription'] 11 | key cast(domvalue_l as nsdm_lbbsa) as StockType, 12 | @Semantics.text: true 13 | @EndUserText.label: 'Stock Type Description' 14 | ddtext as StockTypeDescription 15 | } 16 | where domname = 'NSDM_LBBSA' 17 | and ddlanguage = 'E' 18 | -------------------------------------------------------------------------------- /FilteringByShortMaterialProductHierarchyDimensionKeysWithABAPCDSViews/ZI_ProductClass.abap: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZIPRODCLSGBU' 2 | @AccessControl.authorizationCheck: #NOT_REQUIRED 3 | @VDM.viewType: #BASIC 4 | @ObjectModel.representativeKey: 'ProductClass' 5 | @Analytics.dataCategory: #DIMENSION 6 | @EndUserText.label: 'Product Class' 7 | define view ZI_ProductClass as select from t179 8 | association [0..*] to ZI_ProductClassText as _Text on $projection.ProductClass = _Text.ProductClass 9 | { 10 | @ObjectModel.text.association: '_Text' 11 | key cast(left(t179.prodh,5) as zproductclass ) as ProductClass, 12 | _Text 13 | } 14 | where t179.stufe = '2' 15 | -------------------------------------------------------------------------------- /FilteringByShortMaterialProductHierarchyDimensionKeysWithABAPCDSViews/ZI_ProductFamily.abap: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZIPRODUCTFAMILY' 2 | @AccessControl.authorizationCheck: #NOT_REQUIRED 3 | @VDM.viewType: #BASIC 4 | @ObjectModel.representativeKey: 'ProductFamily' 5 | @Analytics.dataCategory: #DIMENSION 6 | @EndUserText.label: 'Product Family' 7 | define view ZI_ProductFamily 8 | as select from t179 9 | association [0..*] to ZI_ProductFamilyText as _Text on $projection.ProductFamily = _Text.ProductFamily 10 | { 11 | @ObjectModel.text.association: '_Text' 12 | key cast(left(t179.prodh,13) as zproductfamily ) as ProductFamily, 13 | _Text 14 | } 15 | where t179.stufe = '4' 16 | -------------------------------------------------------------------------------- /FilteringByShortMaterialProductHierarchyDimensionKeysWithABAPCDSViews/ZI_ProductCategory.abap: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZIPRODCATEG' 2 | @AccessControl.authorizationCheck: #NOT_REQUIRED 3 | @VDM.viewType: #BASIC 4 | @ObjectModel.representativeKey: 'ProductClass' 5 | @Analytics.dataCategory: #DIMENSION 6 | @EndUserText.label: 'Product Category' 7 | define view ZI_ProductCategory as select from t179 8 | association [0..*] to ZI_ProductCategoryText as _Text on $projection.ProductCategory = _Text.ProductCategory 9 | { 10 | @ObjectModel.text.association: '_Text' 11 | key cast(left(t179.prodh,8) as zproductcategory ) as ProductCategory, 12 | 13 | _Text 14 | } 15 | where t179.stufe = '1' 16 | -------------------------------------------------------------------------------- /FilteringByShortMaterialProductHierarchyDimensionKeysWithABAPCDSViews/ZI_ProductSubclass.abap: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZIPRODSUBCLASS' 2 | @AccessControl.authorizationCheck: #NOT_REQUIRED 3 | @VDM.viewType: #BASIC 4 | @ObjectModel.representativeKey: 'ProductSubclass' 5 | @Analytics.dataCategory: #DIMENSION 6 | @EndUserText.label: 'Product Subclass' 7 | define view ZI_ProductSubclass as select from t179 8 | association [0..*] to ZI_ProductSubclassText as _Text on $projection.ProductSubclass = _Text.ProductSubclass 9 | { 10 | @ObjectModel.text.association: '_Text' 11 | key cast(left(t179.prodh,8) as zproductsubclass ) as ProductSubclass, 12 | _Text 13 | } 14 | where t179.stufe = '3' 15 | -------------------------------------------------------------------------------- /EmbeddedAnalyticsDateFunction/ZI_TableName.txt: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZITABLNM' 2 | @EndUserText.label: 'Table Name' 3 | @Analytics.dataCategory: #DIMENSION 4 | @VDM.viewType: #BASIC 5 | @ObjectModel.representativeKey: 'TableName' 6 | @AccessControl.authorizationCheck: #NOT_REQUIRED 7 | define view ZI_TableName as select from dd02l 8 | association [0..*] to ZI_TableNameText as _TableNameText on $projection.TableName = _TableNameText.TableName 9 | { 10 | @ObjectModel.text.association: '_TableNameText' 11 | key tabname as TableName, 12 | _TableNameText 13 | } 14 | where ( tabclass = #tabclass.'TRANSP' or tabclass = #tabclass.'INTTAB' ) 15 | and as4local = 'A' 16 | and as4vers = '0000' 17 | -------------------------------------------------------------------------------- /CreationOfCompoundedDimensionsWithABAPCDSViews/ZI_TableName.abap: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZITABLNM' 2 | @EndUserText.label: 'Table Name' 3 | @Analytics.dataCategory: #DIMENSION 4 | @VDM.viewType: #BASIC 5 | @ObjectModel.representativeKey: 'TableName' 6 | @AccessControl.authorizationCheck: #NOT_REQUIRED 7 | define view ZI_TableName as select from dd02l 8 | association [0..*] to ZI_TableNameText as _TableNameText on $projection.TableName = _TableNameText.TableName 9 | { 10 | @ObjectModel.text.association: '_TableNameText' 11 | key tabname as TableName, 12 | _TableNameText 13 | } 14 | where ( tabclass = #tabclass.'TRANSP' or tabclass = #tabclass.'INTTAB' ) 15 | and as4local = 'A' 16 | and as4vers = '0000' 17 | -------------------------------------------------------------------------------- /MB5LTransactionCDSViewEquivalent/ZP_CompanyCodeGLAccount.txt: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZPCOMPCODEGLACC' 2 | @EndUserText.label: 'Company Account' 3 | define view ZP_CompanyCodeGLAccount as select distinct from t001 inner join t001k 4 | on t001.bukrs = t001k.bukrs 5 | inner join t030 6 | on t001.ktopl = t030.ktopl 7 | and t001k.bwmod = t030.bwmod 8 | { 9 | t001k.bwkey as ValuationArea, 10 | t030.bklas as ValuationClass, 11 | t001.bukrs as CompanyCode, 12 | t030.konts as GLAccount 13 | } 14 | where t030.ktosl = 'BSX' 15 | and t030.komok = '' 16 | 17 | -------------------------------------------------------------------------------- /ABAPCDSConsumptionViewFeaturesUltimateTest/zsapbc_flight_tabl_func.abap: -------------------------------------------------------------------------------- 1 | @EndUserText.label: 'Flight Table Function' 2 | define table function zsapbc_flight_tabl_func 3 | with parameters 4 | p_disp_currency : s_currcode 5 | returns 6 | { 7 | mandt : abap.clnt; 8 | carrid: s_carr_id; 9 | connid: s_conn_id; 10 | fldate: s_date; 11 | @Semantics.currencyCode: true 12 | currency: s_currcode; 13 | @Semantics.currencyCode: true 14 | disp_currency: s_currcode; 15 | @Semantics.amount.currencyCode: 'currency' 16 | paymentsum: s_sum; 17 | @Semantics.amount.currencyCode: 'disp_currency' 18 | payment_disp_curr: s_sum; 19 | @Semantics.amount.currencyCode: 'disp_currency' 20 | payment_disp_curr_total: s_sum; 21 | flyear: abap.char(4); 22 | 23 | } 24 | implemented by method 25 | zcl_sapbc_flight_tabl_func=>function; -------------------------------------------------------------------------------- /S4HANAEmbeddedAnalyticsSpendReporting/ZI_PurchaseType.abap: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZI_PURTP' 2 | @EndUserText.label: 'Purchase Type' 3 | @Analytics.dataCategory: #DIMENSION 4 | @VDM.viewType: #BASIC 5 | @ObjectModel.representativeKey: 'PurchaseType' 6 | define view ZI_PurchaseType as select from tadir 7 | { 8 | @ObjectModel.text.element: 'PurchaseTypeText' 9 | key 'I' as PurchaseType, 10 | @Semantics.text 11 | cast('Indirect' as abap.char( 8 )) as PurchaseTypeText 12 | } 13 | where obj_name = 'ZI_PURCHASETYPE' 14 | and object = 'DDLS' 15 | 16 | union all 17 | 18 | select from tadir 19 | { 20 | @ObjectModel.text.element: 'PurchaseTypeText' 21 | key 'D' as PurchaseType, 22 | @Semantics.text 23 | cast('Direct' as abap.char( 8 )) as PurchaseTypeText 24 | } 25 | where obj_name = 'ZI_PURCHASETYPE' 26 | and object = 'DDLS' 27 | -------------------------------------------------------------------------------- /AutomationOfRDASchedulingAndMonitoring/Z_RDA_DAEMON_TOP.abap: -------------------------------------------------------------------------------- 1 | *&---------------------------------------------------------------------* 2 | *& Include Z_RDA_DAEMON_TOP 3 | *&---------------------------------------------------------------------* 4 | 5 | ************************************************************************ 6 | * Types 7 | ************************************************************************ 8 | TYPE-POOLS: abap, 9 | icon. 10 | 11 | ************************************************************************ 12 | * Selection Screen 13 | ************************************************************************ 14 | SELECTION-SCREEN BEGIN OF LINE. 15 | SELECTION-SCREEN COMMENT 1(7) c_daemon FOR FIELD p_daemon. 16 | SELECTION-SCREEN POSITION 35. 17 | PARAMETERS: p_daemon TYPE rscrt_demonid OBLIGATORY. 18 | SELECTION-SCREEN END OF LINE. -------------------------------------------------------------------------------- /S4HANAEmbeddedAnalyticsSpendReporting/ZI_PurchaseProcess.abap: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZI_PURP' 2 | @EndUserText.label: 'Purchase Process' 3 | @Analytics.dataCategory: #DIMENSION 4 | @VDM.viewType: #BASIC 5 | @ObjectModel.representativeKey: 'PurchaseType' 6 | define view ZI_PurchaseProcess as select from tadir 7 | { 8 | @ObjectModel.text.element: 'PurchaseProcessText' 9 | key 'P' as PurchaseProcess, 10 | @Semantics.text 11 | cast('PO' as abap.char( 8 )) as PurchaseProcessText 12 | } 13 | where obj_name = 'ZI_PURCHASEPROCESS' 14 | and object = 'DDLS' 15 | 16 | union all 17 | 18 | select from tadir 19 | { 20 | @ObjectModel.text.element: 'PurchaseProcessText' 21 | key 'N' as PurchaseProcess, 22 | @Semantics.text 23 | cast('Non PO' as abap.char( 8 )) as PurchaseProcessText 24 | } 25 | where obj_name = 'ZI_PURCHASEPROCESS' 26 | and object = 'DDLS' 27 | -------------------------------------------------------------------------------- /AddValuetoYourS4HANAEmbeddedAnalyticsContentwithMaterialHierarchy/ZI_Material.txt: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZMAT' 2 | @VDM.viewType: #BASIC 3 | @EndUserText.label: 'Material' 4 | define view ZI_Material as select from ZI_ProductHierarchyNodeHier 5 | { 6 | key cast(ProductHierarchyNodeChild as abap.char(40)) as nodeid, 7 | key cast(ProductHierarchyNodeParent as prodh_d) as parentid, 8 | cast(ProductHierarchyNodeChild as prodh_d) as prodh, 9 | cast('' as matnr) as material 10 | } 11 | 12 | union 13 | 14 | select from ZI_ProductHierarchyNodeHier as prodh join mara 15 | on prodh.ProductHierarchyNodeChild = mara.prdha 16 | { 17 | key cast(mara.matnr as abap.char(40) ) as nodeid, 18 | key cast(prodh.ProductHierarchyNodeChild as prodh_d) as parentid, 19 | cast('' as prodh_d) as prodh, 20 | mara.matnr as material 21 | } -------------------------------------------------------------------------------- /MonthGenericValueHelp/Z_MONTH_F4_DEMO_TOP.abap: -------------------------------------------------------------------------------- 1 | *&---------------------------------------------------------------------* 2 | *& Include Z_MONTH_F4_DEMO_TOP 3 | *&---------------------------------------------------------------------* 4 | 5 | ************************************************************************ 6 | * Data Definitions * 7 | ************************************************************************ 8 | DATA: w_month TYPE rsfiscper6. 9 | 10 | ************************************************************************ 11 | * Selection Screen 12 | ************************************************************************ 13 | SELECTION-SCREEN BEGIN OF LINE. 14 | SELECTION-SCREEN COMMENT 1(30) c_month FOR FIELD s_month. 15 | SELECT-OPTIONS s_month FOR w_month NO-EXTENSION OBLIGATORY. 16 | SELECTION-SCREEN END OF LINE. -------------------------------------------------------------------------------- /ABAPCDSConsumptionViewFeaturesUltimateTest/zsapbc_region_hierarchy.abap: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZREGION_HIER' 2 | @Analytics: { dataCategory: #HIERARCHY, dataExtraction.enabled: true } 3 | @ObjectModel.representativeKey: 'REGION' 4 | @AccessControl.authorizationCheck: #NOT_REQUIRED 5 | @EndUserText.label: 'Flight - Region Dimension' 6 | @Hierarchy.parentChild.name: 'REGION_GEO' 7 | @Hierarchy.parentChild.label: 'Region Geography' 8 | @Hierarchy.parentChild: 9 | { recurse: { parent: 'ParentNode', child: 'HierarchyNode' } } 10 | define view zsapbc_region_hierarchy as select distinct from zsapbc_region 11 | association[0..1] to zsapbc_region_dimension as _region_dim on $projection.HierarchyNode = _region_dim.region 12 | { 13 | @ObjectModel.foreignKey.association: '_region_dim' 14 | key region as HierarchyNode, 15 | main_region as ParentNode, 16 | _region_dim 17 | } 18 | -------------------------------------------------------------------------------- /DisplayShortMaterialProductHierarchyLevelKeysWithABAPCDSViews/CONVERSION_EXIT_ZPH_OUTPUT.abap: -------------------------------------------------------------------------------- 1 | FUNCTION conversion_exit_zph_output. 2 | *"-------------------------------------------------------------------- 3 | *"*"Local Interface: 4 | *" IMPORTING 5 | *" REFERENCE(INPUT) 6 | *" EXPORTING 7 | *" REFERENCE(OUTPUT) 8 | *"-------------------------------------------------------------------- 9 | 10 | output = COND char18( WHEN matches( val = input regex = '^.{13,13}$' ) 11 | THEN input+8(5) 12 | WHEN matches( val = input regex = '^.{8,8}$' ) 13 | THEN input+5(3) 14 | WHEN matches( val = input regex = '^.{5,5}$' ) 15 | THEN input+2(3) 16 | WHEN matches( val = input regex = '^.{2,2}$' ) 17 | THEN input+0(2) 18 | ELSE input ). 19 | 20 | ENDFUNCTION. -------------------------------------------------------------------------------- /EmbeddedAnalyticsDateFunction/ZI_TableNameText.txt: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZITABLNMT' 2 | @ObjectModel.dataCategory: #TEXT 3 | @VDM.viewType: #BASIC 4 | @ObjectModel.representativeKey: 'TableName' 5 | @EndUserText.label: 'Table Name' 6 | define view ZI_TableNameText as select from dd02l inner join dd02t 7 | on dd02l.tabname = dd02t.tabname 8 | and dd02l.as4local = dd02t.as4local 9 | and dd02l.as4vers = dd02t.as4vers 10 | { 11 | key dd02l.tabname as TableName, 12 | @Semantics.language: true 13 | key dd02t.ddlanguage as Language, 14 | @Semantics.text: true 15 | ddtext 16 | } 17 | where ( tabclass = #tabclass.'TRANSP' or tabclass = #tabclass.'INTTAB' ) 18 | and dd02l.as4local = 'A' 19 | and dd02l.as4vers = '0000' 20 | -------------------------------------------------------------------------------- /S4HANAEmbeddedAnalyticsSpendReporting/ZI_SpendExceptionJournalEntry1.abap: -------------------------------------------------------------------------------- 1 | @VDM.viewType: #BASIC 2 | @VDM.private: true 3 | @AbapCatalog.sqlViewName: 'ZISPENDEXCJE1' 4 | define view ZI_SpendExceptionJournalEntry1 5 | as select from ZI_SpendExceptionJournalEntry2 as SpendException left outer join ZI_SpendJournalEntry1 as Spend 6 | on SpendException.CompanyCode = Spend.CompanyCode 7 | and SpendException.AccountingDocument = Spend.AccountingDocument 8 | and SpendException.FiscalYear = Spend.FiscalYear 9 | { 10 | SpendException.CompanyCode, 11 | SpendException.AccountingDocument, 12 | SpendException.FiscalYear 13 | } 14 | where Spend.CompanyCode is null 15 | and Spend.AccountingDocument is null 16 | and Spend.FiscalYear is null 17 | -------------------------------------------------------------------------------- /CreationOfCompoundedDimensionsWithABAPCDSViews/ZI_TableNameText.abap: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZITABLNMT' 2 | @ObjectModel.dataCategory: #TEXT 3 | @VDM.viewType: #BASIC 4 | @ObjectModel.representativeKey: 'TableName' 5 | @EndUserText.label: 'Table Name' 6 | define view ZI_TableNameText as select from dd02l inner join dd02t 7 | on dd02l.tabname = dd02t.tabname 8 | and dd02l.as4local = dd02t.as4local 9 | and dd02l.as4vers = dd02t.as4vers 10 | { 11 | key dd02l.tabname as TableName, 12 | @Semantics.language: true 13 | key dd02t.ddlanguage as Language, 14 | @Semantics.text: true 15 | ddtext 16 | } 17 | where ( tabclass = #tabclass.'TRANSP' or tabclass = #tabclass.'INTTAB' ) 18 | and dd02l.as4local = 'A' 19 | and dd02l.as4vers = '0000' 20 | -------------------------------------------------------------------------------- /S4HANAEmbeddedAnalyticsSpendReporting/ZI_SpendExceptionJournalEntry2.abap: -------------------------------------------------------------------------------- 1 | @VDM.viewType: #BASIC 2 | @VDM.private: true 3 | @AbapCatalog.sqlViewName: 'ZISPENDEXCJE2' 4 | define view ZI_SpendExceptionJournalEntry2 5 | as select distinct from ZI_ReceivablesPayablesItem as I_ReceivablesPayablesItem 6 | { 7 | I_ReceivablesPayablesItem.CompanyCode, 8 | I_ReceivablesPayablesItem.AccountingDocument, 9 | I_ReceivablesPayablesItem.FiscalYear 10 | } 11 | where I_ReceivablesPayablesItem.AccountingDocumentCategory = '' 12 | and I_ReceivablesPayablesItem.FinancialAccountType = 'K' 13 | and ( I_ReceivablesPayablesItem.PostingKey = '21' or 14 | I_ReceivablesPayablesItem.PostingKey = '22' or 15 | I_ReceivablesPayablesItem.PostingKey = '24' or 16 | I_ReceivablesPayablesItem.PostingKey = '31' or 17 | I_ReceivablesPayablesItem.PostingKey = '32' or 18 | I_ReceivablesPayablesItem.PostingKey = '34' ) 19 | and I_ReceivablesPayablesItem.SpecialGLCode = '' 20 | -------------------------------------------------------------------------------- /ABAPCDSConsumptionViewFeaturesUltimateTest/zsapbc_region_hierarchy3.abap: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZREGION_HIER3' 2 | @Analytics: { dataCategory: #HIERARCHY, dataExtraction.enabled: true } 3 | @ObjectModel.representativeKey: 'REGION' 4 | @AccessControl.authorizationCheck: #NOT_REQUIRED 5 | @EndUserText.label: 'Flight - Region Hierarchy' 6 | @Hierarchy.parentChild.name: 'REGION_GEO' 7 | @Hierarchy.parentChild.label: 'Region Geography' 8 | @Hierarchy.parentChild: 9 | { recurse: { parent: 'ParentNode', child: 'HierarchyNode' } } 10 | define view zsapbc_region_hierarchy3 as select distinct from zsapbc_region3 11 | association[0..*] to zsapbc_region_dimension3 as _region_dim on $projection.HierarchyNode = _region_dim.region 12 | { 13 | @ObjectModel.foreignKey.association: '_region_dim' 14 | key region as HierarchyNode, 15 | 16 | @Semantics.businessDate.to: true 17 | key dateto, 18 | @Semantics.businessDate.from: true 19 | datefrom, 20 | main_region as ParentNode, 21 | _region_dim 22 | } 23 | -------------------------------------------------------------------------------- /AddMultipleT179MaterialProductHierarchiestoS4HANAEmbeddedAnalyticsContent/ZI_MaterialHierDir.txt: -------------------------------------------------------------------------------- 1 | @ObjectModel.representativeKey: 'MaterialHier' 2 | @EndUserText.label: 'Material Hierarchy' 3 | @Analytics: { dataCategory: #DIMENSION } 4 | @VDM.viewType: #BASIC 5 | @AbapCatalog.sqlViewName: 'ZIMATHIERDIR' 6 | @AccessControl.authorizationCheck: #CHECK 7 | define view ZI_MaterialHierDir as select from tadir 8 | { 9 | @ObjectModel.text.element: ['MaterialHierDesc'] 10 | key cast('LEVEL4' as hryid ) as MaterialHier, 11 | @Semantics.text: true 12 | cast('Level 4' as abap.char(40) ) as MaterialHierDesc 13 | } 14 | where object = 'DDLS' 15 | and obj_name = 'ZI_MATERIALHIERDIR' 16 | 17 | union all 18 | 19 | select from tadir 20 | { 21 | @ObjectModel.text.element: ['MaterialHierDesc'] 22 | key cast('LEVEL3' as hryid ) as MaterialHier, 23 | @Semantics.text: true 24 | cast('Level 3' as abap.char(40) ) as MaterialHierDesc 25 | } 26 | where object = 'DDLS' 27 | and obj_name = 'ZI_MATERIALHIERDIR' 28 | -------------------------------------------------------------------------------- /ABAPCDSConsumptionViewFeaturesUltimateTest/zsapbc_carr.abap: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZCARR' 2 | @AccessControl.authorizationCheck:#NOT_REQUIRED 3 | @EndUserText.label: 'Airline' 4 | define view zsapbc_carr as select from scarr 5 | { 6 | carrid, 7 | url, 8 | currcode, 9 | cast(case 10 | when carrid = 'LH' or carrid = 'AB' then 'Germany' 11 | when carrid = 'AA' or carrid = 'CO' or carrid = 'DL' or 12 | carrid = 'NW' or carrid = 'WA' then 'US' 13 | when carrid = 'AC' then 'Canada' 14 | when carrid = 'AF' then 'France' 15 | when carrid = 'AZ' then 'Italy' 16 | when carrid = 'BA' then 'UK' 17 | when carrid = 'FJ' then 'Fiji' 18 | when carrid = 'NG' then 'Austria' 19 | when carrid = 'JL' then 'Japan' 20 | when carrid = 'QF' then 'Australia' 21 | when carrid = 'SA' then 'South Africa' 22 | when carrid = 'SQ' then 'Singapure' 23 | when carrid = 'SR' then 'Swirzerland' 24 | when carrid = 'UA' then 'US' 25 | else 'Other' 26 | end as abap.char( 13 )) as region 27 | } -------------------------------------------------------------------------------- /MonthGenericValueHelp/Z_MONTH_F4_DEMO.abap: -------------------------------------------------------------------------------- 1 | REPORT z_month_f4_demo. 2 | INCLUDE z_month_f4_demo_top. 3 | INCLUDE z_month_f4_demo_appl. 4 | INCLUDE z_month_f4. 5 | 6 | ************************************************************************ 7 | INITIALIZATION. 8 | ************************************************************************ 9 | c_month = 'Month'. 10 | 11 | ************************************************************************ 12 | AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_month-low. 13 | ************************************************************************ 14 | lcl_month=>f4( ). 15 | 16 | ************************************************************************ 17 | AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_month-high. 18 | ************************************************************************ 19 | lcl_month=>f4( ). 20 | 21 | ************************************************************************ 22 | START-OF-SELECTION. 23 | ************************************************************************ 24 | lcl_application=>main( ). -------------------------------------------------------------------------------- /FilteringByShortMaterialProductHierarchyDimensionKeysWithABAPCDSViews/ZI_ProductFamilyText.abap: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZIPRODUCTFAMILYT' 2 | @AccessControl.authorizationCheck: #NOT_REQUIRED 3 | @ObjectModel.dataCategory: #TEXT 4 | @VDM.viewType: #BASIC 5 | @EndUserText.label: 'Product Family' 6 | define view ZI_ProductFamilyText as select from t179 inner join t179t 7 | on t179.prodh = t179t.prodh 8 | association [0..1] to I_Language as _Language on $projection.Language = _Language.Language 9 | association [1..1] to ZI_ProductFamily as _ProductFamily on $projection.ProductFamily = _ProductFamily.ProductFamily 10 | { 11 | @ObjectModel.foreignKey.association: '_ProductFamily' 12 | key t179t.prodh as ProductFamily, 13 | @Semantics.language: true 14 | @ObjectModel.foreignKey.association: '_Language' 15 | key t179t.spras as Language, 16 | @Semantics.text: true 17 | vtext as ProductFamilyText, 18 | _ProductFamily, 19 | _Language 20 | } 21 | where t179.stufe = '4' 22 | -------------------------------------------------------------------------------- /FilteringByShortMaterialProductHierarchyDimensionKeysWithABAPCDSViews/ZI_ProductClassText.abap: -------------------------------------------------------------------------------- 1 | 2 | @AbapCatalog.sqlViewName: 'ZIPRDCLASS' 3 | @AccessControl.authorizationCheck: #NOT_REQUIRED 4 | @ObjectModel.dataCategory: #TEXT 5 | @VDM.viewType: #BASIC 6 | @EndUserText.label: 'Product Subclass' 7 | define view ZI_ProductClassText as select from t179 inner join t179t 8 | on t179.prodh = t179t.prodh 9 | association [0..1] to I_Language as _Language on $projection.Language = _Language.Language 10 | association [1..1] to ZI_ProductClass as _ProductClass on $projection.ProductClass = _ProductClass.ProductClass 11 | { 12 | @ObjectModel.foreignKey.association: '_ProductClass' 13 | key t179t.prodh as ProductClass, 14 | @Semantics.language: true 15 | @ObjectModel.foreignKey.association: '_Language' 16 | key t179t.spras as Language, 17 | @Semantics.text: true 18 | vtext as ProductClassText, 19 | _ProductClass, 20 | _Language 21 | } 22 | where t179.stufe = '2' 23 | 24 | 25 | -------------------------------------------------------------------------------- /FilteringByShortMaterialProductHierarchyDimensionKeysWithABAPCDSViews/ZI_ProductCategoryText.abap: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZIPRODCATEGT' 2 | @AccessControl.authorizationCheck: #NOT_REQUIRED 3 | @ObjectModel.dataCategory: #TEXT 4 | @VDM.viewType: #BASIC 5 | @EndUserText.label: 'Product Category' 6 | define view ZI_ProductCategoryText as select from t179 inner join t179t 7 | on t179.prodh = t179t.prodh 8 | association [0..1] to I_Language as _Language on $projection.Language = _Language.Language 9 | association [1..1] to ZI_ProductCategory as _ProductCategory on $projection.ProductCategory = _ProductCategory.ProductCategory 10 | { 11 | @ObjectModel.foreignKey.association: '_ProductCategory' 12 | key t179t.prodh as ProductCategory, 13 | @Semantics.language: true 14 | @ObjectModel.foreignKey.association: '_Language' 15 | key t179t.spras as Language, 16 | @Semantics.text: true 17 | vtext as ProductCategoryText, 18 | _ProductCategory, 19 | _Language 20 | } 21 | where t179.stufe = '1' 22 | -------------------------------------------------------------------------------- /FilteringByShortMaterialProductHierarchyDimensionKeysWithABAPCDSViews/ZI_ProductSubclassText.abap: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZIPRODSUBCLASST' 2 | @AccessControl.authorizationCheck: #NOT_REQUIRED 3 | @ObjectModel.dataCategory: #TEXT 4 | @VDM.viewType: #BASIC 5 | @EndUserText.label: 'Product Subclass' 6 | define view ZI_ProductSubclassText as select from t179 inner join t179t 7 | on t179.prodh = t179t.prodh 8 | association [0..1] to I_Language as _Language on $projection.Language = _Language.Language 9 | association [1..1] to ZI_ProductSubclass as _ProductSubclass on $projection.ProductSubclass = _ProductSubclass.ProductSubclass 10 | { 11 | @ObjectModel.foreignKey.association: '_ProductSubclass' 12 | key t179t.prodh as ProductSubclass, 13 | @Semantics.language: true 14 | @ObjectModel.foreignKey.association: '_Language' 15 | key t179t.spras as Language, 16 | @Semantics.text: true 17 | vtext as ProductSubclassText, 18 | _ProductSubclass, 19 | _Language 20 | } 21 | where t179.stufe = '3' 22 | -------------------------------------------------------------------------------- /S4HANAEmbeddedAnalyticsSpendReporting/ZI_SpendJournalEntry2.abap: -------------------------------------------------------------------------------- 1 | @VDM.viewType: #BASIC 2 | @VDM.private: true 3 | @AbapCatalog.sqlViewName: 'ZISPENDJE2' 4 | define view ZI_SpendJournalEntry2 5 | as select from ZI_ReceivablesPayablesItem as I_ReceivablesPayablesItem 6 | { 7 | I_ReceivablesPayablesItem.CompanyCode, 8 | I_ReceivablesPayablesItem.AccountingDocument, 9 | I_ReceivablesPayablesItem.FiscalYear 10 | } 11 | where I_ReceivablesPayablesItem.AccountingDocumentCategory = '' 12 | and I_ReceivablesPayablesItem.FinancialAccountType = 'K' 13 | and ( I_ReceivablesPayablesItem.PostingKey = '21' or 14 | I_ReceivablesPayablesItem.PostingKey = '22' or 15 | I_ReceivablesPayablesItem.PostingKey = '24' or 16 | I_ReceivablesPayablesItem.PostingKey = '31' or 17 | I_ReceivablesPayablesItem.PostingKey = '32' or 18 | I_ReceivablesPayablesItem.PostingKey = '34' ) 19 | and I_ReceivablesPayablesItem.SpecialGLCode = '' 20 | group by I_ReceivablesPayablesItem.CompanyCode, 21 | I_ReceivablesPayablesItem.AccountingDocument, 22 | I_ReceivablesPayablesItem.FiscalYear 23 | having count( * ) = 1 24 | -------------------------------------------------------------------------------- /EmbeddedAnalyticsDateFunction/ZCDFLDVALN ZCDFLDVALO/CONVERSION_EXIT_ZVAL_OUTPUT.txt: -------------------------------------------------------------------------------- 1 | FUNCTION conversion_exit_zval_output. 2 | *"---------------------------------------------------------------------- 3 | *"*"Local Interface: 4 | *" IMPORTING 5 | *" REFERENCE(INPUT) 6 | *" EXPORTING 7 | *" REFERENCE(OUTPUT) 8 | *"---------------------------------------------------------------------- 9 | TYPES: dec13_2 TYPE p LENGTH 13 DECIMALS 2. 10 | TYPES: dec13_3 TYPE p LENGTH 13 DECIMALS 3. 11 | 12 | IF matches( val = input regex = '^[0-9]{1,}[.|,][0-9][0-9] [A-Z]{3,5}$' ). 13 | SPLIT input AT SPACE INTO DATA(w_amount) DATA(w_currency). 14 | REPLACE ALL OCCURRENCES OF ',' IN w_amount WITH '.'. 15 | output = |{ CONV dec13_2( w_amount ) NUMBER = ENVIRONMENT ALIGN = RIGHT } { w_currency }|. 16 | ELSEIF matches( val = input regex = '^[0-9]{8}$' ). 17 | WRITE: CONV d( input ) TO output. 18 | ELSEIF matches( val = input regex = '^[0-9]{1,}[.|,][0-9][0-9]-{0,1} 3$' ). 19 | SPLIT input AT SPACE INTO DATA(w_percent) DATA(w_percent_uom). 20 | output = |{ CONV dec13_3( w_percent / 10 ) } %|. 21 | ELSE. 22 | output = input. 23 | ENDIF. 24 | 25 | ENDFUNCTION. -------------------------------------------------------------------------------- /MB5LTransactionCDSViewEquivalent/ZI_CurrentMatlPriceByCostEst.txt: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZICURRMATPRICE' 2 | @AbapCatalog.compiler.compareFilter: true 3 | @AbapCatalog.preserveKey: true 4 | @AccessControl.authorizationCheck: #CHECK 5 | @EndUserText.label: 'Current material price by cost estimate' 6 | define view ZI_CurrentMatlPriceByCostEst 7 | as select from ZP_CurrentMatlPriceByCostEst1 left outer join ZP_CompanyCodeGLAccount 8 | on ZP_CurrentMatlPriceByCostEst1.ValuationArea = ZP_CompanyCodeGLAccount.ValuationArea 9 | and ZP_CurrentMatlPriceByCostEst1.ValuationClass = ZP_CompanyCodeGLAccount.ValuationClass 10 | { 11 | ZP_CurrentMatlPriceByCostEst1.CostEstimate, 12 | ZP_CurrentMatlPriceByCostEst1.ValuationArea, 13 | ZP_CurrentMatlPriceByCostEst1.ValuationClass, 14 | ZP_CompanyCodeGLAccount.CompanyCode, //Uladzislau Pralat 15 | ZP_CompanyCodeGLAccount.GLAccount, //Uladzislau Pralat 16 | ZP_CurrentMatlPriceByCostEst1.MaterialPriceUnitQty, 17 | ZP_CurrentMatlPriceByCostEst1.InventoryPrice 18 | } 19 | -------------------------------------------------------------------------------- /S4HANAEmbeddedAnalyticsSpendReporting/ZI_SpendJournalEntry1.abap: -------------------------------------------------------------------------------- 1 | @VDM.viewType: #BASIC 2 | @VDM.private: true 3 | @AbapCatalog.sqlViewName: 'ZISPENDJE1' 4 | define view ZI_SpendJournalEntry1 5 | as select from ZI_ReceivablesPayablesItem as I_ReceivablesPayablesItem inner join ZI_SpendJournalEntry2 as SpendJournalEntry 6 | on I_ReceivablesPayablesItem.CompanyCode = SpendJournalEntry.CompanyCode 7 | and I_ReceivablesPayablesItem.AccountingDocument = SpendJournalEntry.AccountingDocument 8 | and I_ReceivablesPayablesItem.FiscalYear = SpendJournalEntry.FiscalYear 9 | { 10 | I_ReceivablesPayablesItem.CompanyCode, 11 | I_ReceivablesPayablesItem.AccountingDocument, 12 | I_ReceivablesPayablesItem.FiscalYear 13 | } 14 | where I_ReceivablesPayablesItem.FinancialAccountType = 'K' 15 | group by I_ReceivablesPayablesItem.CompanyCode, 16 | I_ReceivablesPayablesItem.AccountingDocument, 17 | I_ReceivablesPayablesItem.FiscalYear 18 | having count( * ) = 1 19 | -------------------------------------------------------------------------------- /S4HANAEmbeddedAnalyticsInventoryAgingReport/ZI_InventoryAgingFunc.abap: -------------------------------------------------------------------------------- 1 | @EndUserText.label: 'Inventory Aging' 2 | define table function ZI_InventoryAgingFunc 3 | with parameters 4 | @Environment.systemField: #SYSTEM_DATE 5 | P_Current_Date: dats, 6 | @EndUserText.label: 'Aging Range 1' 7 | P_Aging_Range_1: char3, 8 | @EndUserText.label: 'Aging Range 2' 9 | P_Aging_Range_2: char3, 10 | @EndUserText.label: 'Aging Range 3' 11 | P_Aging_Range_3: char3, 12 | @EndUserText.label: 'Aging Range 4' 13 | P_Aging_Range_4: char3, 14 | @EndUserText.label: 'Internal Flow Elimination' 15 | P_Internal_Flow_Elimination: cacsyn 16 | returns 17 | { 18 | key mandt: abap.clnt; 19 | key werks: werks_d; 20 | key lgort: lgort_d; 21 | key sobkz: sobkz; 22 | key kunnr_sid: nsdm_kunnr; 23 | key lifnr: elifn; 24 | key kzbws: kzbws; 25 | key mat_kdauf: mat_kdauf; 26 | key mat_kdpos: mat_kdpos; 27 | key matnr: matnr; 28 | key lbbsa_sid: nsdm_lbbsa; 29 | aging_range: abap.char(1); 30 | budat_h_max: budat; 31 | meins: meins; 32 | waers: waers; 33 | labst: labst; 34 | salk3: salk3; 35 | } 36 | implemented by method 37 | zcl_inventory_aging=>function; 38 | -------------------------------------------------------------------------------- /S4HANAEmbeddedAnalyticsInventoryAgingTrendReport/ZI_InventoryAgingFunc.abap: -------------------------------------------------------------------------------- 1 | @EndUserText.label: 'Inventory Aging' 2 | define table function ZI_InventoryAgingFunc 3 | with parameters 4 | @Environment.systemField: #SYSTEM_DATE 5 | P_Current_Date: dats, 6 | @EndUserText.label: 'Aging Range 1' 7 | P_Aging_Range_1: char3, 8 | @EndUserText.label: 'Aging Range 2' 9 | P_Aging_Range_2: char3, 10 | @EndUserText.label: 'Aging Range 3' 11 | P_Aging_Range_3: char3, 12 | @EndUserText.label: 'Aging Range 4' 13 | P_Aging_Range_4: char3, 14 | @EndUserText.label: 'Internal Flow Elimination' 15 | P_Internal_Flow_Elimination: cacsyn 16 | returns 17 | { 18 | key mandt: abap.clnt; 19 | key werks: werks_d; 20 | key lgort: lgort_d; 21 | key sobkz: sobkz; 22 | key kunnr_sid: nsdm_kunnr; 23 | key lifnr: elifn; 24 | key kzbws: kzbws; 25 | key mat_kdauf: mat_kdauf; 26 | key mat_kdpos: mat_kdpos; 27 | key matnr: matnr; 28 | key lbbsa_sid: nsdm_lbbsa; 29 | date: dats; 30 | aging_range: abap.char(1); 31 | budat_h_max: budat; 32 | meins: meins; 33 | waers: waers; 34 | labst: labst; 35 | salk3: salk3; 36 | } 37 | implemented by method 38 | zcl_inventory_aging=>function; 39 | 40 | -------------------------------------------------------------------------------- /AutomationOfRDASchedulingAndMonitoring/Z_RDA_DAEMON_START.abap: -------------------------------------------------------------------------------- 1 | REPORT z_rda_daemon_start. 2 | 3 | INCLUDE z_rda_daemon_top. 4 | INCLUDE z_rda_daemon_appl. 5 | 6 | ************************************************************************ 7 | INITIALIZATION. 8 | ************************************************************************ 9 | c_daemon = 'Daemon'. 10 | 11 | ************************************************************************ 12 | AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_daemon. 13 | ************************************************************************ 14 | CALL METHOD lcl_daemon=>f4. 15 | 16 | ************************************************************************ 17 | AT SELECTION-SCREEN ON p_daemon. 18 | ************************************************************************ 19 | CALL METHOD lcl_daemon=>check. 20 | 21 | ************************************************************************ 22 | START-OF-SELECTION. 23 | ************************************************************************ 24 | DATA: daemon TYPE REF TO lcl_daemon. 25 | DATA: exception TYPE REF TO zcx_exception. 26 | 27 | TRY. 28 | CREATE OBJECT daemon EXPORTING iv_daemon = p_daemon. 29 | daemon->start( ). 30 | CATCH zcx_exception INTO exception. 31 | MESSAGE exception->text TYPE 'E'. 32 | ENDTRY. -------------------------------------------------------------------------------- /S4HANAEmbeddedAnalyticsSpendReporting/ZI_PurchaseProcessDocumentType.abap: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZI_PURPDT' 2 | @EndUserText.label: 'Purchase Process Document Type' 3 | @Analytics.dataCategory: #DIMENSION 4 | @VDM.viewType: #BASIC 5 | @ObjectModel.representativeKey: 'PurchaseProcessDocumentType' 6 | define view ZI_PurchaseProcessDocumentType as select from tadir 7 | { 8 | @ObjectModel.text.element: 'PurProcessDocTypeText' 9 | key '1' as PurchaseProcessDocumentType, 10 | @Semantics.text 11 | cast('PO & PR' as abap.char( 8 )) as PurProcessDocTypeText 12 | } 13 | where obj_name = 'ZI_PURCHASEPROCESSDOCUMENTTYPE' 14 | and object = 'DDLS' 15 | 16 | union all 17 | 18 | select from tadir 19 | { 20 | @ObjectModel.text.element: 'PurProcessDocTypeText' 21 | key '2' as PurchaseProcessDocumentType, 22 | @Semantics.text 23 | cast('PO' as abap.char( 8 )) as PurProcessDocTypeText 24 | } 25 | where obj_name = 'ZI_PURCHASEPROCESSDOCUMENTTYPE' 26 | and object = 'DDLS' 27 | 28 | union all 29 | 30 | select from tadir 31 | { 32 | @ObjectModel.text.element: 'PurProcessDocTypeText' 33 | key '3' as PurchaseProcessDocumentType, 34 | @Semantics.text 35 | cast('No PO' as abap.char( 8 )) as PurProcessDocTypeText 36 | } 37 | where obj_name = 'ZI_PURCHASEPROCESSDOCUMENTTYPE' 38 | and object = 'DDLS' 39 | -------------------------------------------------------------------------------- /AddValuetoYourS4HANAEmbeddedAnalyticsContentwithMaterialHierarchy/ZI_MaterialHier.txt: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZIMATHIER' 2 | @EndUserText.label: 'Material' 3 | @AccessControl.authorizationCheck: #NOT_REQUIRED 4 | @VDM.viewType: #BASIC 5 | @ObjectModel.dataCategory: #HIERARCHY 6 | @Hierarchy.parentChild: [{ 7 | rootNode.visibility:#ADD_ROOT_NODE, 8 | name : 'MAT_HIER', 9 | label: 'Material Hierarchy', 10 | siblingsOrder: [{ by: 'material', direction: #ASC }], 11 | recurseBy: '_parent' 12 | }] 13 | define view ZI_MaterialHier as select from ZI_Material 14 | association[0..1] to ZI_MaterialHier as _parent on $projection.parentid = _parent.nodeid 15 | association[0..1] to I_ProductHierarchyNode as _ProductHierarchyNode on $projection.prodh = _ProductHierarchyNode.ProductHierarchyNode 16 | and $projection.material = '' 17 | association[0..1] to I_Material as _Material on $projection.material = _Material.Material 18 | and $projection.prodh = '' 19 | { 20 | key nodeid, 21 | parentid, 22 | @ObjectModel.foreignKey.association: '_ProductHierarchyNode' 23 | prodh, 24 | @ObjectModel.foreignKey.association: '_Material' 25 | material, 26 | _parent, 27 | _ProductHierarchyNode, 28 | _Material 29 | } -------------------------------------------------------------------------------- /AutomationOfRDASchedulingAndMonitoring/Z_RDA_DAEMON_STOP.abap: -------------------------------------------------------------------------------- 1 | REPORT z_rda_daemon_stop. 2 | 3 | INCLUDE z_rda_daemon_top. 4 | INCLUDE z_rda_daemon_appl. 5 | 6 | 7 | ************************************************************************ 8 | INITIALIZATION. 9 | ************************************************************************ 10 | c_daemon = 'Daemon'. 11 | 12 | ************************************************************************ 13 | AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_daemon. 14 | ************************************************************************ 15 | CALL METHOD lcl_daemon=>f4. 16 | 17 | ************************************************************************ 18 | AT SELECTION-SCREEN ON p_daemon. 19 | ************************************************************************ 20 | CALL METHOD lcl_daemon=>check. 21 | 22 | ************************************************************************ 23 | START-OF-SELECTION. 24 | ************************************************************************ 25 | DATA: exception TYPE REF TO zcx_exception. 26 | DATA: daemon TYPE REF TO lcl_daemon. 27 | 28 | TRY. 29 | CREATE OBJECT daemon EXPORTING iv_daemon = p_daemon. 30 | daemon->stop( ). 31 | CATCH zcx_exception INTO exception. 32 | MESSAGE exception->text TYPE 'E'. 33 | EXIT. 34 | ENDTRY. -------------------------------------------------------------------------------- /AutomationOfRDASchedulingAndMonitoring/Z_RDA_DAEMON_MONITOR.abap: -------------------------------------------------------------------------------- 1 | REPORT z_rda_daemon_monitor. 2 | 3 | INCLUDE z_rda_daemon_top. 4 | INCLUDE z_rda_daemon_appl. 5 | 6 | 7 | ************************************************************************ 8 | INITIALIZATION. 9 | ************************************************************************ 10 | c_daemon = 'Daemon'. 11 | 12 | ************************************************************************ 13 | AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_daemon. 14 | ************************************************************************ 15 | CALL METHOD lcl_daemon=>f4. 16 | 17 | ************************************************************************ 18 | AT SELECTION-SCREEN ON p_daemon. 19 | ************************************************************************ 20 | CALL METHOD lcl_daemon=>check. 21 | 22 | ************************************************************************ 23 | START-OF-SELECTION. 24 | ************************************************************************ 25 | DATA: exception TYPE REF TO zcx_exception. 26 | DATA: daemon TYPE REF TO lcl_daemon. 27 | 28 | TRY. 29 | CREATE OBJECT daemon EXPORTING iv_daemon = p_daemon. 30 | daemon->monitor( ). 31 | CATCH zcx_exception INTO exception. 32 | MESSAGE exception->text TYPE 'E'. 33 | EXIT. 34 | ENDTRY. -------------------------------------------------------------------------------- /EmbeddedAnalyticsDateFunction/ZI_FieldNameText.txt: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZIFLDNMTXT' 2 | @ObjectModel.dataCategory: #TEXT 3 | @VDM.viewType: #BASIC 4 | @ObjectModel.representativeKey: 'FieldName' 5 | @EndUserText.label: 'Table Field' 6 | define view ZI_FieldNameText as select from dd02l inner join dd03l on dd02l.tabname = dd03l.tabname 7 | and dd02l.as4local = dd03l.as4local 8 | and dd02l.as4vers = dd03l.as4vers 9 | inner join dd04t on dd03l.rollname = dd04t.rollname 10 | and dd03l.as4local = dd04t.as4local 11 | and dd03l.as4vers = dd04t.as4vers 12 | { 13 | key dd03l.tabname as TableName, 14 | key dd03l.fieldname as FieldName, 15 | @Semantics.language: true 16 | key dd04t.ddlanguage as Language, 17 | // dd03l.rollname as DataElement, 18 | @Semantics.text: true 19 | dd04t.scrtext_l as FieldDescription 20 | } 21 | where ( tabclass = #tabclass.'TRANSP' or tabclass = #tabclass.'INTTAB' ) 22 | and ( dd03l.comptype = #comptype.'E' or dd03l.comptype = #comptype.' ' ) 23 | and dd03l.as4local = 'A' 24 | and dd03l.as4vers = '0000' 25 | -------------------------------------------------------------------------------- /MB5LTransactionCDSViewEquivalent/ZP_CurrentMatlPriceByCostEst1.txt: -------------------------------------------------------------------------------- 1 | @AbapCatalog.preserveKey: true 2 | @AbapCatalog: { 3 | sqlViewName: 'ZPCURRMATPRICE1', 4 | compiler.compareFilter: true 5 | } 6 | //@ClientHandling.algorithm: #SESSION_VARIABLE 7 | @ClientHandling.type: #CLIENT_DEPENDENT 8 | @ObjectModel: { 9 | usageType:{ 10 | sizeCategory: #XL, 11 | serviceQuality: #C, 12 | dataClass:#TRANSACTIONAL 13 | } 14 | } 15 | @AccessControl.authorizationCheck: #CHECK 16 | @EndUserText.label: 'Current material price by cost estimate' 17 | @VDM: { 18 | viewType: #COMPOSITE, 19 | private: false 20 | } 21 | @Metadata.ignorePropagatedAnnotations: true 22 | define view ZP_CurrentMatlPriceByCostEst1 as select from ZP_CurrentMatlPriceByCostEst2 23 | { 24 | CostEstimate, 25 | ValuationArea, 26 | ValuationClass, //Uladzislau Pralat 27 | max (PriceUnit) as MaterialPriceUnitQty, 28 | max (case PriceControl when 'V' then MovingPrice 29 | else StandardPrice end ) as InventoryPrice 30 | } 31 | where PriceUnit > 0 32 | and mandt = $session.client 33 | group by CostEstimate, ValuationArea, ValuationClass 34 | 35 | -------------------------------------------------------------------------------- /EmbeddedAnalyticsDateFunction/ZI_FieldName.txt: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZIFLDNM' 2 | @EndUserText.label: 'Table Field' 3 | @Analytics.dataCategory: #DIMENSION 4 | @VDM.viewType: #BASIC 5 | @ObjectModel.representativeKey: 'FieldName' 6 | @AccessControl.authorizationCheck: #NOT_REQUIRED 7 | define view ZI_FieldName as select from dd02l inner join dd03l on dd02l.tabname = dd03l.tabname 8 | and dd02l.as4local = dd03l.as4local 9 | and dd02l.as4vers = dd03l.as4vers 10 | association [0..*] to ZI_FieldNameText as _FieldNameText on $projection.TableName = _FieldNameText.TableName 11 | and $projection.FieldName = _FieldNameText.FieldName 12 | association [0..1] to ZI_TableName as _TableName on $projection.TableName = _TableName.TableName 13 | { 14 | @ObjectModel.foreignKey.association: '_TableName' 15 | key dd03l.tabname as TableName, 16 | @ObjectModel.text.association: '_FieldNameText' 17 | key dd03l.fieldname as FieldName, 18 | 19 | _FieldNameText, 20 | _TableName 21 | } 22 | where ( tabclass = #tabclass.'TRANSP' or tabclass = #tabclass.'INTTAB' ) 23 | and ( dd03l.comptype = #comptype.'E' or dd03l.comptype = #comptype.' ' ) 24 | and dd03l.as4local = 'A' 25 | and dd03l.as4vers = '0000' 26 | -------------------------------------------------------------------------------- /EmbeddedAnalyticsDateFunction/ZI_ConditionType.txt: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZICONDTP' 2 | @Analytics.dataCategory: #DIMENSION 3 | @VDM.viewType: #BASIC 4 | @ObjectModel.representativeKey: 'ConditionType' 5 | @EndUserText.label: 'Condition Type' 6 | @AccessControl.authorizationCheck: #NOT_REQUIRED 7 | define view ZI_ConditionType as select from t685 8 | association [0..1] to ZI_ConditionUsage as _ConditionUsage on $projection.ConditionUsage = _ConditionUsage.ConditionUsage 9 | association [0..1] to ZI_ConditionApplication as _ConditionApplication on $projection.ConditionApplication = _ConditionApplication.ConditionApplication 10 | association [0..*] to ZI_ConditionTypeText as _ConditionTypeText on $projection.ConditionUsage = _ConditionTypeText.ConditionUsage 11 | and $projection.ConditionApplication = _ConditionTypeText.Application 12 | and $projection.ConditionType = _ConditionTypeText.ConditionType 13 | { 14 | @ObjectModel.foreignKey.association: '_ConditionUsage' 15 | key kvewe as ConditionUsage, 16 | @ObjectModel.foreignKey.association: '_ConditionApplication' 17 | key kappl as ConditionApplication, 18 | @ObjectModel.text.association: '_ConditionTypeText' 19 | key kschl as ConditionType, 20 | _ConditionUsage, 21 | _ConditionApplication, 22 | _ConditionTypeText 23 | } 24 | -------------------------------------------------------------------------------- /EmbeddedAnalyticsDateFunction/ZCONDITION_TABLE_FIELDS.abap: -------------------------------------------------------------------------------- 1 | REPORT zcondition_table_fields. 2 | PARAMETERS: p_vkorg TYPE abap_bool DEFAULT abap_true, 3 | p_vtweg TYPE abap_bool DEFAULT abap_true, 4 | p_kunnr TYPE abap_bool DEFAULT abap_true, 5 | p_matnr TYPE abap_bool DEFAULT abap_true. 6 | SELECT DISTINCT konh~kotabnr 7 | INTO TABLE @DATA(wt_kotabnr_tmp) 8 | FROM konh INNER JOIN t681 ON konh~kotabnr = t681~kotabnr 9 | AND t681~kvewe = 'A' 10 | AND t681~kappl = 'V' 11 | ORDER BY konh~kotabnr. 12 | 13 | DATA: wt_kotabnr LIKE wt_kotabnr_tmp. 14 | 15 | LOOP AT wt_kotabnr_tmp ASSIGNING FIELD-SYMBOL(). 16 | DATA(struct_def) = CAST cl_abap_structdescr( cl_abap_tabledescr=>describe_by_name( |A{ -kotabnr }| ) ). 17 | DATA(wt_component) = struct_def->get_components( ). 18 | IF ( LINE_EXISTS( wt_component[ name = 'VKORG' ] ) AND p_vkorg = abap_true ) OR 19 | ( LINE_EXISTS( wt_component[ name = 'VTWEG' ] ) AND p_vtweg = abap_true ) OR 20 | ( LINE_EXISTS( wt_component[ name = 'KUNNR' ] ) AND p_kunnr = abap_true ) OR 21 | ( LINE_EXISTS( wt_component[ name = 'MATNR' ] ) AND p_matnr = abap_true ). 22 | APPEND TO wt_kotabnr. 23 | ENDIF. 24 | ENDLOOP. 25 | SORT wt_kotabnr. 26 | 27 | 28 | cl_salv_table=>factory( 29 | IMPORTING 30 | r_salv_table = DATA(alv) 31 | CHANGING 32 | t_table = wt_kotabnr ). 33 | alv->display( ). -------------------------------------------------------------------------------- /MB5LTransactionCDSViewEquivalent/ZP_MatStkQtyValCur3.txt: -------------------------------------------------------------------------------- 1 | @AbapCatalog.preserveKey: true 2 | @AbapCatalog: { 3 | sqlViewName: 'ZPMATSTKQTYVALC3', 4 | compiler.compareFilter: true 5 | } 6 | @AccessControl.authorizationCheck: #NOT_REQUIRED 7 | @ClientHandling.algorithm: #SESSION_VARIABLE 8 | @VDM:{ 9 | viewType: #COMPOSITE, 10 | private: true 11 | } 12 | define view ZP_MatStkQtyValCur3 as select from ZI_MaterialStock 13 | { 14 | key Material, 15 | key Plant, 16 | key StorageLocation, 17 | key Batch, 18 | key Supplier, 19 | key SDDocument, 20 | key SDDocumentItem, 21 | key WBSElementInternalID, 22 | key Customer, 23 | key SpecialStockIdfgStockOwner, 24 | key InventoryStockType, 25 | key InventorySpecialStockType, 26 | key MaterialBaseUnit, 27 | key CostEstimate, 28 | CompanyCode, //Uladzislau Pralat 29 | GLAccount, //Uladzislau Pralat 30 | sum(MatlWrhsStkQtyInMatlBaseUnit) as MatlWrhsStkQtyInMatlBaseUnit, 31 | _CurrentInvtryPrice, 32 | _CompanyCode 33 | } 34 | group by 35 | Material, 36 | Plant, 37 | StorageLocation, 38 | Batch, 39 | Supplier, 40 | SDDocument, 41 | SDDocumentItem, 42 | WBSElementInternalID, 43 | Customer, 44 | SpecialStockIdfgStockOwner, 45 | InventoryStockType, 46 | InventorySpecialStockType, 47 | MaterialBaseUnit, 48 | CostEstimate, 49 | GLAccount, //Uladzislau Pralat 50 | CompanyCode //Uladzislau Pralat 51 | 52 | -------------------------------------------------------------------------------- /ABAPCDSConsumptionViewFeaturesUltimateTest/zsapbc_region.abap: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZREGION ' 2 | @AccessControl.authorizationCheck:#NOT_REQUIRED 3 | @EndUserText.label: 'Flight - Region ' 4 | define view zsapbc_region as select distinct from zsapbc_carr { 5 | key region, 6 | case 7 | when region = 'Germany' or region = 'France' or region = 'Italy' or 8 | region = 'UK' or region = 'Austria' or region = 'Swirzerland' then 'Europe' 9 | when region = 'US' or region = 'Canada' then 'North America' 10 | 11 | when region = 'South Africa' then 'Africa' 12 | when region = 'Fiji' or region = 'Japan' or region = 'Singapure' then 'Asia' 13 | else 'Other' 14 | end as main_region 15 | } 16 | where region <> 'Australia' 17 | 18 | union 19 | 20 | select distinct from scarr { 21 | 22 | key 'Europe' as region, 23 | 'World' as main_region 24 | } 25 | 26 | union 27 | 28 | select distinct from scarr { 29 | 30 | key 'North America' as region, 31 | 'World' as main_region 32 | } 33 | 34 | union 35 | 36 | select distinct from scarr { 37 | 38 | key 'Asia' as region, 39 | 'World' as main_region 40 | } 41 | 42 | union 43 | 44 | select distinct from scarr { 45 | 46 | key 'Australia' as region, 47 | 'World' as main_region 48 | } 49 | 50 | union 51 | 52 | select distinct from scarr { 53 | 54 | key 'Africa' as region, 55 | 'World' as main_region 56 | } 57 | 58 | union 59 | 60 | select distinct from scarr { 61 | 62 | key 'World' as region, 63 | '' as main_region 64 | } 65 | 66 | 67 | -------------------------------------------------------------------------------- /ABAPCDSConsumptionViewFeaturesUltimateTest/zcl_sapbc_flight_tabl_func.abap: -------------------------------------------------------------------------------- 1 | class zcl_sapbc_flight_tabl_func definition 2 | public 3 | final 4 | create public . 5 | 6 | public section. 7 | interfaces if_amdp_marker_hdb. 8 | class-methods function for table function zsapbc_flight_tabl_func. 9 | protected section. 10 | private section. 11 | endclass. 12 | 13 | 14 | 15 | class zcl_sapbc_flight_tabl_func implementation. 16 | method function by database function 17 | for hdb language sqlscript 18 | options read-only 19 | using sflight. 20 | 21 | 22 | it_data = 23 | select mandt, carrid, connid, fldate, 24 | currency, :p_disp_currency as disp_currency, 25 | paymentsum, 26 | CONVERT_CURRENCY(amount=>paymentsum, 27 | "SOURCE_UNIT" =>currency, 28 | "SCHEMA" => 'SAPA4H', 29 | "CONVERSION_TYPE" => 'M', 30 | "TARGET_UNIT" => :p_disp_currency, 31 | "REFERENCE_DATE" =>fldate, 32 | "ERROR_HANDLING"=>'set to null', 33 | "CLIENT" => '000') as payment_disp_curr, 34 | substr( fldate, 1, 4) as flyear 35 | from sflight; 36 | 37 | return 38 | select mandt, carrid, connid, fldate, currency, disp_currency, 39 | paymentsum , payment_disp_curr, 40 | sum( payment_disp_curr ) over ( partition by flyear ) as payment_disp_curr_total, 41 | flyear 42 | from :it_data; 43 | 44 | endmethod. 45 | endclass. -------------------------------------------------------------------------------- /ABAPCDSConsumptionViewFeaturesUltimateTest/zsapbc_flight_fact.abap: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'zsflight_fact' 2 | @AbapCatalog.compiler.compareFilter: true 3 | @Analytics.dataCategory: #FACT 4 | @AccessControl.authorizationCheck:#NOT_REQUIRED 5 | @EndUserText.label: 'Flight Fact' 6 | define view zsapbc_flight_fact with parameters 7 | @Consumption.defaultValue: 'CAD' 8 | p_display_currency : s_currcode 9 | as select from sflight inner join zsapbc_carr as scarr 10 | on sflight.carrid = scarr.carrid { 11 | key sflight.carrid, 12 | key sflight.connid, 13 | key sflight.fldate, 14 | scarr.region, 15 | cast(substring(sflight.fldate,1,6) as abap.numc( 6 )) as flmonth, 16 | cast(substring(sflight.fldate,1,4) as abap.numc( 4 )) as flyear, 17 | sflight.currency, 18 | sflight.paymentsum as payment, 19 | 'CAD' as disp_curr, 20 | currency_conversion( 21 | amount => sflight.paymentsum, 22 | source_currency => sflight.currency, 23 | target_currency => $parameters.p_display_currency, 24 | exchange_rate_date => sflight.fldate, 25 | exchange_rate_type => 'M', 26 | error_handling => 'SET_TO_NULL' // otherwise data inconsistencies cause a dump 27 | ) as payment_disp_curr, 28 | cast('EA' as abap.unit(3) ) as unit, 29 | sflight.seatsmax, 30 | sflight.seatsmax_b, 31 | sflight.seatsmax_f, 32 | seatsmax + seatsmax_b + seatsmax_f as seatsmax_total, 33 | sflight.seatsocc, 34 | sflight.seatsocc_b, 35 | sflight.seatsocc_f, 36 | seatsocc + seatsocc_b + seatsocc_f as seatsocc_total 37 | } -------------------------------------------------------------------------------- /AddMultipleT179MaterialProductHierarchiestoS4HANAEmbeddedAnalyticsContent/ZI_MaterialHier.txt: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZIMATHIER' 2 | @EndUserText.label: 'Material' 3 | @AccessControl.authorizationCheck: #NOT_REQUIRED 4 | @VDM.viewType: #BASIC 5 | @ObjectModel.dataCategory: #HIERARCHY 6 | @Hierarchy.parentChild: [{ 7 | rootNode.visibility:#ADD_ROOT_NODE, 8 | siblingsOrder: [{ by: 'nodeid', direction: #ASC }], 9 | recurseBy: '_parent', 10 | directory: '_MaterialHierDir' 11 | }] 12 | define view ZI_MaterialHier as select from ZI_Material 13 | association[0..1] to ZI_MaterialHierDir as _MaterialHierDir on $projection.MaterialHier = _MaterialHierDir.MaterialHier 14 | association[0..1] to ZI_MaterialHier as _parent on $projection.parentid = _parent.nodeid 15 | association[0..1] to I_ProductHierarchyNode as _ProductHierarchyNode on $projection.prodh = _ProductHierarchyNode.ProductHierarchyNode 16 | and $projection.material = '' 17 | association[0..1] to I_Material as _Material on $projection.material = _Material.Material 18 | and $projection.prodh = '' 19 | { 20 | @ObjectModel.foreignKey.association: '_MaterialHierDir' 21 | key MaterialHier, 22 | key nodeid, 23 | parentid, 24 | @ObjectModel.foreignKey.association: '_ProductHierarchyNode' 25 | prodh, 26 | @ObjectModel.foreignKey.association: '_Material' 27 | material, 28 | _MaterialHierDir, 29 | _parent, 30 | _ProductHierarchyNode, 31 | _Material 32 | } -------------------------------------------------------------------------------- /AdvancedExceptionAggregationwithABAPCDSView/ZI_ExceptionAggregationCube.abap: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZIEXCAGGRC' 2 | @EndUserText.label: 'Exception Aggregation' 3 | @Analytics.dataCategory: #CUBE 4 | @VDM.viewType: #COMPOSITE 5 | define view ZI_ExceptionAggregationCube 6 | as select from vbak inner join vbap 7 | on vbak.vbeln = vbap.vbeln 8 | association [0..1] to I_SalesOrganization as _SalesOrganization on $projection.SalesOrganization = _SalesOrganization.SalesOrganization 9 | association [0..1] to I_DistributionChannel as _DistributionChannel on $projection.DistributionChannel = _DistributionChannel.DistributionChannel 10 | association [0..1] to I_Division as _Division on $projection.Division = _Division.Division 11 | association [0..1] to I_Customer as _SoldToParty on $projection.SoldToParty = _SoldToParty.Customer 12 | association [0..1] to I_Material as _Material on $projection.Material = _Material.Material 13 | { 14 | vbak.vbeln as SalesDocument, 15 | vbap.posnr as SalesDocumentItem, 16 | @ObjectModel.foreignKey.association: '_SalesOrganization' 17 | vbak.vkorg as SalesOrganization, 18 | @ObjectModel.foreignKey.association: '_DistributionChannel' 19 | vbak.vtweg as DistributionChannel, 20 | @ObjectModel.foreignKey.association: '_Division' 21 | vbak.spart as Division, 22 | @ObjectModel.foreignKey.association: '_SoldToParty' 23 | vbak.kunnr as SoldToParty, 24 | @ObjectModel.foreignKey.association: '_Material' 25 | vbap.matnr as Material, 26 | _SalesOrganization, 27 | _DistributionChannel, 28 | _Division, 29 | _SoldToParty, 30 | _Material 31 | } 32 | 33 | -------------------------------------------------------------------------------- /FilteringByShortMaterialProductHierarchyDimensionKeysWithABAPCDSViews/ZX_Material.abap: -------------------------------------------------------------------------------- 1 | @VDM.viewExtension: true 2 | @AbapCatalog.sqlViewAppendName: 'ZXMATERIAL' 3 | @EndUserText.label: 'Material' 4 | extend view I_Material with ZX_Material 5 | association [0..1] to ZI_ProductCategory as _ProductCategory on $projection.ProductCategory = _ProductCategory.ProductCategory 6 | association [0..1] to ZI_ProductClass as _ProductClass on $projection.ProductClass = _ProductClass.ProductClass 7 | association [0..1] to ZI_ProductSubclass as _ProductSubclass on $projection.ProductSubClass = _ProductSubclass.ProductSubclass 8 | association [0..1] to ZI_ProductFamily as _ProductFamily on $projection.ProductFamily = _ProductFamily.ProductFamily 9 | { 10 | bismt as OldMaterialNumber, 11 | @ObjectModel.foreignKey.association: '_ProductCategory' 12 | cast(left(prdha,2) as zproductcategory) as ProductCategory, 13 | @ObjectModel.foreignKey.association: '_ProductClass' 14 | cast(left(prdha,5) as zproductclass) as ProductClass, 15 | @ObjectModel.foreignKey.association: '_ProductSubClass' 16 | cast(left(prdha,8) as zproductsubclass) as ProductSubClass, 17 | @ObjectModel.foreignKey.association: '_ProductFamily' 18 | cast(left(prdha,13) as zproductfamily) as ProductFamily, 19 | mara.mstae as XPlantMaterialStatus, 20 | mara.prdha as ProductHierarchy, 21 | mara.ean11 as UPC, 22 | mara.normt as Licensor, 23 | mara.ferth as Inventor1, 24 | mara.ersda as MaterialCreateDate, 25 | _ProductCategory, 26 | _ProductClass, 27 | _ProductSubclass, 28 | _ProductFamily 29 | } 30 | -------------------------------------------------------------------------------- /MB5LTransactionCDSViewEquivalent/ZP_MatStkQtyValCur2.txt: -------------------------------------------------------------------------------- 1 | @AbapCatalog.preserveKey: true 2 | @AbapCatalog: { 3 | sqlViewName: 'ZPMATSTKQTYVALC2', 4 | compiler.compareFilter: true 5 | } 6 | @AccessControl.authorizationCheck: #NOT_REQUIRED 7 | @ClientHandling.algorithm: #SESSION_VARIABLE 8 | @VDM:{ 9 | viewType: #COMPOSITE, 10 | private: true 11 | } 12 | define view ZP_MatStkQtyValCur2 as select from ZP_MatStkQtyValCur3 13 | { 14 | key Material, 15 | key Plant, 16 | key StorageLocation, 17 | key Batch, 18 | key Supplier, 19 | key SDDocument, 20 | key SDDocumentItem, 21 | key WBSElementInternalID, 22 | key Customer, 23 | key SpecialStockIdfgStockOwner, 24 | key InventoryStockType, 25 | key InventorySpecialStockType, 26 | key MaterialBaseUnit, 27 | key CostEstimate, 28 | key CompanyCode, //Uladzislau Pralat 29 | key GLAccount, //Uladzislau Pralat 30 | cast(MatlWrhsStkQtyInMatlBaseUnit as nsdm_material_stock_in_buom ) as MatlWrhsStkQtyInMatlBaseUnit, 31 | -- Calculate the value from the current valid price for the stock quanitity above 32 | cast( round( 33 | cast(MatlWrhsStkQtyInMatlBaseUnit as abap.dec( 21, 3 )) * 34 | division( 35 | cast(_CurrentInvtryPrice.InventoryPrice as abap.dec( 11, 2 )), 36 | cast(_CurrentInvtryPrice.MaterialPriceUnitQty as abap.dec( 5, 0 )), 37 | 5 38 | ) 39 | , 2 40 | ) 41 | as nsdm_stock_value_in_cccrcy 42 | ) as StockValueInCCCrcy, 43 | _CompanyCode.Currency 44 | } 45 | 46 | -------------------------------------------------------------------------------- /MB5LTransactionCDSViewEquivalent/ZP_MatStkQtyValCur1.txt: -------------------------------------------------------------------------------- 1 | @AbapCatalog.preserveKey: true 2 | @AbapCatalog: { 3 | sqlViewName: 'ZPMATSTKQTYVALC1', 4 | compiler.compareFilter: true 5 | } 6 | @AccessControl.authorizationCheck: #NOT_REQUIRED 7 | @ClientHandling.algorithm: #SESSION_VARIABLE 8 | @VDM:{ 9 | viewType: #COMPOSITE, 10 | private: true 11 | } 12 | define view ZP_MatStkQtyValCur1 as select from ZP_MatStkQtyValCur2 13 | { 14 | key Material, 15 | key Plant, 16 | key StorageLocation, 17 | key Batch, 18 | key Supplier, 19 | key SDDocument, 20 | key SDDocumentItem, 21 | key WBSElementInternalID, 22 | key Customer, 23 | key SpecialStockIdfgStockOwner, 24 | key InventoryStockType, 25 | key InventorySpecialStockType, 26 | key MaterialBaseUnit, 27 | key CompanyCode, //Uladzislau Pralat 28 | key GLAccount, //Uladzislau Pralat 29 | key Currency, 30 | cast(sum(MatlWrhsStkQtyInMatlBaseUnit) as nsdm_material_stock_in_buom preserving type ) as MatlWrhsStkQtyInMatlBaseUnit, 31 | cast(sum(StockValueInCCCrcy) as nsdm_stock_value_in_cccrcy preserving type ) as StockValueInCCCrcy, 32 | -- provide the current date as "calculated" field to have the current date avilable for the consuming view for the currency conversion 33 | $session.system_date as CurrentDate 34 | } 35 | group by 36 | Material, 37 | Plant, 38 | StorageLocation, 39 | Batch, 40 | Supplier, 41 | SDDocument, 42 | SDDocumentItem, 43 | WBSElementInternalID, 44 | Customer, 45 | SpecialStockIdfgStockOwner, 46 | InventoryStockType, 47 | InventorySpecialStockType, 48 | MaterialBaseUnit, 49 | CompanyCode, //Uladzislau Pralat 50 | GLAccount, //Uladzislau Pralat 51 | Currency 52 | 53 | -------------------------------------------------------------------------------- /AddValuetoYourS4HANAEmbeddedAnalyticsContentwithMaterialHierarchy/ZX_Material.txt: -------------------------------------------------------------------------------- 1 | @VDM.viewExtension: true 2 | @AbapCatalog.sqlViewAppendName: 'ZXMATERIAL' 3 | @EndUserText.label: 'Material' 4 | extend view I_Material with ZX_Material 5 | association [0..1] to I_ProductHierarchyNode as _ProductHierarchyNode1 on $projection.ProductCategory = _ProductHierarchyNode1.ProductHierarchyNode 6 | association [0..1] to I_ProductHierarchyNode as _ProductHierarchyNode2 on $projection.ProductClass = _ProductHierarchyNode2.ProductHierarchyNode 7 | association [0..1] to I_ProductHierarchyNode as _ProductHierarchyNode3 on $projection.ProductSubClass = _ProductHierarchyNode3.ProductHierarchyNode 8 | association [0..1] to I_ProductHierarchyNode as _ProductHierarchyNode4 on $projection.ProductFamily = _ProductHierarchyNode4.ProductHierarchyNode 9 | { 10 | bismt, 11 | volum, 12 | @ObjectModel.foreignKey.association: '_ProductHierarchyNode1' 13 | cast(left(prdha,2) as prodh1) as ProductCategory, 14 | @ObjectModel.foreignKey.association: '_ProductHierarchyNode2' 15 | cast(left(prdha,5) as zprodh2) as ProductClass, 16 | @ObjectModel.foreignKey.association: '_ProductHierarchyNode3' 17 | cast(left(prdha,8) as zprodh3) as ProductSubClass, 18 | @ObjectModel.foreignKey.association: '_ProductHierarchyNode4' 19 | cast(left(prdha,13) as zprodh4) as ProductFamily, 20 | _ProductHierarchyNode1, 21 | _ProductHierarchyNode2, 22 | _ProductHierarchyNode3, 23 | _ProductHierarchyNode4 24 | } 25 | -------------------------------------------------------------------------------- /MB5LTransactionCDSViewEquivalent/ZP_CurrentMatlPriceByCostEst2.txt: -------------------------------------------------------------------------------- 1 | @AbapCatalog.preserveKey: true 2 | @AbapCatalog: { 3 | sqlViewName: 'ZPCURRMATPRICE2', 4 | compiler.compareFilter: true 5 | } 6 | //@ClientHandling.algorithm: #AUTOMATED 7 | @ClientHandling.type: #CLIENT_DEPENDENT 8 | @ObjectModel: { 9 | usageType:{ 10 | sizeCategory: #XL, 11 | serviceQuality: #C, 12 | dataClass:#TRANSACTIONAL 13 | } 14 | } 15 | @AccessControl.authorizationCheck: #NOT_REQUIRED 16 | @VDM: { 17 | viewType: #COMPOSITE, 18 | private: true 19 | } 20 | define view ZP_CurrentMatlPriceByCostEst2 as 21 | select from Mbv_Mbew 22 | { 23 | bwkey as ValuationArea, 24 | bklas as ValuationClass, //Uladzislau Pralat 25 | kaln1 as CostEstimate, 26 | vprsv as PriceControl, 27 | verpr as MovingPrice, 28 | stprs as StandardPrice, 29 | peinh as PriceUnit 30 | } 31 | union all select from Mbv_Obew 32 | { 33 | bwkey as ValuationArea, 34 | bklas as ValuationClass, //Uladzislau Pralat 35 | kaln1 as CostEstimate, 36 | vprsv as PriceControl, 37 | verpr as MovingPrice, 38 | stprs as StandardPrice, 39 | peinh as PriceUnit 40 | } 41 | union all select from Mbv_Ebew 42 | { 43 | bwkey as ValuationArea, 44 | bklas as ValuationClass, //Uladzislau Pralat 45 | kaln1 as CostEstimate, 46 | vprsv as PriceControl, 47 | verpr as MovingPrice, 48 | stprs as StandardPrice, 49 | peinh as PriceUnit 50 | } 51 | union all select from Mbv_Qbew 52 | { 53 | bwkey as ValuationArea, 54 | bklas as ValuationClass, //Uladzislau Pralat 55 | kaln1 as CostEstimate, 56 | vprsv as PriceControl, 57 | verpr as MovingPrice, 58 | stprs as StandardPrice, 59 | peinh as PriceUnit 60 | } 61 | -------------------------------------------------------------------------------- /AddMultipleT179MaterialProductHierarchiestoS4HANAEmbeddedAnalyticsContent/ZI_Material.txt: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZMAT' 2 | @VDM.viewType: #BASIC 3 | @EndUserText.label: 'Material' 4 | define view ZI_Material as select from ZI_ProductHierarchyNodeHier 5 | { 6 | key cast('LEVEL4' as hryid) as MaterialHier, 7 | key cast(ProductHierarchyNodeChild as abap.char(40)) as nodeid, 8 | key cast(ProductHierarchyNodeParent as prodh_d) as parentid, 9 | cast(ProductHierarchyNodeChild as prodh_d) as prodh, 10 | cast('' as matnr) as material 11 | } 12 | 13 | union all 14 | 15 | select from ZI_ProductHierarchyNodeHier as prodh join mara 16 | on prodh.ProductHierarchyNodeChild = mara.prdha 17 | { 18 | key cast('LEVEL4' as hryid) as MaterialHier, 19 | key cast(mara.matnr as abap.char(40) ) as nodeid, 20 | key cast(prodh.ProductHierarchyNodeChild as prodh_d) as parentid, 21 | cast('' as prodh_d) as prodh, 22 | mara.matnr as material 23 | } 24 | 25 | union all 26 | 27 | select from ZI_ProductHierarchyNodeHier 28 | { 29 | key cast('LEVEL3' as hryid) as MaterialHier, 30 | key cast(ProductHierarchyNodeChild as abap.char(40)) as nodeid, 31 | key cast(ProductHierarchyNodeParent as prodh_d) as parentid, 32 | cast(ProductHierarchyNodeChild as prodh_d) as prodh, 33 | cast('' as matnr) as material 34 | } 35 | where stufe between '1' and '3' 36 | 37 | union all 38 | 39 | select from ZI_ProductHierarchyNodeHier as prodh join mara 40 | on prodh.ProductHierarchyNodeChild = mara.prdha 41 | { 42 | key cast('LEVEL3' as hryid) as MaterialHier, 43 | key cast(mara.matnr as abap.char(40) ) as nodeid, 44 | key cast(substring(prodh.ProductHierarchyNodeChild,1,8) as prodh_d) as parentid, 45 | cast('' as prodh_d) as prodh, 46 | mara.matnr as material 47 | } 48 | -------------------------------------------------------------------------------- /AddValuetoYourS4HANAEmbeddedAnalyticsContentwithMaterialHierarchy/I_ProductHierarchyNode.txt: -------------------------------------------------------------------------------- 1 | @EndUserText.label: 'Product Hierarchy Node' //same as DDL description 2 | @Analytics.dataCategory: #DIMENSION //or #CUBE or #FACT 3 | @VDM.viewType: #BASIC 4 | @AccessControl.authorizationCheck: #NOT_REQUIRED 5 | @AbapCatalog.sqlViewName: 'IPRODHIERNODE' //must start with "I" 6 | @ObjectModel.usageType.serviceQuality: #A 7 | @ObjectModel.usageType.sizeCategory : #S 8 | @ObjectModel.usageType.dataClass: #MASTER 9 | @ObjectModel.representativeKey: 'ProductHierarchyNode' 10 | @ClientHandling.algorithm: #SESSION_VARIABLE 11 | 12 | define view I_ProductHierarchyNode //must start with "I_"; same as DDL source name in upper-camelcase notation 13 | as select from t179 14 | association [0..*] to I_ProductHierarchyNodeText as _Text on $projection.ProductHierarchyNode = _Text.ProductHierarchyNode 15 | association [0..*] to ZI_ProductHierarchyNodeHier as _Hier on $projection.ProductHierarchyNode = _Hier.ProductHierarchyNodeChild //Change 16 | { 17 | //key cast (${DatabaseFieldName} as ${DataElementWithProperLabel}) as ${GlobalFieldName}, 18 | //_${TargetPublicBasicViewNameWithoutPrefix} //expose the association for use by consumers 19 | @ObjectModel.text.association: '_Text' 20 | @ObjectModel.Hierarchy.association: '_Hier' //Change 21 | key t179.prodh as ProductHierarchyNode, 22 | t179.stufe as ProductHierarchyNodeLevel, 23 | 24 | _Text, 25 | _Hier //Change 26 | } 27 | -------------------------------------------------------------------------------- /ABAPCDSConsumptionViewFeaturesUltimateTest/zsapbc_flight_fact4.abap: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'zsflight_fact4' 2 | @AbapCatalog.compiler.compareFilter: true 3 | @Analytics.dataCategory: #FACT 4 | @AccessControl.authorizationCheck:#NOT_REQUIRED 5 | @EndUserText.label: 'Flight Fact 4' 6 | define view zsapbc_flight_fact4 with parameters 7 | @Consumption.defaultValue: 'CAD' 8 | p_display_currency : s_currcode 9 | as select from sflight inner join zsapbc_carr as scarr 10 | on sflight.carrid = scarr.carrid 11 | inner join zsapbc_flight_tabl_func( p_disp_currency: $parameters.p_display_currency ) as tabl_func 12 | on sflight.carrid = tabl_func.carrid 13 | and sflight.connid = tabl_func.connid 14 | and sflight.fldate = tabl_func.fldate { 15 | key sflight.carrid, 16 | key sflight.connid, 17 | key sflight.fldate, 18 | scarr.region, 19 | cast(substring(sflight.fldate,1,6) as abap.numc( 6 )) as flmonth, 20 | cast(substring(sflight.fldate,1,4) as abap.numc( 4 )) as flyear, 21 | sflight.currency, 22 | sflight.paymentsum as payment, 23 | $parameters.p_display_currency as disp_curr, 24 | currency_conversion( 25 | amount => sflight.paymentsum, 26 | source_currency => sflight.currency, 27 | target_currency => $parameters.p_display_currency, 28 | exchange_rate_date => sflight.fldate, 29 | exchange_rate_type => 'M', 30 | error_handling => 'SET_TO_NULL' // otherwise data inconsistencies cause a dump 31 | ) as payment_disp_curr, 32 | tabl_func.payment_disp_curr_total, 33 | cast('EA' as abap.unit(3) ) as unit, 34 | sflight.seatsmax, 35 | sflight.seatsmax_b, 36 | sflight.seatsmax_f, 37 | seatsmax + seatsmax_b + seatsmax_f as seatsmax_total, 38 | sflight.seatsocc, 39 | sflight.seatsocc_b, 40 | sflight.seatsocc_f, 41 | seatsocc + seatsocc_b + seatsocc_f as seatsocc_total 42 | } 43 | -------------------------------------------------------------------------------- /AdvancedExceptionAggregationwithABAPCDSView/ZC_ExceptionAggregationQuery.abap: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZCEXCAGGRQ' 2 | @EndUserText.label: 'Exception Aggregation' 3 | @VDM.viewType: #CONSUMPTION 4 | @Analytics.query: true 5 | define view ZC_ExceptionAggregationQuery 6 | as select from ZI_ExceptionAggregationCube 7 | { 8 | @AnalyticsDetails.query.axis: #FREE 9 | SalesDocument, 10 | @AnalyticsDetails.query.axis: #FREE 11 | SalesDocumentItem, 12 | @AnalyticsDetails.query.axis: #FREE 13 | SalesOrganization, 14 | @AnalyticsDetails.query.axis: #FREE 15 | DistributionChannel, 16 | @AnalyticsDetails.query.axis: #FREE 17 | Division, 18 | @AnalyticsDetails.query.axis: #FREE 19 | SoldToParty, 20 | @AnalyticsDetails.query.axis: #FREE 21 | Material, 22 | @AnalyticsDetails.query.axis: #COLUMNS 23 | @EndUserText.label: 'Sales Document Item Count' 24 | @AnalyticsDetails: { 25 | exceptionAggregationSteps: [ 26 | { exceptionAggregationBehavior: #COUNT , 27 | exceptionAggregationElements: ['SalesDocument','SalesDocumentItem'] } 28 | ] 29 | } 30 | @AnalyticsDetails.query.formula: '1' 0 as SalesDocumentItemCount, 31 | @AnalyticsDetails.query.axis: #COLUMNS 32 | @EndUserText.label: 'Sales Document Count' 33 | @AnalyticsDetails: { 34 | exceptionAggregationSteps: [ 35 | { exceptionAggregationBehavior: #COUNT, 36 | exceptionAggregationElements: ['SalesDocument'] } 37 | ] 38 | } 39 | @AnalyticsDetails.query.formula: '1' 0 as SalesDocumentCount, 40 | @AnalyticsDetails.query.axis: #COLUMNS 41 | @AnalyticsDetails.query.decimals: 0 42 | @EndUserText.label: 'Sales Document Avg by Sales Org' 43 | @AnalyticsDetails: { 44 | exceptionAggregationSteps: [ 45 | { exceptionAggregationBehavior: #COUNT, 46 | exceptionAggregationElements: ['SalesDocument'] }, 47 | { exceptionAggregationBehavior: #AVG, 48 | exceptionAggregationElements: ['SalesOrganization'] } 49 | ] 50 | } 51 | @AnalyticsDetails.query.formula: '1' 0 as SalesDocumentAvgBySalesOrg 52 | } 53 | -------------------------------------------------------------------------------- /CreationOfCompoundedDimensionsWithABAPCDSViews/ZI_FieldNameText.abap: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZIFLDNMTXT' 2 | @ObjectModel.dataCategory: #TEXT 3 | @VDM.viewType: #BASIC 4 | @ObjectModel.representativeKey: 'FieldName' 5 | @EndUserText.label: 'Table Field' 6 | define view ZI_FieldNameText as select from dd02l inner join dd03l on dd02l.tabname = dd03l.tabname 7 | and dd02l.as4local = dd03l.as4local 8 | and dd02l.as4vers = dd03l.as4vers 9 | inner join dd04t on dd03l.rollname = dd04t.rollname 10 | and dd03l.as4local = dd04t.as4local 11 | and dd03l.as4vers = dd04t.as4vers 12 | { 13 | key dd03l.tabname as TableName, 14 | key dd03l.fieldname as FieldName, 15 | @Semantics.language: true 16 | key dd04t.ddlanguage as Language, 17 | @Semantics.text: true 18 | cast(dd04t.scrtext_l as as4text) as FieldDescription 19 | } 20 | where ( tabclass = #tabclass.'TRANSP' or tabclass = #tabclass.'INTTAB' ) 21 | and ( dd03l.comptype = #comptype.'E' or dd03l.comptype = #comptype.' ' ) 22 | and dd03l.as4local = 'A' 23 | and dd03l.as4vers = '0000' 24 | 25 | union 26 | 27 | select from dd02l inner join dd02t on dd02l.tabname = dd02t.tabname 28 | and dd02l.as4local = dd02t.as4local 29 | and dd02l.as4vers = dd02t.as4vers 30 | { 31 | key dd02l.tabname as TableName, 32 | key cast('KEY' as fieldname) as FieldName, 33 | @Semantics.language: true 34 | key dd02t.ddlanguage as Language, 35 | @Semantics.text: true 36 | //cast(ddtext as scrtext_l) as FieldDescription 37 | ddtext as FieldDescription 38 | } 39 | where ( tabclass = #tabclass.'TRANSP' or tabclass = #tabclass.'INTTAB' ) 40 | and dd02l.as4local = 'A' 41 | and dd02l.as4vers = '0000' 42 | 43 | 44 | -------------------------------------------------------------------------------- /S4HANAEmbeddedAnalyticsInventoryAgingReport/ZI_AgingRange.abap: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZIAGINGRANGE' 2 | @VDM.viewType: #BASIC 3 | @ObjectModel.representativeKey: 'AgingRange' 4 | @Analytics.dataCategory: #DIMENSION 5 | @EndUserText.label: 'Aging Range' 6 | define view ZI_AgingRange 7 | as select from tadir 8 | { 9 | @EndUserText.label: 'Aging Range' 10 | @ObjectModel.text.element: ['AgingRangeDescription'] 11 | key cast('1' as abap.char(1)) as AgingRange, 12 | @Semantics.text: true 13 | @EndUserText.label: 'Aging Range Description' 14 | cast('Range 1' as text10) as AgingRangeDescription 15 | 16 | } 17 | where obj_name = 'ZI_AGINGRANGE' 18 | and object = 'DDLS' 19 | 20 | union all 21 | 22 | select from tadir 23 | { 24 | @EndUserText.label: 'Aging Range' 25 | @ObjectModel.text.element: ['AgingRangeDescription'] 26 | key cast('2' as abap.char(1)) as AgingRange, 27 | @Semantics.text: true 28 | @EndUserText.label: 'Aging Range Description' 29 | cast('Range 2' as text10) as AgingRangeDescription 30 | 31 | } 32 | where obj_name = 'ZI_AGINGRANGE' 33 | and object = 'DDLS' 34 | 35 | union all 36 | 37 | select from tadir 38 | { 39 | @EndUserText.label: 'Aging Range' 40 | @ObjectModel.text.element: ['AgingRangeDescription'] 41 | key cast('3' as abap.char(1)) as AgingRange, 42 | @Semantics.text: true 43 | @EndUserText.label: 'Aging Range Description' 44 | cast('Range 3' as text10) as AgingRangeDescription 45 | 46 | } 47 | where obj_name = 'ZI_AGINGRANGE' 48 | and object = 'DDLS' 49 | 50 | union all 51 | 52 | select from tadir 53 | { 54 | @EndUserText.label: 'Aging Range' 55 | @ObjectModel.text.element: ['AgingRangeDescription'] 56 | key cast('4' as abap.char(1)) as AgingRange, 57 | @Semantics.text: true 58 | @EndUserText.label: 'Aging Range Description' 59 | cast('Range 4' as text10) as AgingRangeDescription 60 | 61 | } 62 | where obj_name = 'ZI_AGINGRANGE' 63 | and object = 'DDLS' 64 | 65 | union all 66 | 67 | select from tadir 68 | { 69 | @EndUserText.label: 'Aging Range' 70 | @ObjectModel.text.element: ['AgingRangeDescription'] 71 | key cast('5' as abap.char(1)) as AgingRange, 72 | @Semantics.text: true 73 | @EndUserText.label: 'Aging Range Description' 74 | cast('Range 5' as text10) as AgingRangeDescription 75 | 76 | } 77 | where obj_name = 'ZI_AGINGRANGE' 78 | and object = 'DDLS' 79 | -------------------------------------------------------------------------------- /CreationOfCompoundedDimensionsWithABAPCDSViews/ZI_FieldName.abap: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZIFLDNM' 2 | @EndUserText.label: 'Table Field' 3 | @Analytics.dataCategory: #DIMENSION 4 | @VDM.viewType: #BASIC 5 | @ObjectModel.representativeKey: 'FieldName' 6 | @AccessControl.authorizationCheck: #NOT_REQUIRED 7 | define view ZI_FieldName as select from dd02l inner join dd03l on dd02l.tabname = dd03l.tabname 8 | and dd02l.as4local = dd03l.as4local 9 | and dd02l.as4vers = dd03l.as4vers 10 | association [0..*] to ZI_FieldNameText as _FieldNameText on $projection.TableName = _FieldNameText.TableName 11 | and $projection.FieldName = _FieldNameText.FieldName 12 | association [0..1] to ZI_TableName as _TableName on $projection.TableName = _TableName.TableName 13 | { 14 | @ObjectModel.foreignKey.association: '_TableName' 15 | key dd03l.tabname as TableName, 16 | @ObjectModel.text.association: '_FieldNameText' 17 | key dd03l.fieldname as FieldName, 18 | 19 | _FieldNameText, 20 | _TableName 21 | } 22 | where ( tabclass = #tabclass.'TRANSP' or tabclass = #tabclass.'INTTAB' ) 23 | and ( dd03l.comptype = #comptype.'E' or dd03l.comptype = #comptype.' ' ) 24 | and dd03l.as4local = 'A' 25 | and dd03l.as4vers = '0000' 26 | 27 | union 28 | 29 | select from dd02l inner join dd03l on dd02l.tabname = dd03l.tabname 30 | and dd02l.as4local = dd03l.as4local 31 | and dd02l.as4vers = dd03l.as4vers 32 | association [0..*] to ZI_FieldNameText as _FieldNameText on $projection.TableName = _FieldNameText.TableName 33 | and $projection.FieldName = _FieldNameText.FieldName 34 | association [0..1] to ZI_TableName as _TableName on $projection.TableName = _TableName.TableName 35 | 36 | { 37 | @ObjectModel.foreignKey.association: '_TableName' 38 | key dd03l.tabname as TableName, 39 | @ObjectModel.text.association: '_FieldNameText' 40 | key cast('KEY' as fieldname) as FieldName, 41 | 42 | _FieldNameText, 43 | _TableName 44 | } 45 | where ( tabclass = #tabclass.'TRANSP' or tabclass = #tabclass.'INTTAB' ) 46 | and ( dd03l.comptype = #comptype.'E' or dd03l.comptype = #comptype.' ' ) 47 | and dd03l.as4local = 'A' 48 | and dd03l.as4vers = '0000' 49 | -------------------------------------------------------------------------------- /S4HANAEmbeddedAnalyticsSpendReporting/ZCL_RSROA_VARIABLES_EXIT.txt: -------------------------------------------------------------------------------- 1 | class ZCL_RSROA_VARIABLES_EXIT definition 2 | public 3 | final 4 | create public . 5 | 6 | public section. 7 | 8 | interfaces IF_BADI_INTERFACE . 9 | interfaces IF_RSROA_VARIABLES_EXIT_BADI . 10 | protected section. 11 | private section. 12 | 13 | methods GET_POSTINGDATE 14 | returning 15 | value(RT_RANGE) type RSR_T_RANGESID . 16 | methods CHECK 17 | importing 18 | !I_T_VAR_RANGE type RRS0_T_VAR_RANGE 19 | returning 20 | value(RT_RANGE) type RSR_T_RANGESID 21 | raising 22 | CX_RS_ERROR . 23 | methods CHECK_POSTINGDATE 24 | importing 25 | !I_T_VAR_RANGE type RRS0_T_VAR_RANGE 26 | returning 27 | value(RT_RANGE) type RSR_T_RANGESID 28 | raising 29 | CX_RS_ERROR . 30 | ENDCLASS. 31 | 32 | 33 | 34 | CLASS ZCL_RSROA_VARIABLES_EXIT IMPLEMENTATION. 35 | 36 | METHOD if_rsroa_variables_exit_badi~process. 37 | 38 | TRY. 39 | c_t_range = 40 | COND #( WHEN NOT c_t_range[] IS INITIAL 41 | THEN c_t_range 42 | WHEN i_step = 1 43 | THEN COND #( WHEN i_vnam = 'POSTINGDATE' 44 | THEN get_postingdate( ) ) 45 | WHEN i_step = 3 46 | THEN check( i_t_var_range ) ). 47 | CATCH cx_rs_error. 48 | RAISE EXCEPTION TYPE cx_rs_error. 49 | ENDTRY. 50 | 51 | ENDMETHOD. 52 | 53 | 54 | METHOD get_postingdate. 55 | 56 | rt_range = VALUE #( ( sign = 'I' 57 | opt = 'BT' 58 | low = cl_hrpad_date_computations=>add_months_to_date( 59 | start_date = sy-datum 60 | months = -12 ) 61 | high = sy-datum ) ). 62 | 63 | ENDMETHOD. 64 | 65 | METHOD check. 66 | 67 | TRY. 68 | IF line_exists( i_t_var_range[ vnam = 'POSTINGDATE' ] ). 69 | check_postingdate( i_t_var_range ). 70 | ENDIF. 71 | CATCH cx_rs_error. 72 | RAISE EXCEPTION TYPE cx_rs_error. 73 | ENDTRY. 74 | rt_range = VALUE #( ). 75 | 76 | ENDMETHOD. 77 | 78 | 79 | METHOD check_postingdate. 80 | TRY. 81 | DATA(w_date_from) = CONV d( i_t_var_range[ vnam = 'POSTINGDATE' ]-low ). 82 | DATA(w_date_to) = CONV d( i_t_var_range[ vnam = 'POSTINGDATE' ]-high ). 83 | IF w_date_to - w_date_from > 366. 84 | CALL FUNCTION 'RRMS_MESSAGE_HANDLING' 85 | EXPORTING 86 | i_class = 'OO' 87 | i_type = 'E' 88 | i_number = '000' 89 | i_msgv1 = 'Posting Date range is more then 366 days'. 90 | RAISE EXCEPTION TYPE cx_rs_error. 91 | ENDIF. 92 | CATCH cx_sy_itab_line_not_found. 93 | ENDTRY. 94 | 95 | ENDMETHOD. 96 | 97 | ENDCLASS. -------------------------------------------------------------------------------- /MonthGenericValueHelp/Z_MONTH_F4_DEMO_APPL.abap: -------------------------------------------------------------------------------- 1 | *&---------------------------------------------------------------------* 2 | *& Include Z_MONTH_F4_DEMO_APPL 3 | *&---------------------------------------------------------------------* 4 | 5 | *---------------------------------------------------------------------* 6 | * CLASS lcl_application DEFINITION 7 | *---------------------------------------------------------------------* 8 | CLASS lcl_application DEFINITION CREATE PRIVATE. 9 | PUBLIC SECTION. 10 | CLASS-DATA: 11 | application TYPE REF TO lcl_application. 12 | CLASS-METHODS: 13 | main. 14 | PRIVATE SECTION. 15 | TYPES: 16 | t_month TYPE RANGE OF rsfiscper6. 17 | DATA: 18 | _t_data TYPE TABLE OF sflight. 19 | METHODS: 20 | constructor IMPORTING it_month TYPE t_month, 21 | display_data. 22 | ENDCLASS. 23 | 24 | *---------------------------------------------------------------------* 25 | * CLASS lcl_application IMPLEMENTATION 26 | *---------------------------------------------------------------------* 27 | CLASS lcl_application IMPLEMENTATION. 28 | 29 | *---------------------------------------------------------------------* 30 | * main 31 | *---------------------------------------------------------------------* 32 | METHOD main. 33 | 34 | DATA(application) = NEW lcl_application( it_month = s_month[] ). 35 | application->display_data( ). 36 | 37 | ENDMETHOD. 38 | 39 | *---------------------------------------------------------------------* 40 | * constructor 41 | *---------------------------------------------------------------------* 42 | METHOD constructor. 43 | 44 | TRY. 45 | DATA(w_date_from) = CONV d( |{ it_month[ 1 ]-low }| && '01' ). 46 | CASE it_month[ 1 ]-option. 47 | WHEN 'EQ'. 48 | DATA(w_date_to) = w_date_from. 49 | WHILE w_date_to+4(2) = it_month[ 1 ]-low+4(2). 50 | w_date_to = w_date_to + 1. 51 | ENDWHILE. 52 | w_date_to = w_date_to - 1. 53 | WHEN 'BT'. 54 | w_date_to = CONV d( |{ it_month[ 1 ]-high }| && '01' ). 55 | WHILE w_date_to+4(2) = it_month[ 1 ]-high+4(2). 56 | w_date_to = w_date_to + 1. 57 | ENDWHILE. 58 | w_date_to = w_date_to - 1. 59 | ENDCASE. 60 | * 61 | SELECT * 62 | INTO TABLE _t_data 63 | FROM sflight 64 | WHERE fldate BETWEEN w_date_from AND w_date_to 65 | ORDER BY fldate. 66 | CATCH cx_sy_itab_line_not_found INTO DATA(itab_line_not_found). 67 | ENDTRY. 68 | 69 | ENDMETHOD. 70 | 71 | *---------------------------------------------------------------------* 72 | * display_data 73 | *---------------------------------------------------------------------* 74 | METHOD display_data. 75 | 76 | cl_salv_table=>factory( 77 | IMPORTING r_salv_table = DATA(alv) 78 | CHANGING t_table = _t_data ). 79 | alv->display( ). 80 | 81 | ENDMETHOD. 82 | 83 | ENDCLASS. -------------------------------------------------------------------------------- /S4HANAEmbeddedAnalyticsSpendReporting/ZI_SpendExceptionFact.abap: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZISPENDEXCF' 2 | @AccessControl.authorizationCheck: #CHECK 3 | @VDM.viewType: #BASIC 4 | @Analytics.dataCategory: #FACT 5 | @EndUserText.label: 'Spend Exception' 6 | @Metadata.ignorePropagatedAnnotations: true 7 | define view ZI_SpendExceptionFact 8 | as select from ZI_ReceivablesPayablesItem as I_ReceivablesPayablesItem inner join ZI_SpendExceptionJournalEntry1 as SpendException 9 | on I_ReceivablesPayablesItem.CompanyCode = SpendException.CompanyCode 10 | and I_ReceivablesPayablesItem.AccountingDocument = SpendException.AccountingDocument 11 | and I_ReceivablesPayablesItem.FiscalYear = SpendException.FiscalYear 12 | left outer join I_CalendarDate 13 | on I_ReceivablesPayablesItem.PostingDate = I_CalendarDate.CalendarDate 14 | { 15 | key I_ReceivablesPayablesItem.CompanyCode, 16 | key I_ReceivablesPayablesItem.AccountingDocument, 17 | key I_ReceivablesPayablesItem.FiscalYear, 18 | key I_ReceivablesPayablesItem.AccountingDocumentItem, 19 | key I_ReceivablesPayablesItem.Creditor as Supplier, 20 | I_ReceivablesPayablesItem.AccountingDocumentType, 21 | I_ReceivablesPayablesItem.PostingKey, 22 | I_ReceivablesPayablesItem.LineItemID, 23 | I_ReceivablesPayablesItem.ClearingAccountingDocument, 24 | I_ReceivablesPayablesItem.ClearingDocFiscalYear, 25 | I_ReceivablesPayablesItem.ClearingItem, 26 | I_ReceivablesPayablesItem.GLAccount, 27 | I_ReceivablesPayablesItem.ControllingArea, 28 | I_ReceivablesPayablesItem.CostCenter, 29 | I_ReceivablesPayablesItem.Reference3IDByBusinessPartner, 30 | I_ReceivablesPayablesItem.PaymentTerms, 31 | I_ReceivablesPayablesItem.PostingDate, 32 | @Semantics.calendar.yearMonth: true 33 | I_CalendarDate.YearMonth as PostingMonth, 34 | I_ReceivablesPayablesItem.CompanyCodeCurrency, 35 | I_ReceivablesPayablesItem.TransactionCurrency, 36 | @EndUserText.label: 'Group Currency' 37 | I_ReceivablesPayablesItem.AdditionalCurrency1 as GroupCurrency, 38 | I_ReceivablesPayablesItem.AmountInCompanyCodeCurrency, 39 | I_ReceivablesPayablesItem.AmountInTransactionCurrency, 40 | @EndUserText.label: 'Amount in Group Currency' 41 | I_ReceivablesPayablesItem.AmountInAdditionalCurrency1 as AmountInGroupCurrency 42 | } 43 | where I_ReceivablesPayablesItem.AccountingDocumentCategory = '' 44 | and I_ReceivablesPayablesItem.FinancialAccountType = 'K' 45 | and ( I_ReceivablesPayablesItem.PostingKey = '21' or 46 | I_ReceivablesPayablesItem.PostingKey = '22' or 47 | I_ReceivablesPayablesItem.PostingKey = '24' or 48 | I_ReceivablesPayablesItem.PostingKey = '31' or 49 | I_ReceivablesPayablesItem.PostingKey = '32' or 50 | I_ReceivablesPayablesItem.PostingKey = '34' ) 51 | and I_ReceivablesPayablesItem.SpecialGLCode = '' 52 | -------------------------------------------------------------------------------- /ABAPCDSConsumptionViewFeaturesUltimateTest/zsapbc_region3.abap: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZREGION3' 2 | @AccessControl.authorizationCheck:#NOT_REQUIRED 3 | @EndUserText.label: 'Flight - Region ' 4 | define view zsapbc_region3 as select distinct from zsapbc_carr { 5 | key region, 6 | case 7 | when region = 'US' or region = 'Canada' then 'North America' 8 | 9 | when region = 'South Africa' then 'Africa' 10 | when region = 'Fiji' or region = 'Japan' or region = 'Singapure' then 'Asia' 11 | else 'Other' 12 | end as main_region, 13 | cast( '00010101' as abap.dats ) as datefrom, 14 | cast( '99991231' as abap.dats ) as dateto 15 | } 16 | where region <> 'Australia' and region <> 'Germany' and region <> 'France' and region <> 'Italy' and 17 | region <> 'UK' and region <> 'Austria' and region <> 'Swirzerland' 18 | 19 | union 20 | 21 | select distinct from zsapbc_carr { 22 | key region, 23 | 'Europe' as main_region, 24 | cast( '00010101' as abap.dats ) as datefrom, 25 | cast( '19931031' as abap.dats ) as dateto 26 | } 27 | where region = 'Germany' or region = 'France' or region = 'Italy' or 28 | region = 'UK' or region = 'Austria' or region = 'Swirzerland' 29 | 30 | union 31 | 32 | select distinct from zsapbc_carr { 33 | key region, 34 | 'EU' as main_region, 35 | cast( '19931031' as abap.dats ) as datefrom, 36 | cast( '99991231' as abap.dats ) as dateto 37 | } 38 | where region = 'Germany' or region = 'France' or region = 'Italy' or 39 | region = 'UK' or region = 'Austria' or region = 'Swirzerland' 40 | 41 | union 42 | 43 | select distinct from scarr { 44 | 45 | key 'Europe' as region, 46 | 'World' as main_region, 47 | cast( '00010101' as abap.dats ) as datefrom, 48 | cast( '19931031' as abap.dats ) as dateto 49 | } 50 | 51 | union 52 | 53 | select distinct from scarr { 54 | 55 | key 'EU' as region, 56 | 'World' as main_region, 57 | cast( '19931101' as abap.dats ) as datefrom, 58 | cast( '99991231' as abap.dats ) as dateto 59 | } 60 | 61 | union 62 | 63 | select distinct from scarr { 64 | 65 | key 'North America' as region, 66 | 'World' as main_region, 67 | cast( '00010101' as abap.dats ) as datefrom, 68 | cast( '99991231' as abap.dats ) as dateto 69 | } 70 | 71 | union 72 | 73 | select distinct from scarr { 74 | 75 | key 'Asia' as region, 76 | 'World' as main_region, 77 | cast( '00010101' as abap.dats ) as datefrom, 78 | cast( '99991231' as abap.dats ) as dateto 79 | } 80 | 81 | union 82 | 83 | select distinct from scarr { 84 | 85 | key 'Australia' as region, 86 | 'World' as main_region, 87 | cast( '00010101' as abap.dats ) as datefrom, 88 | cast( '99991231' as abap.dats ) as dateto 89 | } 90 | 91 | union 92 | 93 | select distinct from scarr { 94 | 95 | key 'Africa' as region, 96 | 'World' as main_region, 97 | cast( '00010101' as abap.dats ) as datefrom, 98 | cast( '99991231' as abap.dats ) as dateto 99 | } 100 | 101 | union 102 | 103 | select distinct from scarr { 104 | 105 | key 'World' as region, 106 | '' as main_region, 107 | cast( '00010101' as abap.dats ) as datefrom, 108 | cast( '99991231' as abap.dats ) as dateto 109 | } 110 | -------------------------------------------------------------------------------- /ABAPCDSConsumptionViewFeaturesUltimateTest/zsapbc_flight_query.abap: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZFLIGHT_QUERY' 2 | @AbapCatalog.compiler.compareFilter: true 3 | @AccessControl.authorizationCheck:#CHECK 4 | @VDM.viewType: #CONSUMPTION 5 | @Analytics.query: true 6 | @EndUserText.label: 'Flight Query' 7 | define view zsapbc_flight_query with parameters 8 | @EndUserText.label: 'Display Currency' 9 | @Consumption.defaultValue: 'CAD' 10 | p_display_currency : s_currcode, 11 | @EndUserText.label: 'Year 1' 12 | @Consumption.defaultValue: '2016' 13 | p_year_1: rscalyear, 14 | @EndUserText.label: 'Year 2' 15 | @Consumption.defaultValue: '2017' 16 | p_year_2: rscalyear 17 | as select from zsapbc_flight_cube( p_display_currency: $parameters.p_display_currency, 18 | p_year_1: $parameters.p_year_1, 19 | p_year_2: $parameters.p_year_2 ) { 20 | @AnalyticsDetails.query.axis: #ROWS 21 | @AnalyticsDetails.query.displayHierarchy: #ON 22 | @Consumption.filter: { selectionType: #HIERARCHY_NODE, multipleSelections: true, mandatory: false } 23 | @AnalyticsDetails.query.hierarchyInitialLevel: 3 24 | region, 25 | @AnalyticsDetails.query.axis: #COLUMNS 26 | seatsocc_total_year_1, 27 | @AnalyticsDetails.query.axis: #COLUMNS 28 | seatsmax_total_year_1, 29 | @AnalyticsDetails.query.axis: #COLUMNS 30 | @AnalyticsDetails.query.decimals: 1 31 | @EndUserText.label: 'Seats Occ (%) Year 1' 32 | @AnalyticsDetails.query.formula: 'NDIV0( NODIM( seatsocc_total_year_1 ) / 33 | NODIM( seatsmax_total_year_1 ) ) * hundred ' 34 | 1 as seats_occ_prc_year_1, 35 | @AnalyticsDetails.query.axis: #COLUMNS 36 | seatsocc_total_year_2, 37 | @AnalyticsDetails.query.axis: #COLUMNS 38 | seatsmax_total_year_2, 39 | @AnalyticsDetails.query.axis: #COLUMNS 40 | @AnalyticsDetails.query.decimals: 1 41 | @EndUserText.label: 'Seats Occ (%) Year 2' 42 | @AnalyticsDetails.query.formula: 'NDIV0( NODIM( seatsocc_total_year_2 ) / 43 | NODIM( seatsmax_total_year_2 ) ) * hundred ' 44 | 1 as seats_occ_prc_year_2, 45 | @AnalyticsDetails.query.axis: #COLUMNS 46 | zsapbc_flight_cube.payment_year_1, 47 | @AnalyticsDetails.query.axis: #COLUMNS 48 | zsapbc_flight_cube.payment_year_2, 49 | @AnalyticsDetails.query.axis: #COLUMNS 50 | zsapbc_flight_cube.payment_disp_curr_year_1, 51 | @AnalyticsDetails.query.axis: #COLUMNS 52 | zsapbc_flight_cube.payment_disp_curr_year_2, 53 | @AnalyticsDetails.query.axis: #FREE 54 | connid, 55 | @AnalyticsDetails.query.axis: #FREE 56 | @Consumption.filter: {selectionType: #SINGLE, multipleSelections: true, mandatory: false } 57 | carrid, 58 | @AnalyticsDetails.query.axis: #FREE 59 | fldate, 60 | @AnalyticsDetails.query.axis: #FREE 61 | flmonth, 62 | @AnalyticsDetails.query.axis: #FREE 63 | flyear, 64 | @AnalyticsDetails.query.axis: #FREE 65 | currency, 66 | @AnalyticsDetails.query.axis: #FREE 67 | disp_curr, 68 | @AnalyticsDetails.query.axis: #FREE 69 | unit 70 | } -------------------------------------------------------------------------------- /ABAPCDSConsumptionViewFeaturesUltimateTest/zsapbc_flight_cube5.abap: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZSFLIGHT_CUBE5' 2 | @AbapCatalog.compiler.compareFilter: true 3 | @AbapCatalog.preserveKey: true 4 | @Analytics.dataCategory: #CUBE 5 | @VDM.viewType: #COMPOSITE 6 | @AccessControl.authorizationCheck: #CHECK 7 | @EndUserText.label: 'Flights' 8 | define view zsapbc_flight_cube5 with parameters 9 | p_display_currency : s_currcode 10 | as select from zsapbc_flight_fact( p_display_currency: $parameters.p_display_currency ) as flight 11 | association [1..1] to zsapbc_carr_dimension as _carr on $projection.carrid = flight.carrid 12 | association [1..1] to zsapbc_region_dimension as _region on $projection.region = flight.region 13 | { 14 | @ObjectModel.foreignKey.association: '_carr' 15 | key flight.carrid, 16 | key flight.connid, 17 | @EndUserText.label: 'Date' 18 | key flight.fldate, 19 | @EndUserText.label: 'Region' 20 | @ObjectModel.foreignKey.association: '_region' 21 | flight.region, 22 | _carr, 23 | _region, 24 | @Semantics.calendar.yearMonth: true 25 | @EndUserText.label: 'Month' 26 | flight.flmonth, 27 | @Semantics.calendar.year: true 28 | @EndUserText.label: 'Year' 29 | flight.flyear, 30 | @Semantics.currencyCode: true 31 | @EndUserText.label: 'Booking Currency' 32 | flight.currency, 33 | @Semantics.amount.currencyCode: 'Currency' 34 | @DefaultAggregation: #SUM 35 | @EndUserText.label: 'Booking (bc)' 36 | flight.payment, 37 | @EndUserText.label: 'Display Currency' 38 | cast('CAD' as abap.cuky( 5 )) as disp_curr, 39 | @Semantics.amount.currencyCode: 'disp_curr' 40 | @EndUserText.label: 'Booking (dc)' 41 | @DefaultAggregation: #SUM 42 | flight.payment_disp_curr, 43 | @Semantics.unitOfMeasure: true 44 | @EndUserText.label: 'UOM' 45 | flight.unit, 46 | @Semantics.unitOfMeasure: true 47 | @EndUserText.label: '%' 48 | cast( '%' as abap.unit( 3 ) ) as unit_percent, 49 | @Semantics.quantity.unitOfMeasure: 'unit' 50 | @DefaultAggregation: #SUM 51 | @EndUserText.label: 'Seats Max Econ.' 52 | flight.seatsmax, 53 | @Semantics.quantity.unitOfMeasure: 'unit' 54 | @DefaultAggregation: #SUM 55 | @EndUserText.label: 'Seats Max Bus.' 56 | flight.seatsmax_b, 57 | @Semantics.quantity.unitOfMeasure: 'unit' 58 | @DefaultAggregation: #SUM 59 | @EndUserText.label: 'Seats Max 1st' 60 | flight.seatsmax_f, 61 | @Semantics.quantity.unitOfMeasure: 'unit' 62 | @DefaultAggregation: #SUM 63 | @EndUserText.label: 'Seats Max Total' 64 | seatsmax_total, 65 | @Semantics.quantity.unitOfMeasure: 'unit' 66 | @DefaultAggregation: #SUM 67 | @EndUserText.label: 'Seats Occ Econ.' 68 | flight.seatsocc, 69 | @Semantics.quantity.unitOfMeasure: 'unit' 70 | @DefaultAggregation: #SUM 71 | @EndUserText.label: 'Seats Occ Bus.' 72 | flight.seatsocc_b, 73 | @Semantics.quantity.unitOfMeasure: 'unit' 74 | @DefaultAggregation: #SUM 75 | @EndUserText.label: 'Seats Occ 1st' 76 | flight.seatsocc_f, 77 | @Semantics.quantity.unitOfMeasure: 'unit' 78 | @DefaultAggregation: #SUM 79 | @EndUserText.label: 'Seats Occ Total' 80 | seatsocc_total, 81 | @Semantics.quantity.unitOfMeasure: 'unit_percent' 82 | @DefaultAggregation: #MAX 83 | @EndUserText.label: '100%' 84 | 100 as hundred 85 | } 86 | -------------------------------------------------------------------------------- /ABAPCDSConsumptionViewFeaturesUltimateTest/zsapbc_flight_query5.abap: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZFLIGHT_QUERY5' 2 | @AbapCatalog.compiler.compareFilter: true 3 | @AccessControl.authorizationCheck:#CHECK 4 | @VDM.viewType: #CONSUMPTION 5 | @Analytics.query: true 6 | @EndUserText.label: 'Flight Query' 7 | define view zsapbc_flight_query5 with parameters 8 | @EndUserText.label: 'Display Currency' 9 | @Consumption.defaultValue: 'CAD' 10 | p_display_currency : s_currcode 11 | as select from zsapbc_flight_cube5( p_display_currency: $parameters.p_display_currency ) { 12 | @AnalyticsDetails.query.axis: #ROWS 13 | @AnalyticsDetails.query.displayHierarchy: #ON 14 | @Consumption.filter: { selectionType: #HIERARCHY_NODE, multipleSelections: true, mandatory: false } 15 | @AnalyticsDetails.query.hierarchyInitialLevel: 3 16 | @AnalyticsDetails.query.variableSequence: 1 17 | region, 18 | @AnalyticsDetails.query.axis: #FREE 19 | connid, 20 | @AnalyticsDetails.query.axis: #FREE 21 | @Consumption.filter: {selectionType: #RANGE, multipleSelections: true, mandatory: false } 22 | @AnalyticsDetails.query.variableSequence: 2 23 | carrid, 24 | @AnalyticsDetails.query.axis: #FREE 25 | fldate, 26 | @AnalyticsDetails.query.axis: #FREE 27 | flmonth, 28 | @AnalyticsDetails.query.axis: #FREE 29 | @Consumption.filter: {selectionType: #RANGE, multipleSelections: true, mandatory: false } 30 | @AnalyticsDetails.query.variableSequence: 3 31 | flyear, 32 | @AnalyticsDetails.query.axis: #FREE 33 | currency, 34 | @AnalyticsDetails.query.axis: #FREE 35 | disp_curr, 36 | @AnalyticsDetails.query.axis: #FREE 37 | unit, 38 | @AnalyticsDetails.query.axis: #COLUMNS 39 | seatsocc_total, 40 | @AnalyticsDetails.query.axis: #COLUMNS 41 | seatsmax_total, 42 | @AnalyticsDetails.query.axis: #COLUMNS 43 | @AnalyticsDetails.query.decimals: 1 44 | @EndUserText.label: 'Seats Occ (%)' 45 | @AnalyticsDetails.query.formula: 'NDIV0( NODIM( seatsocc_total ) / 46 | NODIM( seatsmax_total ) ) * hundred ' 47 | 1 as seats_occ_prc, 48 | @EndUserText.label: 'Low Occupied Flight Count' 49 | @AnalyticsDetails: { 50 | exceptionAggregationSteps: [{ 51 | exceptionAggregationBehavior: #SUM, 52 | exceptionAggregationElements: ['carrid', 'connid','fldate' ] }] 53 | } 54 | @AnalyticsDetails.query.axis: #COLUMNS 55 | @AnalyticsDetails.query.formula: 'case when $projection.seats_occ_prc < 96 then 1 else 0 end' 56 | 0 as flight_cnt_low_occ, 57 | 58 | @EndUserText.label: 'High Occupied Flight Count' 59 | @AnalyticsDetails: { 60 | exceptionAggregationSteps: [{ 61 | exceptionAggregationBehavior: #SUM, 62 | exceptionAggregationElements: ['carrid', 'connid','fldate' ] }] 63 | } 64 | @AnalyticsDetails.query.axis: #COLUMNS 65 | @AnalyticsDetails.query.formula: 'case when $projection.seats_occ_prc >= 96 then 1 else 0 end' 66 | 0 as flight_cnt_high_occ, 67 | @EndUserText.label: 'Flight Count' 68 | @AnalyticsDetails: { 69 | exceptionAggregationSteps: [{ 70 | exceptionAggregationBehavior: #COUNT, 71 | exceptionAggregationElements: ['carrid', 'connid','fldate' ] }] 72 | } 73 | 0 as flight_cnt, 74 | @AnalyticsDetails.query.hidden: true 75 | @AnalyticsDetails.query.axis: #COLUMNS 76 | payment, 77 | @AnalyticsDetails.query.hidden: true 78 | @AnalyticsDetails.query.axis: #COLUMNS 79 | payment_disp_curr 80 | } 81 | -------------------------------------------------------------------------------- /ABAPCDSConsumptionViewFeaturesUltimateTest/zsapbc_flight_query2.abap: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZFLIGHT_QUERY2' 2 | @AbapCatalog.compiler.compareFilter: true 3 | @AccessControl.authorizationCheck:#CHECK 4 | @VDM.viewType: #CONSUMPTION 5 | @Analytics.query: true 6 | @EndUserText.label: 'Flight Query' 7 | define view zsapbc_flight_query2 with parameters 8 | @EndUserText.label: 'Display Currency' 9 | @Consumption.defaultValue: 'CAD' 10 | p_display_currency : s_currcode, 11 | @EndUserText.label: 'Year 1' 12 | @Consumption.derivation: {lookupEntity: 'ZSAPBC_CURR_YEAR_ADD_N', resultElement: 'p_year' , 13 | binding: [{ targetParameter: 'p_offset', type: #CONSTANT, value: -1 }]} 14 | p_year_1: rscalyear, 15 | @EndUserText.label: 'Year 2' 16 | @Consumption.derivation: {lookupEntity: 'ZSAPBC_CURR_YEAR_ADD_N', resultElement: 'p_year', 17 | binding: [{ targetParameter: 'p_offset', type:#CONSTANT , value: 0 }] } 18 | p_year_2: rscalyear 19 | as select from zsapbc_flight_cube( p_display_currency: $parameters.p_display_currency, 20 | p_year_1: $parameters.p_year_1, 21 | p_year_2: $parameters.p_year_2 ) { 22 | @AnalyticsDetails.query.axis: #ROWS 23 | @AnalyticsDetails.query.displayHierarchy: #ON 24 | @Consumption.filter: { selectionType: #HIERARCHY_NODE, multipleSelections: true, mandatory: false } 25 | @AnalyticsDetails.query.hierarchyInitialLevel: 3 26 | region, 27 | @AnalyticsDetails.query.axis: #COLUMNS 28 | seatsocc_total_year_1, 29 | @AnalyticsDetails.query.axis: #COLUMNS 30 | seatsmax_total_year_1, 31 | @AnalyticsDetails.query.axis: #COLUMNS 32 | @AnalyticsDetails.query.decimals: 1 33 | @EndUserText.label: 'Seats Occ (%) Year 1' 34 | @AnalyticsDetails.query.formula: 'NDIV0( NODIM( seatsocc_total_year_1 ) / 35 | NODIM( seatsmax_total_year_1 ) ) * hundred ' 36 | 1 as seats_occ_prc_year_1, 37 | @AnalyticsDetails.query.axis: #COLUMNS 38 | seatsocc_total_year_2, 39 | @AnalyticsDetails.query.axis: #COLUMNS 40 | seatsmax_total_year_2, 41 | @AnalyticsDetails.query.axis: #COLUMNS 42 | @AnalyticsDetails.query.decimals: 1 43 | @EndUserText.label: 'Seats Occ (%) Year 2' 44 | @AnalyticsDetails.query.formula: 'NDIV0( NODIM( seatsocc_total_year_2 ) / 45 | NODIM( seatsmax_total_year_2 ) ) * hundred ' 46 | 1 as seats_occ_prc_year_2, 47 | @AnalyticsDetails.query.axis: #COLUMNS 48 | zsapbc_flight_cube.payment_year_1, 49 | @AnalyticsDetails.query.axis: #COLUMNS 50 | zsapbc_flight_cube.payment_year_2, 51 | @AnalyticsDetails.query.axis: #COLUMNS 52 | zsapbc_flight_cube.payment_disp_curr_year_1, 53 | @AnalyticsDetails.query.axis: #COLUMNS 54 | zsapbc_flight_cube.payment_disp_curr_year_2, 55 | @AnalyticsDetails.query.axis: #FREE 56 | connid, 57 | @AnalyticsDetails.query.axis: #FREE 58 | @Consumption.filter: {selectionType: #SINGLE, multipleSelections: true, mandatory: false } 59 | carrid, 60 | @AnalyticsDetails.query.axis: #FREE 61 | fldate, 62 | @AnalyticsDetails.query.axis: #FREE 63 | flmonth, 64 | @AnalyticsDetails.query.axis: #FREE 65 | flyear, 66 | @AnalyticsDetails.query.axis: #FREE 67 | currency, 68 | @AnalyticsDetails.query.axis: #FREE 69 | disp_curr, 70 | @AnalyticsDetails.query.axis: #FREE 71 | unit 72 | } 73 | -------------------------------------------------------------------------------- /AddValuetoYourS4HANAEmbeddedAnalyticsContentwithMaterialHierarchy/I_Material.txt: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'IMATERIAL' 2 | @Analytics: { dataCategory: #DIMENSION, dataExtraction.enabled: true } 3 | @VDM.viewType: #BASIC 4 | @EndUserText.label: 'Material' 5 | @ObjectModel.representativeKey: 'Material' 6 | @AccessControl.authorizationCheck: #NOT_REQUIRED 7 | @Search.searchable: true 8 | 9 | @ObjectModel.usageType.serviceQuality: #A 10 | @ObjectModel.usageType.sizeCategory : #M 11 | @ObjectModel.usageType.dataClass: #MASTER 12 | @ClientHandling.algorithm: #SESSION_VARIABLE 13 | 14 | 15 | define view I_Material as select from mara 16 | association [0..*] to I_MaterialText as _Text on $projection.Material = _Text.Material 17 | association [0..1] to I_MaterialType as _MaterialType on $projection.MaterialType = _MaterialType.MaterialType 18 | association [0..1] to I_MaterialGroup as _MaterialGroup on $projection.MaterialGroup = _MaterialGroup.MaterialGroup 19 | association [0..1] to I_UnitOfMeasure as _BaseUnit on $projection.MaterialBaseUnit = _BaseUnit.UnitOfMeasure 20 | association [0..1] to I_UnitOfMeasure as _WeightUnit on $projection.MaterialWeightUnit = _WeightUnit.UnitOfMeasure 21 | association [0..*] to I_MaterialPlant as _MaterialPlant on $projection.Material = _MaterialPlant.Material 22 | association [0..*] to ZI_MaterialHier as _Hier on $projection.Material = _Hier.material //Change 23 | { 24 | --@EndUserText.label: 'Material' 25 | @Search.defaultSearchElement: true 26 | @Search.fuzzinessThreshold: 0.8 27 | @ObjectModel.text.association: '_Text' 28 | @ObjectModel.Hierarchy.association: '_Hier' //Change 29 | key mara.matnr as Material, _Text, 30 | 31 | --@EndUserText.label: 'Material Type' 32 | mara.mtart as MaterialType, _MaterialType, 33 | 34 | --@EndUserText.label: 'Material Group' 35 | mara.matkl as MaterialGroup, _MaterialGroup, 36 | 37 | --@EndUserText.label: 'Base Unit of Measure' 38 | @Semantics.unitOfMeasure: true 39 | @ObjectModel.foreignKey.association: '_BaseUnit' 40 | mara.meins as MaterialBaseUnit, _BaseUnit, 41 | 42 | --@EndUserText.label: 'Gross Weight' 43 | @Semantics.quantity.unitOfMeasure: 'MaterialWeightUnit' 44 | @DefaultAggregation: #NONE 45 | mara.brgew as MaterialGrossWeight, 46 | 47 | --@EndUserText.label: 'Net Weight' 48 | @Semantics.quantity.unitOfMeasure: 'MaterialWeightUnit' 49 | @DefaultAggregation: #NONE 50 | mara.ntgew as MaterialNetWeight, 51 | 52 | --@EndUserText.label: 'Weight Unit' 53 | @Semantics.unitOfMeasure: true 54 | @ObjectModel.foreignKey.association: '_WeightUnit' 55 | mara.gewei as MaterialWeightUnit, _WeightUnit, 56 | 57 | mara.mfrnr as MaterialManufacturerNumber, 58 | mara.mfrpn as MaterialManufacturerPartNumber, 59 | mara.begru as AuthorizationGroup, 60 | mara.xchpf as IsBatchManagementRequired, 61 | 62 | 63 | _MaterialPlant, 64 | _Hier //Change 65 | 66 | } 67 | 68 | 69 | -------------------------------------------------------------------------------- /MB5LTransactionCDSViewEquivalent/ZC_StockQuantityCurrentValue.txt: -------------------------------------------------------------------------------- 1 | @AbapCatalog.preserveKey: true 2 | @AbapCatalog:{ 3 | sqlViewName: 'ZCSTOCKQUANVALCR', 4 | compiler.compareFilter: true 5 | } 6 | @AccessControl.authorizationCheck: #PRIVILEGED_ONLY 7 | @EndUserText.label: 'Current Stock Quantity and Value' 8 | @ObjectModel:{ 9 | usageType:{ 10 | sizeCategory: #XXL, 11 | serviceQuality: #C, 12 | dataClass:#TRANSACTIONAL 13 | } 14 | } 15 | @ClientHandling.algorithm: #SESSION_VARIABLE 16 | @VDM:{ 17 | viewType: #CONSUMPTION, 18 | lifecycle: 19 | { 20 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 21 | // This view can not be annotated by @OData.publish: true because the view name exceeds 26 characters 22 | // As for the consumption an OData service is requiered to be consumed via SAP Analytics Cloud (SAC) (and a role too) 23 | // this view will be deprecated and replaced by the successor view C_StockQtyCurrentValue_2 which has right now (August 2018) 24 | // the exact same structure and functionality 25 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 26 | status: #DEPRECATED, 27 | successor: 'C_StockQtyCurrentValue_2 ' 28 | } 29 | } 30 | @Analytics.query: true 31 | 32 | define view ZC_StockQuantityCurrentValue 33 | with parameters 34 | @Consumption: { 35 | defaultValue: 'EUR', 36 | valueHelpDefinition: [{ 37 | entity: { 38 | name:'I_Currency', 39 | element:'Currency' 40 | } 41 | }] 42 | } 43 | P_DisplayCurrency: nsdm_display_currency 44 | as select from ZI_StockQuantityCurrentValue (P_DisplayCurrency : $parameters.P_DisplayCurrency) 45 | { 46 | //@AnalyticsDetails.query.axis: #ROWS //Uladzislau Pralat 47 | @Consumption: { 48 | filter: { selectionType: #RANGE, 49 | mandatory: false, 50 | multipleSelections: true } 51 | } 52 | Product, 53 | //@AnalyticsDetails.query.axis: #ROWS //Uladzislau Pralat 54 | @Consumption: { 55 | filter: { selectionType: #RANGE, 56 | mandatory: false, 57 | multipleSelections: true } 58 | } 59 | Plant, 60 | StorageLocation, 61 | Batch, 62 | Supplier, 63 | SDDocument, 64 | SDDocumentItem, 65 | WBSElementInternalID, 66 | Customer, 67 | SpecialStockIdfgStockOwner, 68 | InventoryStockType, 69 | InventorySpecialStockType, 70 | ProductGroup, 71 | ProductType, 72 | 73 | MaterialBaseUnit, 74 | @AnalyticsDetails.query.axis: #ROWS //Uladzislau Pralat 75 | CompanyCode, //Uladzislau Pralat 76 | @AnalyticsDetails.query.axis: #ROWS //Uladzislau Pralat 77 | GLAccount, //Uladzislau Pralat 78 | Currency, 79 | DisplayCurrency, 80 | 81 | // Quantity and Value 82 | @AnalyticsDetails.query.axis: #COLUMNS 83 | StockValueInCCCrcy, 84 | @AnalyticsDetails.query.axis: #COLUMNS 85 | MatlWrhsStkQtyInMatlBaseUnit, 86 | @AnalyticsDetails.query.axis: #COLUMNS 87 | @AnalyticsDetails.query.hidden: true 88 | StockValueInDisplayCurrency 89 | } 90 | 91 | -------------------------------------------------------------------------------- /ABAPCDSConsumptionViewFeaturesUltimateTest/zsapbc_flight_query3.abap: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName 'ZFLIGHT_QUERY3' 2 | @AbapCatalog.compiler.compareFilter true 3 | @AccessControl.authorizationCheck#CHECK 4 | @VDM.viewType #CONSUMPTION 5 | @Analytics.query true 6 | @EndUserText.label 'Flight Query' 7 | define view zsapbc_flight_query3 with parameters 8 | @Consumption.hidden false 9 | @Environment.systemField #SYSTEM_DATE 10 | @EndUserText.label 'Key Date' 11 | p_keydate abap.dats, 12 | @EndUserText.label 'Display Currency' 13 | @Consumption.defaultValue 'CAD' 14 | p_display_currency s_currcode, 15 | @EndUserText.label 'Year 1' 16 | @Consumption.derivation {lookupEntity 'ZSAPBC_CURR_YEAR_ADD_N', resultElement 'p_year' , 17 | binding [{ targetParameter 'p_offset', type #CONSTANT, value -1 }]} 18 | p_year_1 rscalyear, 19 | @EndUserText.label 'Year 2' 20 | @Consumption.derivation {lookupEntity 'ZSAPBC_CURR_YEAR_ADD_N', resultElement 'p_year', 21 | binding [{ targetParameter 'p_offset', type#CONSTANT , value 0 }] } 22 | p_year_2 rscalyear 23 | as select from zsapbc_flight_cube3( p_display_currency $parameters.p_display_currency, 24 | p_year_1 $parameters.p_year_1, 25 | p_year_2 $parameters.p_year_2 ) { 26 | @AnalyticsDetails.query.axis #ROWS 27 | @AnalyticsDetails.query.display #TEXT 28 | @AnalyticsDetails.query.displayHierarchy #ON 29 | @Consumption.filter { selectionType #HIERARCHY_NODE, multipleSelections true, mandatory false } 30 | @AnalyticsDetails.query.hierarchyInitialLevel 3 31 | zsapbc_flight_cube3._region[datefrom = $parameters.p_keydate and dateto = $parameters.p_keydate].region, 32 | @AnalyticsDetails.query.axis #COLUMNS 33 | seatsocc_total_year_1, 34 | @AnalyticsDetails.query.axis #COLUMNS 35 | seatsmax_total_year_1, 36 | @AnalyticsDetails.query.axis #COLUMNS 37 | @AnalyticsDetails.query.decimals 1 38 | @EndUserText.label 'Seats Occ (%) Year 1' 39 | @AnalyticsDetails.query.formula 'NDIV0( NODIM( seatsocc_total_year_1 ) 40 | NODIM( seatsmax_total_year_1 ) ) hundred ' 41 | 1 as seats_occ_prc_year_1, 42 | @AnalyticsDetails.query.axis #COLUMNS 43 | seatsocc_total_year_2, 44 | @AnalyticsDetails.query.axis #COLUMNS 45 | seatsmax_total_year_2, 46 | @AnalyticsDetails.query.axis #COLUMNS 47 | @AnalyticsDetails.query.decimals 1 48 | @EndUserText.label 'Seats Occ (%) Year 2' 49 | @AnalyticsDetails.query.formula 'NDIV0( NODIM( seatsocc_total_year_2 ) 50 | NODIM( seatsmax_total_year_2 ) ) hundred ' 51 | 1 as seats_occ_prc_year_2, 52 | @AnalyticsDetails.query.axis #COLUMNS 53 | payment_year_1, 54 | @AnalyticsDetails.query.axis #COLUMNS 55 | payment_year_2, 56 | @AnalyticsDetails.query.axis #COLUMNS 57 | payment_disp_curr_year_1, 58 | @AnalyticsDetails.query.axis #COLUMNS 59 | payment_disp_curr_year_2, 60 | @AnalyticsDetails.query.axis #FREE 61 | connid, 62 | @AnalyticsDetails.query.axis #FREE 63 | @Consumption.filter {selectionType #SINGLE, multipleSelections true, mandatory false } 64 | carrid, 65 | @AnalyticsDetails.query.axis #FREE 66 | fldate, 67 | @AnalyticsDetails.query.axis #FREE 68 | flmonth, 69 | @AnalyticsDetails.query.axis #FREE 70 | flyear, 71 | @AnalyticsDetails.query.axis #FREE 72 | currency, 73 | @AnalyticsDetails.query.axis #FREE 74 | disp_curr, 75 | @AnalyticsDetails.query.axis #FREE 76 | unit 77 | } 78 | -------------------------------------------------------------------------------- /AddValuetoYourS4HANAEmbeddedAnalyticsContentwithMaterialHierarchy/ZI_ProductHierarchyNodeHier.txt: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZIPRODHNDH' 2 | @Analytics.dataCategory: #HIERARCHY 3 | @ObjectModel.representativeKey: 'ProductHierarchyChild' 4 | @AccessControl.authorizationCheck: #NOT_REQUIRED 5 | @EndUserText.label: 'Product Hierarchy' 6 | @Hierarchy.parentChild.rootNode.visibility:#ADD_ROOT_NODE 7 | //@Hierarchy.parentChild.orphanedNode.handling: #ERROR 8 | @Hierarchy.parentChild.name: 'PROD_HIER' 9 | @Hierarchy.parentChild.label: 'Product Hierarchy' 10 | @Hierarchy.parentChild: { recurse: { 11 | parent: 'ProductHierarchyNodeParent', child: 'ProductHierarchyNodeChild' } } 12 | define view ZI_ProductHierarchyNodeHier as select distinct from z_t179 as t179_child inner join z_t179 as t179_parent 13 | on t179_child.prodh3 = t179_parent.prodh3 14 | and t179_child.stufe = '4' 15 | and t179_parent.stufe = '3' 16 | association [0..1] to I_ProductHierarchyNode as _ProductHierarchyNode on $projection.ProductHierarchyNodeChild = _ProductHierarchyNode.ProductHierarchyNode 17 | { 18 | @ObjectModel.foreignKey.association: '_ProductHierarchyNode' 19 | key t179_child.prodh as ProductHierarchyNodeChild, 20 | t179_parent.prodh as ProductHierarchyNodeParent, 21 | t179_child.stufe, 22 | _ProductHierarchyNode 23 | } 24 | 25 | union 26 | 27 | select distinct from z_t179 as t179_child inner join z_t179 as t179_parent 28 | on t179_child.prodh2 = t179_parent.prodh2 29 | and t179_child.stufe = '3' 30 | and t179_parent.stufe = '2' 31 | association [0..1] to I_ProductHierarchyNode as _ProductHierarchyNode on $projection.ProductHierarchyNodeChild = _ProductHierarchyNode.ProductHierarchyNode 32 | { 33 | @ObjectModel.foreignKey.association: '_ProductHierarchyNode' 34 | key t179_child.prodh as ProductHierarchyNodeChild, 35 | t179_parent.prodh as ProductHierarchyNodeParent, 36 | t179_child.stufe, 37 | _ProductHierarchyNode 38 | } 39 | 40 | union 41 | 42 | select distinct from z_t179 as t179_child inner join z_t179 as t179_parent 43 | on t179_child.prodh1 = t179_parent.prodh1 44 | and t179_child.stufe = '2' 45 | and t179_parent.stufe = '1' 46 | association [0..1] to I_ProductHierarchyNode as _ProductHierarchyNode on $projection.ProductHierarchyNodeChild = _ProductHierarchyNode.ProductHierarchyNode 47 | { 48 | @ObjectModel.foreignKey.association: '_ProductHierarchyNode' 49 | key t179_child.prodh as ProductHierarchyNodeChild, 50 | t179_parent.prodh as ProductHierarchyNodeParent, 51 | t179_child.stufe, 52 | _ProductHierarchyNode 53 | } 54 | 55 | 56 | union 57 | 58 | select distinct from z_t179 as t179 59 | association [0..1] to I_ProductHierarchyNode as _ProductHierarchyNode on $projection.ProductHierarchyNodeChild = _ProductHierarchyNode.ProductHierarchyNode 60 | { 61 | @ObjectModel.foreignKey.association: '_ProductHierarchyNode' 62 | key t179.prodh as ProductHierarchyNodeChild, 63 | cast('' as prodh_d) as ProductHierarchyNodeParent, 64 | t179.stufe, 65 | _ProductHierarchyNode 66 | } where stufe = '1' 67 | -------------------------------------------------------------------------------- /ReportingS4HANADeliveryDataOnSalesOrderScheduleLine/ZCL_DEMO.abap: -------------------------------------------------------------------------------- 1 | class ZCL_DEMO definition 2 | public 3 | final 4 | create public . 5 | 6 | public section. 7 | INTERFACES if_amdp_marker_hdb. 8 | CLASS-METHODS function for table function zi_demo. 9 | protected section. 10 | private section. 11 | ENDCLASS. 12 | 13 | 14 | 15 | CLASS ZCL_DEMO IMPLEMENTATION. 16 | 17 | METHOD function by database function 18 | for hdb language sqlscript 19 | options read-only 20 | using vbak vbap vbep likp lips. 21 | 22 | it_lips = 23 | SELECT lips.mandt, lips.vgbel AS vbeln, lips.vgpos AS posnr, 24 | SUM( CASE likp.vbtyp WHEN 'J' 25 | THEN lips.lfimg 26 | WHEN 'T' 27 | THEN lips.lfimg * -1 28 | END ) AS lfimg 29 | FROM likp INNER JOIN lips 30 | ON likp.mandt = lips.mandt 31 | AND likp.vbeln = lips.vbeln 32 | GROUP BY lips.mandt, lips.vgbel, lips.vgpos; 33 | 34 | it_data_1 = 35 | SELECT vbak.mandt, 36 | vbak.vbeln, 37 | vbap.posnr, 38 | vbep.etenr, 39 | vbap.matnr, 40 | vbep.edatu, 41 | CASE WHEN vbak.vbtyp IN ( 'H', 'K' ) 42 | THEN vbep.wmeng * -1 43 | ELSE vbep.wmeng END AS wmeng, 44 | CASE WHEN vbak.vbtyp IN ( 'H', 'K' ) 45 | THEN vbep.bmeng * -1 46 | ELSE vbep.bmeng END AS bmeng, 47 | lips.lfimg AS lfimg_t 48 | FROM vbak INNER JOIN vbap 49 | ON vbak.mandt = vbap.mandt 50 | AND vbak.vbeln = vbap.vbeln 51 | INNER JOIN vbep 52 | ON vbap.mandt = vbep.mandt 53 | AND vbap.vbeln = vbep.vbeln 54 | AND vbap.posnr = vbep.posnr 55 | LEFT OUTER JOIN :it_lips AS lips 56 | ON vbap.mandt = lips.mandt 57 | AND vbap.vbeln = lips.vbeln 58 | AND vbap.posnr = lips.posnr; 59 | 60 | it_data_2 = 61 | SELECT mandt, 62 | vbeln, 63 | posnr, 64 | etenr, 65 | matnr, 66 | edatu, 67 | wmeng, /* Order Qty (Sched Line) */ 68 | bmeng, /* Confirmed Qty (Sched Line) */ 69 | SUM( bmeng ) OVER ( PARTITION BY mandt, vbeln, posnr ORDER BY edatu ) AS bmeng_rt, /* Confirmed Qty (Sched Line) Running Total */ 70 | lfimg_t /* Delivery Qty Total */ 71 | FROM :it_data_1; 72 | 73 | RETURN 74 | SELECT mandt, 75 | vbeln, 76 | posnr, 77 | etenr, 78 | matnr, 79 | wmeng, /* Order Qty (Sched Line) */ 80 | bmeng, /* Confirmed Qty (Sched Line) */ 81 | bmeng_rt, /* Confirmed Qty (Sched Line) Running Total */ 82 | CASE WHEN bmeng = 0 83 | THEN 0 84 | WHEN lfimg_t > bmeng_rt 85 | THEN bmeng 86 | WHEN lfimg_t >= ( bmeng_rt - bmeng ) 87 | THEN lfimg_t - ( bmeng_rt - bmeng ) 88 | ELSE 0 89 | END AS lfimg, /* Delivered Qty */ 90 | lfimg_t /* Delivered Qty Total */ 91 | FROM :it_data_2; 92 | 93 | 94 | ENDMETHOD. 95 | 96 | ENDCLASS. -------------------------------------------------------------------------------- /MonthGenericValueHelp/Z_MONTH_F4.abap: -------------------------------------------------------------------------------- 1 | *&---------------------------------------------------------------------* 2 | *& Include Z_MONTH_F4 3 | *&---------------------------------------------------------------------* 4 | 5 | *---------------------------------------------------------------------* 6 | * CLASS lcl_month DEFINITION 7 | *---------------------------------------------------------------------* 8 | CLASS lcl_month DEFINITION. 9 | PUBLIC SECTION. 10 | CLASS-METHODS: 11 | f4. 12 | ENDCLASS. 13 | 14 | *---------------------------------------------------------------------* 15 | * CLASS lcl_month IMPLEMENTATION 16 | *---------------------------------------------------------------------* 17 | CLASS lcl_month IMPLEMENTATION. 18 | *---------------------------------------------------------------------* 19 | * f4 20 | *---------------------------------------------------------------------* 21 | METHOD f4. 22 | DATA: WA_DYNPFIELDS TYPE DYNPREAD, 23 | MF_DYNPFIELDS TYPE TABLE OF DYNPREAD. 24 | DATA: MF_RETURNCODE LIKE SY-SUBRC, 25 | MF_MONAT TYPE ISELLIST-MONTH, 26 | MF_HLP_REPID LIKE SY-REPID. 27 | FIELD-SYMBOLS: TYPE ANY. 28 | 29 | * Wert von Dynpro lesen 30 | GET CURSOR FIELD WA_DYNPFIELDS-FIELDNAME. 31 | APPEND WA_DYNPFIELDS TO MF_DYNPFIELDS. 32 | MF_HLP_REPID = SY-REPID. 33 | DO 2 TIMES. 34 | CALL FUNCTION 'DYNP_VALUES_READ' 35 | EXPORTING 36 | DYNAME = MF_HLP_REPID 37 | DYNUMB = SY-DYNNR 38 | TABLES 39 | DYNPFIELDS = MF_DYNPFIELDS 40 | EXCEPTIONS 41 | INVALID_ABAPWORKAREA = 01 42 | INVALID_DYNPROFIELD = 02 43 | INVALID_DYNPRONAME = 03 44 | INVALID_DYNPRONUMMER = 04 45 | INVALID_REQUEST = 05 46 | NO_FIELDDESCRIPTION = 06 47 | UNDEFIND_ERROR = 07. 48 | IF SY-SUBRC = 3. 49 | * Aktuelles Dynpro ist Wertemengenbild 50 | MF_HLP_REPID = 'SAPLALDB'. 51 | ELSE. 52 | READ TABLE MF_DYNPFIELDS INTO WA_DYNPFIELDS INDEX 1. 53 | * Unterstriche durch Blanks ersetzen 54 | TRANSLATE WA_DYNPFIELDS-FIELDVALUE USING '_ '. 55 | EXIT. 56 | ENDIF. 57 | ENDDO. 58 | IF SY-SUBRC = 0. 59 | * Konvertierung ins interne Format 60 | CALL FUNCTION 'CONVERSION_EXIT_PERI6_INPUT' 61 | EXPORTING 62 | INPUT = WA_DYNPFIELDS-FIELDVALUE 63 | IMPORTING 64 | OUTPUT = MF_MONAT 65 | EXCEPTIONS 66 | ERROR_MESSAGE = 1. 67 | IF MF_MONAT IS INITIAL. 68 | * Monat ist initial => Vorschlagswert aus akt. Datum ableiten 69 | MF_MONAT = SY-DATLO(6). 70 | ENDIF. 71 | CALL FUNCTION 'POPUP_TO_SELECT_MONTH' 72 | EXPORTING 73 | ACTUAL_MONTH = MF_MONAT 74 | IMPORTING 75 | SELECTED_MONTH = MF_MONAT 76 | RETURN_CODE = MF_RETURNCODE 77 | EXCEPTIONS 78 | FACTORY_CALENDAR_NOT_FOUND = 01 79 | HOLIDAY_CALENDAR_NOT_FOUND = 02 80 | MONTH_NOT_FOUND = 03. 81 | IF SY-SUBRC = 0 AND MF_RETURNCODE = 0. 82 | CALL FUNCTION 'CONVERSION_EXIT_PERI6_OUTPUT' 83 | EXPORTING 84 | INPUT = MF_MONAT 85 | IMPORTING 86 | OUTPUT = WA_DYNPFIELDS-FIELDVALUE. 87 | COLLECT WA_DYNPFIELDS INTO MF_DYNPFIELDS. 88 | CALL FUNCTION 'DYNP_VALUES_UPDATE' 89 | EXPORTING 90 | DYNAME = MF_HLP_REPID 91 | DYNUMB = SY-DYNNR 92 | TABLES 93 | DYNPFIELDS = MF_DYNPFIELDS 94 | EXCEPTIONS 95 | INVALID_ABAPWORKAREA = 01 96 | INVALID_DYNPROFIELD = 02 97 | INVALID_DYNPRONAME = 03 98 | INVALID_DYNPRONUMMER = 04 99 | INVALID_REQUEST = 05 100 | NO_FIELDDESCRIPTION = 06 101 | UNDEFIND_ERROR = 07. "<<== note 148804 102 | ENDIF. 103 | ENDIF. 104 | 105 | ENDMETHOD. 106 | ENDCLASS. -------------------------------------------------------------------------------- /S4HANAEmbeddedAnalyticsSpendReporting/ZCL_Reference3IDByBusPartner.abap: -------------------------------------------------------------------------------- 1 | class ZCL_REFERENCE3IDBYBUSPARTNER definition 2 | public 3 | final 4 | create public . 5 | 6 | public section. 7 | INTERFACES if_amdp_marker_hdb. 8 | CLASS-METHODS function for table function ZI_Reference3IDByBusPartner. 9 | protected section. 10 | private section. 11 | ENDCLASS. 12 | 13 | 14 | 15 | CLASS ZCL_REFERENCE3IDBYBUSPARTNER IMPLEMENTATION. 16 | 17 | 18 | METHOD function by database function 19 | for hdb language sqlscript 20 | options read-only 21 | using bseg bkpf. 22 | it_data_1 = 23 | SELECT DISTINCT bseg_1.mandt, 24 | bseg_1.xref3, 25 | bseg_1.matnr 26 | FROM bseg AS bseg_1 INNER JOIN bseg AS bseg_2 27 | ON bseg_1.mandt = bseg_2.mandt 28 | AND bseg_1.bukrs = bseg_2.bukrs 29 | AND bseg_1.belnr = bseg_2.belnr 30 | AND bseg_1.gjahr = bseg_2.gjahr 31 | INNER JOIN bkpf 32 | ON bseg_1.mandt = bkpf.mandt 33 | AND bseg_1.bukrs = bkpf.bukrs 34 | AND bseg_1.belnr = bkpf.belnr 35 | AND bseg_1.gjahr = bkpf.gjahr 36 | WHERE bseg_2.h_bstat = '' 37 | AND bseg_2.koart = 'K' 38 | AND bseg_2.bschl in ( '21','22','24','31','32','34' ) 39 | AND bseg_1.koart <> 'K' 40 | AND bseg_1.xref3 <> ''; 41 | 42 | it_data_2 = 43 | SELECT DISTINCT bseg_1.mandt, 44 | bseg_1.xref3 45 | FROM :it_data_1 INNER JOIN bseg AS bseg_1 46 | ON :it_data_1.mandt = bseg_1.mandt 47 | AND :it_data_1.xref3 = bseg_1.xref3 48 | INNER JOIN bseg AS bseg_2 49 | ON bseg_1.mandt = bseg_2.mandt 50 | AND bseg_1.bukrs = bseg_2.bukrs 51 | AND bseg_1.belnr = bseg_2.belnr 52 | AND bseg_1.gjahr = bseg_2.gjahr 53 | AND bseg_1.ebeln = bseg_2.ebeln 54 | AND bseg_1.ebelp = bseg_2.ebelp 55 | AND bseg_1.matnr = bseg_2.matnr 56 | WHERE bseg_1.buzid = 'W' 57 | AND bseg_2.buzid = 'M' 58 | GROUP BY bseg_1.mandt, bseg_1.xref3 59 | HAVING SUM( CASE bseg_2.shkzg 60 | WHEN 'H' THEN bseg_2.dmbtr * -1 61 | WHEN 'S' THEN bseg_2.dmbtr 62 | ELSE bseg_2.dmbtr 63 | END ) <> 0; 64 | 65 | it_data_3 = 66 | SELECT DISTINCT bseg_1.mandt, 67 | bseg_1.xref3, 68 | bseg_2.bukrs, 69 | bseg_2.hkont, 70 | bseg_2.kokrs, 71 | bseg_2.kostl, 72 | RANK ( ) OVER ( PARTITION BY bseg_1.mandt, bseg_1.xref3 ORDER BY bseg_2.h_budat DESC, bseg_2.belnr DESC, bseg_2.buzei DESC ) AS Rank 73 | FROM :it_data_2 INNER JOIN bseg AS bseg_1 74 | ON :it_data_2.mandt = bseg_1.mandt 75 | AND :it_data_2.xref3 = bseg_1.xref3 76 | INNER JOIN bseg AS bseg_2 77 | ON bseg_1.mandt = bseg_2.mandt 78 | AND bseg_1.bukrs = bseg_2.bukrs 79 | AND bseg_1.belnr = bseg_2.belnr 80 | AND bseg_1.gjahr = bseg_2.gjahr 81 | AND bseg_1.ebeln = bseg_2.ebeln 82 | AND bseg_1.ebelp = bseg_2.ebelp 83 | AND bseg_1.matnr = bseg_2.matnr 84 | WHERE bseg_1.buzid = 'W' 85 | AND bseg_2.buzid = 'M'; 86 | 87 | RETURN 88 | SELECT mandt, 89 | xref3 AS Reference3IDByBusinessPartner, 90 | bukrs AS CompanyCode, 91 | hkont AS GLAccount, 92 | kokrs AS ControllingArea, 93 | kostl AS CostCenter 94 | FROM :it_data_3 95 | WHERE Rank = 1; 96 | 97 | ENDMETHOD. 98 | ENDCLASS. -------------------------------------------------------------------------------- /S4HANAEmbeddedAnalyticsInventoryAgingReport/ZI_InventoryAgingCube.abap: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZIINVAGINGC' 2 | @AccessControl.authorizationCheck: #CHECK 3 | @VDM.viewType: #COMPOSITE 4 | @Analytics.dataCategory: #CUBE 5 | @EndUserText.label: 'Inventory Aging' 6 | define view ZI_InventoryAgingCube 7 | with parameters 8 | @EndUserText.label: 'Date' 9 | @Environment.systemField: #SYSTEM_DATE 10 | P_Current_Date: dats, 11 | @EndUserText.label: 'Aging Range 1' 12 | P_Aging_Range_1: char3, 13 | @EndUserText.label: 'Aging Range 2' 14 | P_Aging_Range_2: char3, 15 | @EndUserText.label: 'Aging Range 3' 16 | P_Aging_Range_3: char3, 17 | @EndUserText.label: 'Aging Range 4' 18 | P_Aging_Range_4: char3, 19 | @EndUserText.label: 'Internal Flow Elimination' 20 | P_Internal_Flow_Elimination: cacsyn 21 | as select from ZI_InventoryAgingFunc(P_Current_Date: $parameters.P_Current_Date, 22 | P_Aging_Range_1: $parameters.P_Aging_Range_1, 23 | P_Aging_Range_2: $parameters.P_Aging_Range_2, 24 | P_Aging_Range_3: $parameters.P_Aging_Range_3, 25 | P_Aging_Range_4: $parameters.P_Aging_Range_4, 26 | P_Internal_Flow_Elimination: $parameters.P_Internal_Flow_Elimination) 27 | association [0..1] to I_Plant as _Plant on $projection.Plant = _Plant.Plant 28 | association [0..1] to I_StorageLocation as _StorageLocation on $projection.Plant = _StorageLocation.Plant 29 | and $projection.StorageLocation = _StorageLocation.StorageLocation 30 | association [0..1] to I_InventorySpecialStockType as _InventorySpecialStockType on $projection.InventorySpecialStockType = _InventorySpecialStockType.InventorySpecialStockType 31 | association [0..1] to I_Customer as _Customer on $projection.CustomerStockIdentifier = _Customer.Customer 32 | association [0..1] to ZI_StockType as _StockType on $projection.StockType = _StockType.StockType 33 | association [0..1] to I_Material as _Material on $projection.Material = _Material.Material 34 | association [0..1] to ZI_AgingRange as _AgingRange on $projection.AgingRange = _AgingRange.AgingRange 35 | association [0..1] to I_UnitOfMeasure as _UnitOfMeasure on $projection.UnitOfMeasure = _UnitOfMeasure.UnitOfMeasure 36 | association [0..1] to I_Currency as _Currency on $projection.Currency = _Currency.Currency 37 | { 38 | @ObjectModel.foreignKey.association: '_Plant' 39 | key werks as Plant, 40 | @ObjectModel.foreignKey.association: '_StorageLocation' 41 | key lgort as StorageLocation, 42 | @ObjectModel.foreignKey.association: '_InventorySpecialStockType' 43 | key sobkz as InventorySpecialStockType, 44 | @ObjectModel.foreignKey.association: '_Customer' 45 | @EndUserText.label: 'Customer Stock Identifier' 46 | key kunnr_sid as CustomerStockIdentifier, 47 | @ObjectModel.foreignKey.association: '_StockType' 48 | @EndUserText.label: 'Stock Type' 49 | key lbbsa_sid as StockType, 50 | @ObjectModel.foreignKey.association: '_Material' 51 | key matnr as Material, 52 | @ObjectModel.foreignKey.association: '_AgingRange' 53 | @EndUserText.label: 'Aging' 54 | aging_range as AgingRange, 55 | @EndUserText.label: 'Last Consumption Date' 56 | budat_h_max as LastConsumptionDate, 57 | @ObjectModel.foreignKey.association: '_UnitOfMeasure' 58 | @Semantics.unitOfMeasure: true 59 | meins as UnitOfMeasure, 60 | @Semantics.currencyCode: true 61 | @ObjectModel.foreignKey.association: '_Currency' 62 | waers as Currency, 63 | @Semantics.quantity.unitOfMeasure: 'UnitOfMeasure' 64 | @DefaultAggregation: #SUM 65 | labst as StockQuantity, 66 | @Semantics.amount.currencyCode: 'Currency' 67 | @DefaultAggregation: #SUM 68 | salk3 as StockValue, 69 | _Plant, 70 | _StorageLocation, 71 | _InventorySpecialStockType, 72 | _Customer, 73 | _StockType, 74 | _Material, 75 | _AgingRange, 76 | _UnitOfMeasure, 77 | _Currency 78 | } 79 | 80 | -------------------------------------------------------------------------------- /ABAPCDSConsumptionViewFeaturesUltimateTest/zsapbc_flight_query4.abap: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZFLIGHT_QUERY4' 2 | @AbapCatalog.compiler.compareFilter: true 3 | @AccessControl.authorizationCheck:#CHECK 4 | @VDM.viewType: #CONSUMPTION 5 | @Analytics.query: true 6 | @EndUserText.label: 'Flight Query 4' 7 | define view zsapbc_flight_query4 with parameters 8 | @Consumption.hidden: false 9 | @Environment.systemField: #SYSTEM_DATE 10 | @EndUserText.label: 'Key Date' 11 | p_keydate: abap.dats, 12 | @EndUserText.label: 'Display Currency' 13 | @Consumption.defaultValue: 'CAD' 14 | p_display_currency : s_currcode, 15 | @EndUserText.label: 'Year 1' 16 | @Consumption.derivation: {lookupEntity: 'ZSAPBC_CURR_YEAR_ADD_N', resultElement: 'p_year' , 17 | binding: [{ targetParameter: 'p_offset', type: #CONSTANT, value: -1 }]} 18 | p_year_1: rscalyear, 19 | @EndUserText.label: 'Year 2' 20 | @Consumption.derivation: {lookupEntity: 'ZSAPBC_CURR_YEAR_ADD_N', resultElement: 'p_year', 21 | binding: [{ targetParameter: 'p_offset', type:#CONSTANT , value: 0 }] } 22 | p_year_2: rscalyear 23 | as select from zsapbc_flight_cube4( p_display_currency: $parameters.p_display_currency, 24 | p_year_1: $parameters.p_year_1, 25 | p_year_2: $parameters.p_year_2 ) { 26 | @AnalyticsDetails.query.axis: #ROWS 27 | @AnalyticsDetails.query.display: #TEXT 28 | @AnalyticsDetails.query.displayHierarchy: #ON 29 | @Consumption.filter: { selectionType: #HIERARCHY_NODE, multipleSelections: true, mandatory: false } 30 | @AnalyticsDetails.query.hierarchyInitialLevel: 3 31 | zsapbc_flight_cube4._region[1:datefrom >= $parameters.p_keydate and dateto <= $parameters.p_keydate].region, 32 | @AnalyticsDetails.query.axis: #COLUMNS 33 | seatsocc_total_year_1, 34 | @AnalyticsDetails.query.axis: #COLUMNS 35 | seatsmax_total_year_1, 36 | @AnalyticsDetails.query.axis: #COLUMNS 37 | @AnalyticsDetails.query.decimals: 1 38 | @EndUserText.label: 'Seats Occ (%) Year 1' 39 | @AnalyticsDetails.query.formula: 'NDIV0( NODIM( seatsocc_total_year_1 ) / 40 | NODIM( seatsmax_total_year_1 ) ) * hundred ' 41 | 1 as seats_occ_prc_year_1, 42 | @AnalyticsDetails.query.axis: #COLUMNS 43 | seatsocc_total_year_2, 44 | @AnalyticsDetails.query.axis: #COLUMNS 45 | seatsmax_total_year_2, 46 | @AnalyticsDetails.query.axis: #COLUMNS 47 | @AnalyticsDetails.query.decimals: 1 48 | @EndUserText.label: 'Seats Occ (%) Year 2' 49 | @AnalyticsDetails.query.formula: 'NDIV0( NODIM( seatsocc_total_year_2 ) / 50 | NODIM( seatsmax_total_year_2 ) ) * hundred ' 51 | 1 as seats_occ_prc_year_2, 52 | @AnalyticsDetails.query.axis: #COLUMNS 53 | payment_year_1, 54 | @AnalyticsDetails.query.axis: #COLUMNS 55 | payment_year_2, 56 | @AnalyticsDetails.query.axis: #COLUMNS 57 | payment_disp_curr_year_1, 58 | @AnalyticsDetails.query.axis: #COLUMNS 59 | payment_disp_curr_year_2, 60 | 61 | @AnalyticsDetails.query.axis: #COLUMNS 62 | @AnalyticsDetails.query.hidden 63 | payment_disp_curr_total_year_1, 64 | @AnalyticsDetails.query.axis: #COLUMNS 65 | @AnalyticsDetails.query.hidden 66 | payment_disp_curr_total_year_2, 67 | @AnalyticsDetails.query.axis: #COLUMNS 68 | @AnalyticsDetails.query.decimals: 1 69 | @EndUserText.label: '(%) Payment (dc) Year 1' 70 | @AnalyticsDetails.query.formula: 'NDIV0( NODIM( payment_disp_curr_year_1 ) / 71 | NODIM( payment_disp_curr_total_year_1 ) ) * hundred ' 72 | 1 as payment_dc_ttl_prc_year_1, 73 | @AnalyticsDetails.query.axis: #COLUMNS 74 | @AnalyticsDetails.query.decimals: 1 75 | @EndUserText.label: '(%) Payment (dc) Year 2' 76 | @AnalyticsDetails.query.formula: 'NDIV0( NODIM( payment_disp_curr_year_2 ) / 77 | NODIM( payment_disp_curr_total_year_2 ) ) * hundred ' 78 | 1 as payment_dc_ttl_prc_year_2, 79 | @AnalyticsDetails.query.axis: #FREE 80 | connid, 81 | @AnalyticsDetails.query.axis: #FREE 82 | @Consumption.filter: {selectionType: #SINGLE, multipleSelections: true, mandatory: false } 83 | carrid, 84 | @AnalyticsDetails.query.axis: #FREE 85 | fldate, 86 | @AnalyticsDetails.query.axis: #FREE 87 | flmonth, 88 | @AnalyticsDetails.query.axis: #FREE 89 | flyear, 90 | @AnalyticsDetails.query.axis: #FREE 91 | currency, 92 | @AnalyticsDetails.query.axis: #FREE 93 | disp_curr, 94 | @AnalyticsDetails.query.axis: #FREE 95 | unit 96 | } 97 | -------------------------------------------------------------------------------- /EmbeddedAnalyticsDateFunction/ZI_PriceChangeCube.txt: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZIPRCCHGC' 2 | @Analytics.dataCategory: #CUBE 3 | @VDM.viewType: #COMPOSITE 4 | @EndUserText.label: 'Price Change' 5 | @AccessControl.authorizationCheck: #CHECK 6 | define view ZI_PriceChangeCube as select from ZP_PriceChange 7 | association [0..1] to ZI_TableName as _TableName on $projection.TableName = _TableName.TableName 8 | association [0..1] to ZI_FieldName as _FieldName on $projection.TableName = _FieldName.TableName 9 | and $projection.FieldName = _FieldName.FieldName 10 | association [0..1] to ZI_ChangeType as _ChangeType on $projection.ChangeType = _ChangeType.ChangeType 11 | association [0..1] to Rv_P_User as _User on $projection.UserName = _User.userName 12 | association [0..1] to ZI_TransactionCode as _TransactionCode on $projection.TransactionCode = _TransactionCode.TransactionCode 13 | association [0..1] to ZI_ConditionUsage as _ConditionUsage on $projection.ConditionUsage = _ConditionUsage.ConditionUsage 14 | association [0..1] to ZI_ConditionApplication as _ConditionApplication on $projection.ConditionApplication = _ConditionApplication.ConditionApplication 15 | association [0..1] to ZI_ConditionType as _ConditionType on $projection.ConditionUsage = _ConditionType.ConditionUsage 16 | and $projection.ConditionApplication = _ConditionType.ConditionApplication 17 | and $projection.ConditionType = _ConditionType.ConditionType 18 | association [0..1] to I_Material as _Material on $projection.Material = _Material.Material 19 | association [0..1] to I_SalesOrganization as _SalesOrganization on $projection.SalesOrganization = _SalesOrganization.SalesOrganization 20 | association [0..1] to I_DistributionChannel as _DistributionChannel on $projection.DistributionChannel = _DistributionChannel.DistributionChannel 21 | association [0..1] to I_Customer as _Customer on $projection.Customer = _Customer.Customer 22 | { 23 | key ConditionRecordNo, 24 | key ChangeNumber, 25 | @ObjectModel.foreignKey.association: '_TableName' 26 | key TableName, 27 | key TableKey, 28 | @ObjectModel.foreignKey.association: '_FieldName' 29 | key FieldName, 30 | @ObjectModel.foreignKey.association: '_ChangeType' 31 | key ChangeType, 32 | @ObjectModel.foreignKey.association: '_User' 33 | UserName, 34 | UdateDate, 35 | UpdateTime, 36 | @ObjectModel.foreignKey.association: '_TransactionCode' 37 | TransactionCode, 38 | case when FieldName = 'KEY' then '*** Created ***' 39 | when ValueNew = '' and CurrencyNew = '' then ' ' 40 | else cast(ltrim(concat_with_space(ValueNew,CurrencyNew,1),' ') as zcdfldvaln) 41 | end as ValueNew, 42 | cast( case ltrim(concat_with_space(ValueOld,CurrencyOld,1),' ') 43 | when '' then ' ' 44 | else ltrim(concat_with_space(ValueOld,CurrencyOld,1),' ') end as zcdfldvalo) 45 | as ValueOld, 46 | Agreement, 47 | SalesDeal, 48 | Promotion, 49 | @ObjectModel.foreignKey.association: '_ConditionUsage' 50 | ConditionUsage, 51 | @ObjectModel.foreignKey.association: '_ConditionApplication' 52 | ConditionApplication, 53 | @ObjectModel.foreignKey.association: '_ConditionType' 54 | ConditionType, 55 | ConditionTable, 56 | @ObjectModel.foreignKey.association: '_SalesOrganization' 57 | SalesOrganization, 58 | @ObjectModel.foreignKey.association: '_DistributionChannel' 59 | DistributionChannel, 60 | @ObjectModel.foreignKey.association: '_Customer' 61 | Customer, 62 | @ObjectModel.foreignKey.association: '_Material' 63 | Material, 64 | ValidFrom, 65 | ValidTo, 66 | ValidityPeriod, 67 | @Semantics.unitOfMeasure: true 68 | @EndUserText.label: 'Unit' 69 | cast( 'EA' as abap.unit( 3 ) ) as Unit, 70 | @Semantics.quantity.unitOfMeasure: 'Unit' 71 | @DefaultAggregation: #SUM 72 | @EndUserText.label: 'Count' 73 | 1 as PriceChangeCount, 74 | _TableName, 75 | _FieldName, 76 | _ChangeType, 77 | _User, 78 | _TransactionCode, 79 | _ConditionUsage, 80 | _ConditionApplication, 81 | _ConditionType, 82 | _SalesOrganization, 83 | _Material, 84 | _DistributionChannel, 85 | _Customer 86 | } 87 | -------------------------------------------------------------------------------- /EmbeddedAnalyticsDateFunction/ZC_PriceChangeQuery.txt: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZCPRCCHGQ' 2 | @VDM.viewType: #CONSUMPTION 3 | @Analytics.query: true 4 | @AccessControl.authorizationCheck: #CHECK 5 | @EndUserText.label: 'Price Change' 6 | define view ZC_PriceChangeQuery 7 | with parameters 8 | @EndUserText.label: 'Date Function' 9 | @Consumption: { valueHelp: '_DateFunction.DateFunction', defaultValue: 'PREVIOUSMONTH' } 10 | P_DateFunction : datefunctionid, 11 | @Consumption.derivation: { lookupEntity: 'C_SglGregorianCalDateFunction', 12 | resultElement: 'DateFunctionStartDate', binding: [ { 13 | targetParameter: 'P_DateFunction', type: #PARAMETER, value : 'P_DateFunction' }, 14 | { targetParameter : 'P_Language' , type : #SYSTEM_FIELD, value : '#SYSTEM_LANGUAGE' } ] 15 | } 16 | @Consumption.hidden: true 17 | P_StartDate: /srmsmc/puc_spend_valid_from , 18 | @Consumption.derivation: { lookupEntity: 'C_SglGregorianCalDateFunction', 19 | resultElement: 'DateFunctionEndDate', binding: [ { 20 | targetParameter: 'P_DateFunction', type: #PARAMETER, value : 'P_DateFunction' }, 21 | { targetParameter : 'P_Language' , type : #SYSTEM_FIELD, value : '#SYSTEM_LANGUAGE' } ] 22 | } 23 | @Consumption.hidden: true 24 | P_EndDate: /srmsmc/puc_spend_valid_to 25 | as select from ZI_PriceChangeCube 26 | association[1] to ZI_DateFunction as _DateFunction on _DateFunction.DateFunction <> '' 27 | { 28 | @AnalyticsDetails.query.axis: #FREE 29 | ConditionRecordNo, 30 | @AnalyticsDetails.query.axis: #FREE 31 | ChangeNumber, 32 | @AnalyticsDetails.query.axis: #FREE 33 | TableKey, 34 | @AnalyticsDetails.query.axis: #ROWS 35 | @Consumption.filter: {selectionType: #RANGE, mandatory: false, multipleSelections: true} 36 | @AnalyticsDetails.query.variableSequence: 1 37 | UdateDate, 38 | @AnalyticsDetails.query.axis: #ROWS 39 | @Consumption.filter: {selectionType: #RANGE, mandatory: false, multipleSelections: true} 40 | @AnalyticsDetails.query.variableSequence: 2 41 | UpdateTime, 42 | @AnalyticsDetails.query.axis: #ROWS 43 | @Consumption.filter: {selectionType: #RANGE, mandatory: false, multipleSelections: true} 44 | @AnalyticsDetails.query.variableSequence: 4 45 | TransactionCode, 46 | @AnalyticsDetails.query.axis: #ROWS 47 | @Consumption.filter: {selectionType: #RANGE, mandatory: false, multipleSelections: true} 48 | @AnalyticsDetails.query.variableSequence: 3 49 | UserName, 50 | @AnalyticsDetails.query.axis: #ROWS 51 | @Consumption.filter: {selectionType: #RANGE, mandatory: false, multipleSelections: true} 52 | @AnalyticsDetails.query.variableSequence: 9 53 | TableName, 54 | @AnalyticsDetails.query.axis: #ROWS 55 | ConditionType, 56 | @AnalyticsDetails.query.axis: #ROWS 57 | SalesOrganization, 58 | @AnalyticsDetails.query.axis: #ROWS 59 | DistributionChannel, 60 | @AnalyticsDetails.query.axis: #ROWS 61 | Customer, 62 | @AnalyticsDetails.query.axis: #ROWS 63 | Material, 64 | @AnalyticsDetails.query.axis: #ROWS 65 | FieldName, 66 | @AnalyticsDetails.query.axis: #FREE 67 | @Consumption.filter: {selectionType: #RANGE, mandatory: false, multipleSelections: true} 68 | @AnalyticsDetails.query.variableSequence: 12 69 | ChangeType, 70 | @AnalyticsDetails.query.axis: #ROWS 71 | ValueOld, 72 | @AnalyticsDetails.query.axis: #ROWS 73 | ValueNew, 74 | @AnalyticsDetails.query.axis: #ROWS 75 | ValidityPeriod, 76 | @AnalyticsDetails.query.axis: #COLUMNS 77 | PriceChangeCount, 78 | @AnalyticsDetails.query.axis: #FREE 79 | @Consumption.filter: {selectionType: #RANGE, mandatory: false, multipleSelections: true} 80 | @AnalyticsDetails.query.variableSequence: 5 81 | Agreement, 82 | @AnalyticsDetails.query.axis: #FREE 83 | @Consumption.filter: {selectionType: #RANGE, mandatory: false, multipleSelections: true} 84 | @AnalyticsDetails.query.variableSequence: 6 85 | SalesDeal, 86 | @AnalyticsDetails.query.axis: #FREE 87 | @Consumption.filter: {selectionType: #RANGE, mandatory: false, multipleSelections: true} 88 | @AnalyticsDetails.query.variableSequence: 7 89 | Promotion, 90 | @AnalyticsDetails.query.axis: #FREE 91 | @Consumption.filter: {selectionType: #RANGE, mandatory: false, multipleSelections: true} 92 | @AnalyticsDetails.query.variableSequence: 8 93 | ConditionUsage, 94 | @AnalyticsDetails.query.axis: #FREE 95 | ConditionApplication, 96 | @AnalyticsDetails.query.axis: #FREE 97 | ConditionTable, 98 | @AnalyticsDetails.query.axis: #FREE 99 | @Consumption.filter: {selectionType: #RANGE, mandatory: false, multipleSelections: true} 100 | @AnalyticsDetails.query.variableSequence: 10 101 | ValidFrom, 102 | @AnalyticsDetails.query.axis: #FREE 103 | @Consumption.filter: {selectionType: #RANGE, mandatory: false, multipleSelections: true} 104 | @AnalyticsDetails.query.variableSequence: 11 105 | ValidTo, 106 | @AnalyticsDetails.query.axis: #FREE 107 | Unit, 108 | _DateFunction 109 | } 110 | where UdateDate between $parameters.P_StartDate and $parameters.P_EndDate 111 | 112 | -------------------------------------------------------------------------------- /ABAPCDSConsumptionViewFeaturesUltimateTest/zsapbc_flight_cube3.abap: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZSFLIGHT_CUBE3' 2 | @AbapCatalog.compiler.compareFilter: true 3 | @Analytics: { dataCategory: #CUBE, dataExtraction.enabled: true } 4 | @AccessControl.authorizationCheck:#CHECK 5 | @EndUserText.label: 'Flight Cube' 6 | 7 | define view zsapbc_flight_cube3 with parameters 8 | p_display_currency : s_currcode, 9 | p_year_1: rscalyear, 10 | p_year_2: rscalyear 11 | as select from zsapbc_flight_fact( p_display_currency: $parameters.p_display_currency ) as flight 12 | association [1..1] to zsapbc_carr_dimension as _carr on $projection.carrid = flight.carrid 13 | association [0..*] to zsapbc_region_dimension3 as _region on $projection.region = flight.region 14 | { 15 | @ObjectModel.foreignKey.association: '_carr' 16 | key flight.carrid, 17 | key flight.connid, 18 | @EndUserText.label: 'Date' 19 | key flight.fldate, 20 | @EndUserText.label: 'Region' 21 | @ObjectModel.foreignKey.association: '_region' 22 | 23 | flight.region, 24 | _carr, 25 | _region, 26 | @Semantics.calendar.yearMonth: true 27 | @EndUserText.label: 'Month' 28 | flight.flmonth, 29 | @Semantics.calendar.year: true 30 | @EndUserText.label: 'Year' 31 | flight.flyear, 32 | @Semantics.currencyCode: true 33 | @EndUserText.label: 'Booking Currency' 34 | flight.currency, 35 | @Semantics.amount.currencyCode: 'Currency' 36 | @DefaultAggregation: #SUM 37 | @EndUserText.label: 'Booking (bc)' 38 | flight.payment, 39 | @Semantics.quantity.unitOfMeasure: 'Currency' 40 | @DefaultAggregation: #SUM 41 | @EndUserText.label: 'Booking (bc) Year 1' 42 | case when flyear = :p_year_1 then payment 43 | else 0 44 | end as payment_year_1, 45 | @Semantics.quantity.unitOfMeasure: 'Currency' 46 | @DefaultAggregation: #SUM 47 | @EndUserText.label: 'Booking (bc) Year 2' 48 | case when flyear = :p_year_2 then payment 49 | else 0 50 | end as payment_year_2, 51 | @EndUserText.label: 'Display Currency' 52 | cast('CAD' as abap.cuky( 5 )) as disp_curr, 53 | @Semantics.amount.currencyCode: 'disp_curr' 54 | @EndUserText.label: 'Booking (dc)' 55 | @DefaultAggregation: #SUM 56 | flight.payment_disp_curr, 57 | @Semantics.quantity.unitOfMeasure: 'disp_curr' 58 | @DefaultAggregation: #SUM 59 | @EndUserText.label: 'Booking (dc) Year 1' 60 | case when flyear = :p_year_1 then payment_disp_curr 61 | else 0 62 | end as payment_disp_curr_year_1, 63 | @Semantics.quantity.unitOfMeasure: 'disp_curr' 64 | @DefaultAggregation: #SUM 65 | @EndUserText.label: 'Booking (dc) Year 2' 66 | case when flyear = :p_year_2 then payment_disp_curr 67 | else 0 68 | end as payment_disp_curr_year_2, 69 | @Semantics.unitOfMeasure: true 70 | @EndUserText.label: 'UOM' 71 | flight.unit, 72 | @Semantics.unitOfMeasure: true 73 | @EndUserText.label: '%' 74 | cast( '%' as abap.unit( 3 ) ) as unit_percent, 75 | @Semantics.quantity.unitOfMeasure: 'unit' 76 | @DefaultAggregation: #SUM 77 | @EndUserText.label: 'Seats Max Econ.' 78 | flight.seatsmax, 79 | @Semantics.quantity.unitOfMeasure: 'unit' 80 | @DefaultAggregation: #SUM 81 | @EndUserText.label: 'Seats Max Bus.' 82 | flight.seatsmax_b, 83 | @Semantics.quantity.unitOfMeasure: 'unit' 84 | @DefaultAggregation: #SUM 85 | @EndUserText.label: 'Seats Max 1st' 86 | flight.seatsmax_f, 87 | @Semantics.quantity.unitOfMeasure: 'unit' 88 | @DefaultAggregation: #SUM 89 | @EndUserText.label: 'Seats Max Total' 90 | seatsmax_total, 91 | @Semantics.quantity.unitOfMeasure: 'unit' 92 | @DefaultAggregation: #SUM 93 | @EndUserText.label: 'Seats Max Year 1' 94 | case when flyear = :p_year_1 then seatsmax_total 95 | else 0 96 | end as seatsmax_total_year_1, 97 | @Semantics.quantity.unitOfMeasure: 'unit' 98 | @DefaultAggregation: #SUM 99 | @EndUserText.label: 'Seats Max Year 2' 100 | case when flyear = :p_year_2 then seatsmax_total 101 | else 0 102 | end as seatsmax_total_year_2, 103 | @Semantics.quantity.unitOfMeasure: 'unit' 104 | @DefaultAggregation: #SUM 105 | @EndUserText.label: 'Seats Occ Econ.' 106 | flight.seatsocc, 107 | @Semantics.quantity.unitOfMeasure: 'unit' 108 | @DefaultAggregation: #SUM 109 | @EndUserText.label: 'Seats Occ Bus.' 110 | flight.seatsocc_b, 111 | @Semantics.quantity.unitOfMeasure: 'unit' 112 | @DefaultAggregation: #SUM 113 | @EndUserText.label: 'Seats Occ 1st' 114 | flight.seatsocc_f, 115 | @Semantics.quantity.unitOfMeasure: 'unit' 116 | @DefaultAggregation: #SUM 117 | @EndUserText.label: 'Seats Occ Total' 118 | seatsocc_total, 119 | @Semantics.quantity.unitOfMeasure: 'unit' 120 | @DefaultAggregation: #SUM 121 | @EndUserText.label: 'Seats Occ Year 1' 122 | case when flyear = :p_year_1 then seatsocc_total 123 | else 0 124 | end as seatsocc_total_year_1, 125 | @Semantics.quantity.unitOfMeasure: 'unit' 126 | @DefaultAggregation: #SUM 127 | @EndUserText.label: 'Seats Occ Year 2' 128 | case when flyear = :p_year_2 then seatsocc_total 129 | else 0 130 | end as seatsocc_total_year_2, 131 | @Semantics.quantity.unitOfMeasure: 'unit_percent' 132 | @DefaultAggregation: #MAX 133 | @EndUserText.label: '100%' 134 | 100 as hundred 135 | } 136 | -------------------------------------------------------------------------------- /ABAPCDSConsumptionViewFeaturesUltimateTest/zsapbc_flight_cube.abap: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZSFLIGHT_CUBE' 2 | @AbapCatalog.compiler.compareFilter: true 3 | @Analytics: { dataCategory: #CUBE, dataExtraction.enabled: true } 4 | @AccessControl.authorizationCheck:#CHECK 5 | @EndUserText.label: 'Flight Cube' 6 | 7 | define view zsapbc_flight_cube with parameters 8 | p_display_currency : s_currcode, 9 | p_year_1: rscalyear, 10 | p_year_2: rscalyear 11 | as select from zsapbc_flight_fact( p_display_currency: $parameters.p_display_currency ) as flight 12 | association [1..1] to zsapbc_carr_dimension as _carr on $projection.carrid = flight.carrid 13 | association [1..1] to zsapbc_region_dimension as _region on $projection.region = flight.region 14 | { 15 | @ObjectModel.foreignKey.association: '_carr' 16 | key flight.carrid, 17 | key flight.connid, 18 | @EndUserText.label: 'Date' 19 | key flight.fldate, 20 | @EndUserText.label: 'Region' 21 | @ObjectModel.foreignKey.association: '_region' 22 | @ObjectModel.Hierarchy.association: '_region' 23 | flight.region, 24 | _carr, 25 | _region, 26 | @Semantics.calendar.yearMonth: true 27 | @EndUserText.label: 'Month' 28 | flight.flmonth, 29 | @Semantics.calendar.year: true 30 | @EndUserText.label: 'Year' 31 | flight.flyear, 32 | @Semantics.currencyCode: true 33 | @EndUserText.label: 'Booking Currency' 34 | flight.currency, 35 | @Semantics.amount.currencyCode: 'Currency' 36 | @DefaultAggregation: #SUM 37 | @EndUserText.label: 'Booking (bc)' 38 | flight.payment, 39 | @Semantics.quantity.unitOfMeasure: 'Currency' 40 | @DefaultAggregation: #SUM 41 | @EndUserText.label: 'Booking (bc) Year 1' 42 | case when flyear = :p_year_1 then payment 43 | else 0 44 | end as payment_year_1, 45 | @Semantics.quantity.unitOfMeasure: 'Currency' 46 | @DefaultAggregation: #SUM 47 | @EndUserText.label: 'Booking (bc) Year 2' 48 | case when flyear = :p_year_2 then payment 49 | else 0 50 | end as payment_year_2, 51 | @EndUserText.label: 'Display Currency' 52 | cast('CAD' as abap.cuky( 5 )) as disp_curr, 53 | @Semantics.amount.currencyCode: 'disp_curr' 54 | @EndUserText.label: 'Booking (dc)' 55 | @DefaultAggregation: #SUM 56 | flight.payment_disp_curr, 57 | @Semantics.quantity.unitOfMeasure: 'disp_curr' 58 | @DefaultAggregation: #SUM 59 | @EndUserText.label: 'Booking (dc) Year 1' 60 | case when flyear = :p_year_1 then payment_disp_curr 61 | else 0 62 | end as payment_disp_curr_year_1, 63 | @Semantics.quantity.unitOfMeasure: 'disp_curr' 64 | @DefaultAggregation: #SUM 65 | @EndUserText.label: 'Booking (dc) Year 2' 66 | case when flyear = :p_year_2 then payment_disp_curr 67 | else 0 68 | end as payment_disp_curr_year_2, 69 | @Semantics.unitOfMeasure: true 70 | @EndUserText.label: 'UOM' 71 | flight.unit, 72 | @Semantics.unitOfMeasure: true 73 | @EndUserText.label: '%' 74 | cast( '%' as abap.unit( 3 ) ) as unit_percent, 75 | @Semantics.quantity.unitOfMeasure: 'unit' 76 | @DefaultAggregation: #SUM 77 | @EndUserText.label: 'Seats Max Econ.' 78 | flight.seatsmax, 79 | @Semantics.quantity.unitOfMeasure: 'unit' 80 | @DefaultAggregation: #SUM 81 | @EndUserText.label: 'Seats Max Bus.' 82 | flight.seatsmax_b, 83 | @Semantics.quantity.unitOfMeasure: 'unit' 84 | @DefaultAggregation: #SUM 85 | @EndUserText.label: 'Seats Max 1st' 86 | flight.seatsmax_f, 87 | @Semantics.quantity.unitOfMeasure: 'unit' 88 | @DefaultAggregation: #SUM 89 | @EndUserText.label: 'Seats Max Total' 90 | seatsmax_total, 91 | @Semantics.quantity.unitOfMeasure: 'unit' 92 | @DefaultAggregation: #SUM 93 | @EndUserText.label: 'Seats Max Year 1' 94 | case when flyear = :p_year_1 then seatsmax_total 95 | else 0 96 | end as seatsmax_total_year_1, 97 | @Semantics.quantity.unitOfMeasure: 'unit' 98 | @DefaultAggregation: #SUM 99 | @EndUserText.label: 'Seats Max Year 2' 100 | case when flyear = :p_year_2 then seatsmax_total 101 | else 0 102 | end as seatsmax_total_year_2, 103 | @Semantics.quantity.unitOfMeasure: 'unit' 104 | @DefaultAggregation: #SUM 105 | @EndUserText.label: 'Seats Occ Econ.' 106 | flight.seatsocc, 107 | @Semantics.quantity.unitOfMeasure: 'unit' 108 | @DefaultAggregation: #SUM 109 | @EndUserText.label: 'Seats Occ Bus.' 110 | flight.seatsocc_b, 111 | @Semantics.quantity.unitOfMeasure: 'unit' 112 | @DefaultAggregation: #SUM 113 | @EndUserText.label: 'Seats Occ 1st' 114 | flight.seatsocc_f, 115 | @Semantics.quantity.unitOfMeasure: 'unit' 116 | @DefaultAggregation: #SUM 117 | @EndUserText.label: 'Seats Occ Total' 118 | seatsocc_total, 119 | @Semantics.quantity.unitOfMeasure: 'unit' 120 | @DefaultAggregation: #SUM 121 | @EndUserText.label: 'Seats Occ Year 1' 122 | case when flyear = :p_year_1 then seatsocc_total 123 | else 0 124 | end as seatsocc_total_year_1, 125 | @Semantics.quantity.unitOfMeasure: 'unit' 126 | @DefaultAggregation: #SUM 127 | @EndUserText.label: 'Seats Occ Year 2' 128 | case when flyear = :p_year_2 then seatsocc_total 129 | else 0 130 | end as seatsocc_total_year_2, 131 | @Semantics.quantity.unitOfMeasure: 'unit_percent' 132 | @DefaultAggregation: #MAX 133 | @EndUserText.label: '100%' 134 | 100 as hundred 135 | } -------------------------------------------------------------------------------- /DateToFactoryDateConversionWithS4HANAABAPCDSView/zcl_factory_calendar.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_factory_calendar DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC. 5 | 6 | PUBLIC SECTION. 7 | INTERFACES if_amdp_marker_hdb. 8 | CLASS-METHODS function FOR TABLE FUNCTION ZI_FactoryCalendar. 9 | 10 | PROTECTED SECTION. 11 | PRIVATE SECTION. 12 | ENDCLASS. 13 | 14 | CLASS zcl_factory_calendar IMPLEMENTATION. 15 | 16 | METHOD function BY DATABASE FUNCTION 17 | FOR HDB LANGUAGE SQLSCRIPT 18 | OPTIONS READ-ONLY 19 | USING tfacs scal_tt_year scal_tt_date. 20 | 21 | -- Kind of unpivot month fields 22 | tfacs0 = 23 | SELECT ident, jahr, '01' AS calendarmonth, mon01 AS mon 24 | FROM tfacs INNER JOIN scal_tt_year AS year 25 | ON tfacs.jahr = year.calendaryear 26 | UNION ALL 27 | SELECT ident, jahr, '02' AS calendarmonth, mon02 AS mon 28 | FROM tfacs INNER JOIN scal_tt_year AS year 29 | ON tfacs.jahr = year.calendaryear 30 | UNION ALL 31 | SELECT ident, jahr, '03' AS calendarmonth, mon03 AS mon 32 | FROM tfacs INNER JOIN scal_tt_year AS year 33 | ON tfacs.jahr = year.calendaryear 34 | UNION ALL 35 | SELECT ident, jahr, '04' AS calendarmonth, mon04 AS mon 36 | FROM tfacs INNER JOIN scal_tt_year AS year 37 | ON tfacs.jahr = year.calendaryear 38 | UNION ALL 39 | SELECT ident, jahr, '05' AS calendarmonth, mon05 AS mon 40 | FROM tfacs INNER JOIN scal_tt_year AS year 41 | ON tfacs.jahr = year.calendaryear 42 | UNION ALL 43 | SELECT ident, jahr, '06' AS calendarmonth, mon06 AS mon 44 | FROM tfacs INNER JOIN scal_tt_year AS year 45 | ON tfacs.jahr = year.calendaryear 46 | UNION ALL 47 | SELECT ident, jahr, '07' AS calendarmonth, mon07 AS mon 48 | FROM tfacs INNER JOIN scal_tt_year AS year 49 | ON tfacs.jahr = year.calendaryear 50 | UNION ALL 51 | SELECT ident, jahr, '08' AS calendarmonth, mon08 AS mon 52 | FROM tfacs INNER JOIN scal_tt_year AS year 53 | ON tfacs.jahr = year.calendaryear 54 | UNION ALL 55 | SELECT ident, jahr, '09' AS calendarmonth, mon09 AS mon 56 | FROM tfacs INNER JOIN scal_tt_year AS year 57 | ON tfacs.jahr = year.calendaryear 58 | UNION ALL 59 | SELECT ident, jahr, '10' AS calendarmonth, mon10 AS mon 60 | FROM tfacs INNER JOIN scal_tt_year AS year 61 | ON tfacs.jahr = year.calendaryear 62 | UNION ALL 63 | SELECT ident, jahr, '11' AS calendarmonth, mon11 AS mon 64 | FROM tfacs INNER JOIN scal_tt_year AS year 65 | ON tfacs.jahr = year.calendaryear 66 | UNION ALL 67 | SELECT ident, jahr, '12' AS calendarmonth, mon12 AS mon 68 | FROM tfacs INNER JOIN scal_tt_year AS year 69 | ON tfacs.jahr = year.calendaryear; 70 | 71 | -- Kind of unnest individual dates 72 | tfacs1 = SELECT ident, date.calendardate, substring(tfacs0.mon, date.calendarday, 1 ) AS weekday 73 | FROM :tfacs0 AS tfacs0 INNER JOIN scal_tt_date AS date 74 | ON tfacs0.jahr = date.calendaryear 75 | AND tfacs0.calendarmonth = date.calendarmonth; 76 | 77 | -- Find previous and next factory dates when weekend / holiday starts 78 | tfacs2 = 79 | SELECT ident, 80 | calendardate, 81 | weekday, 82 | CASE WHEN LAG(weekday) OVER (PARTITION BY ident ORDER BY calendardate ASC) <> weekday 83 | THEN LAG(calendardate) OVER (PARTITION BY ident ORDER BY calendardate ASC) 84 | ELSE NULL 85 | END AS fac_dat_prev, 86 | CASE WHEN LEAD(weekday) OVER (PARTITION BY ident ORDER BY calendardate ASC) <> weekday 87 | THEN LEAD(calendardate) OVER (PARTITION BY ident ORDER BY calendardate ASC) 88 | ELSE NULL 89 | END AS fac_dat_next 90 | FROM :tfacs1; 91 | 92 | -- Fill previous and next factory dates for all other dates 93 | tfacs3 = 94 | SELECT ident, 95 | calendardate, 96 | weekday, 97 | CASE WHEN weekday = '0' 98 | THEN MIN(fac_dat_next) OVER ( PARTITION BY ident ORDER BY calendardate ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) 99 | ELSE calendardate 100 | END AS fac_dat_next, 101 | CASE WHEN weekday = '0' 102 | THEN MAX(fac_dat_prev) OVER ( PARTITION BY ident ORDER BY calendardate ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) 103 | ELSE calendardate 104 | END AS fac_dat_prev 105 | FROM :tfacs2; 106 | 107 | RETURN 108 | SELECT ident AS FactoryCalendar, 109 | calendardate AS CalendarDate, 110 | CASE WHEN weekday = '0' THEN ' ' 111 | WHEN weekday = '1' THEN 'X' 112 | END AS weekday, 113 | fac_dat_next AS FactoryDate, 114 | fac_dat_prev AS PreviousFactoryDate 115 | FROM :tfacs3; 116 | 117 | ENDMETHOD. 118 | 119 | ENDCLASS. -------------------------------------------------------------------------------- /S4HANAEmbeddedAnalyticsSpendReporting/ZI_SpendExceptionCube.abap: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZSPENDEXCC' 2 | @AccessControl.authorizationCheck: #CHECK 3 | @VDM.viewType: #COMPOSITE 4 | @Analytics.dataCategory: #CUBE 5 | @EndUserText.label: 'Spend' 6 | define view ZI_SpendExceptionCube 7 | as select from ZI_SpendExceptionFact 8 | association [0..1] to I_CompanyCode as _CompanyCode on $projection.CompanyCode = _CompanyCode.CompanyCode 9 | association [1..1] to I_JournalEntry as _JournalEntry on $projection.CompanyCode = _JournalEntry.CompanyCode 10 | and $projection.FiscalYear = _JournalEntry.FiscalYear 11 | and $projection.AccountingDocument = _JournalEntry.AccountingDocument 12 | association [0..1] to I_FiscalYearForCompanyCode as _FiscalYear on $projection.FiscalYear = _FiscalYear.FiscalYear 13 | and $projection.CompanyCode = _FiscalYear.CompanyCode 14 | association [0..1] to I_Supplier as _Supplier on $projection.Supplier = _Supplier.Supplier 15 | association [0..1] to I_AccountingDocumentType as _AccountingDocumentType on $projection.AccountingDocumentType = _AccountingDocumentType.AccountingDocumentType 16 | association [0..1] to I_PostingKey as _PostingKey on $projection.PostingKey = _PostingKey.PostingKey 17 | association [0..1] to I_GLAccount as _GLAccount on $projection.GLAccount = _GLAccount.GLAccount 18 | and $projection.CompanyCode = _GLAccount.CompanyCode 19 | association [0..1] to I_ControllingArea as _ControllingArea on $projection.ControllingArea = _ControllingArea.ControllingArea 20 | association [0..*] to I_CostCenter as _CostCenter on $projection.CostCenter = _CostCenter.CostCenter 21 | and $projection.ControllingArea = _CostCenter.ControllingArea 22 | association [0..1] to I_PaymentTerms as _PaymentTerms on $projection.PaymentTerms = _PaymentTerms.PaymentTerms 23 | association [0..1] to I_Currency as _CompanyCodeCurrency on $projection.CompanyCodeCurrency = _CompanyCodeCurrency.Currency 24 | association [0..1] to I_Currency as _TransactionCurrency on $projection.TransactionCurrency = _TransactionCurrency.Currency 25 | association [0..1] to I_Currency as _GroupCurrency on $projection.GroupCurrency = _GroupCurrency.Currency 26 | { 27 | @ObjectModel.foreignKey.association: '_CompanyCode' 28 | key CompanyCode, 29 | @ObjectModel.foreignKey.association: '_JournalEntry' 30 | key AccountingDocument, 31 | @ObjectModel.foreignKey.association: '_FiscalYear' 32 | key FiscalYear, 33 | key AccountingDocumentItem, 34 | @ObjectModel.foreignKey.association: '_Supplier' 35 | key Supplier, 36 | @ObjectModel.foreignKey.association: '_AccountingDocumentType' 37 | AccountingDocumentType, 38 | @ObjectModel.foreignKey.association: '_PostingKey' 39 | PostingKey, 40 | ClearingAccountingDocument, 41 | ClearingDocFiscalYear, 42 | ClearingItem, 43 | LineItemID, 44 | @ObjectModel.foreignKey.association: '_GLAccount' 45 | GLAccount, 46 | @ObjectModel.foreignKey.association: '_ControllingArea' 47 | ControllingArea, 48 | @ObjectModel.foreignKey.association: '_CostCenter' 49 | CostCenter, 50 | @ObjectModel.foreignKey.association: '_PaymentTerms' 51 | PaymentTerms, 52 | PostingDate, 53 | @EndUserText.label: 'Posting Month' 54 | PostingMonth, 55 | @ObjectModel.foreignKey.association: '_CompanyCodeCurrency' 56 | @Semantics.currencyCode: true 57 | CompanyCodeCurrency, 58 | @ObjectModel.foreignKey.association: '_TransactionCurrency' 59 | @Semantics.currencyCode: true 60 | TransactionCurrency, 61 | @Semantics.currencyCode: true 62 | @ObjectModel.foreignKey.association: '_GroupCurrency' 63 | GroupCurrency, 64 | @DefaultAggregation: #SUM 65 | @Semantics.amount.currencyCode: 'CompanyCodeCurrency' 66 | AmountInCompanyCodeCurrency, 67 | @DefaultAggregation: #SUM 68 | @Semantics.amount.currencyCode: 'TransactionCurrency' 69 | AmountInTransactionCurrency, 70 | @DefaultAggregation: #SUM 71 | @Semantics.amount.currencyCode: 'GroupCurrency' 72 | AmountInGroupCurrency, 73 | _CompanyCode, 74 | _JournalEntry, 75 | _FiscalYear, 76 | _Supplier, 77 | _AccountingDocumentType, 78 | _PostingKey, 79 | _GLAccount, 80 | _ControllingArea, 81 | _CostCenter, 82 | _PaymentTerms, 83 | _CompanyCodeCurrency, 84 | _TransactionCurrency, 85 | _GroupCurrency 86 | } 87 | -------------------------------------------------------------------------------- /ABAPCDSConsumptionViewFeaturesUltimateTest/zsapbc_flight_cube4.abap: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZSFLIGHT_CUBE4' 2 | @AbapCatalog.compiler.compareFilter: true 3 | @Analytics: { dataCategory: #CUBE, dataExtraction.enabled: true } 4 | @AccessControl.authorizationCheck:#CHECK 5 | @EndUserText.label: 'Flight Cube 4' 6 | 7 | define view zsapbc_flight_cube4 with parameters 8 | p_display_currency : s_currcode, 9 | p_year_1: rscalyear, 10 | p_year_2: rscalyear 11 | as select from zsapbc_flight_fact4( p_display_currency: $parameters.p_display_currency ) as flight 12 | association [1..1] to zsapbc_carr_dimension as _carr on $projection.carrid = flight.carrid 13 | association [0..*] to zsapbc_region_dimension3 as _region on $projection.region = flight.region 14 | { 15 | @ObjectModel.foreignKey.association: '_carr' 16 | key flight.carrid, 17 | key flight.connid, 18 | @EndUserText.label: 'Date' 19 | key flight.fldate, 20 | @EndUserText.label: 'Region' 21 | @ObjectModel.foreignKey.association: '_region' 22 | flight.region, 23 | _carr, 24 | _region, 25 | @Semantics.calendar.yearMonth: true 26 | @EndUserText.label: 'Month' 27 | flight.flmonth, 28 | @Semantics.calendar.year: true 29 | @EndUserText.label: 'Year' 30 | flight.flyear, 31 | @Semantics.currencyCode: true 32 | @EndUserText.label: 'Booking Currency' 33 | flight.currency, 34 | @Semantics.amount.currencyCode: 'Currency' 35 | @DefaultAggregation: #SUM 36 | @EndUserText.label: 'Booking (bc)' 37 | flight.payment, 38 | @Semantics.quantity.unitOfMeasure: 'Currency' 39 | @DefaultAggregation: #SUM 40 | @EndUserText.label: 'Booking (bc) Year 1' 41 | case when flyear = :p_year_1 then payment 42 | else 0 43 | end as payment_year_1, 44 | @Semantics.quantity.unitOfMeasure: 'Currency' 45 | @DefaultAggregation: #SUM 46 | @EndUserText.label: 'Booking (bc) Year 2' 47 | case when flyear = :p_year_2 then payment 48 | else 0 49 | end as payment_year_2, 50 | @EndUserText.label: 'Display Currency' 51 | $parameters.p_display_currency as disp_curr, 52 | @Semantics.amount.currencyCode: 'disp_curr' 53 | @EndUserText.label: 'Booking (dc)' 54 | @DefaultAggregation: #SUM 55 | flight.payment_disp_curr, 56 | @Semantics.quantity.unitOfMeasure: 'disp_curr' 57 | @DefaultAggregation: #SUM 58 | @EndUserText.label: 'Booking (dc) Year 1' 59 | case when flyear = :p_year_1 then payment_disp_curr 60 | else 0 61 | end as payment_disp_curr_year_1, 62 | @Semantics.quantity.unitOfMeasure: 'disp_curr' 63 | @DefaultAggregation: #SUM 64 | @EndUserText.label: 'Booking (dc) Year 2' 65 | case when flyear = :p_year_2 then payment_disp_curr 66 | else 0 67 | end as payment_disp_curr_year_2, 68 | @Semantics.quantity.unitOfMeasure: 'disp_curr' 69 | @DefaultAggregation: #MAX 70 | @EndUserText.label: 'Booking (dc) Ttl Year 1' 71 | case when flyear = :p_year_1 then payment_disp_curr_total 72 | else 0 73 | end as payment_disp_curr_total_year_1, 74 | @Semantics.quantity.unitOfMeasure: 'disp_curr' 75 | @DefaultAggregation: #MAX 76 | @EndUserText.label: 'Booking (dc) Ttl Year 2' 77 | case when flyear = :p_year_2 then payment_disp_curr_total 78 | else 0 79 | end as payment_disp_curr_total_year_2, 80 | @Semantics.unitOfMeasure: true 81 | @EndUserText.label: 'UOM' 82 | flight.unit, 83 | @Semantics.unitOfMeasure: true 84 | @EndUserText.label: '%' 85 | cast( '%' as abap.unit( 3 ) ) as unit_percent, 86 | @Semantics.quantity.unitOfMeasure: 'unit' 87 | @DefaultAggregation: #SUM 88 | @EndUserText.label: 'Seats Max Econ.' 89 | flight.seatsmax, 90 | @Semantics.quantity.unitOfMeasure: 'unit' 91 | @DefaultAggregation: #SUM 92 | @EndUserText.label: 'Seats Max Bus.' 93 | flight.seatsmax_b, 94 | @Semantics.quantity.unitOfMeasure: 'unit' 95 | @DefaultAggregation: #SUM 96 | @EndUserText.label: 'Seats Max 1st' 97 | flight.seatsmax_f, 98 | @Semantics.quantity.unitOfMeasure: 'unit' 99 | @DefaultAggregation: #SUM 100 | @EndUserText.label: 'Seats Max Total' 101 | seatsmax_total, 102 | @Semantics.quantity.unitOfMeasure: 'unit' 103 | @DefaultAggregation: #SUM 104 | @EndUserText.label: 'Seats Max Year 1' 105 | case when flyear = :p_year_1 then seatsmax_total 106 | else 0 107 | end as seatsmax_total_year_1, 108 | @Semantics.quantity.unitOfMeasure: 'unit' 109 | @DefaultAggregation: #SUM 110 | @EndUserText.label: 'Seats Max Year 2' 111 | case when flyear = :p_year_2 then seatsmax_total 112 | else 0 113 | end as seatsmax_total_year_2, 114 | @Semantics.quantity.unitOfMeasure: 'unit' 115 | @DefaultAggregation: #SUM 116 | @EndUserText.label: 'Seats Occ Econ.' 117 | flight.seatsocc, 118 | @Semantics.quantity.unitOfMeasure: 'unit' 119 | @DefaultAggregation: #SUM 120 | @EndUserText.label: 'Seats Occ Bus.' 121 | flight.seatsocc_b, 122 | @Semantics.quantity.unitOfMeasure: 'unit' 123 | @DefaultAggregation: #SUM 124 | @EndUserText.label: 'Seats Occ 1st' 125 | flight.seatsocc_f, 126 | @Semantics.quantity.unitOfMeasure: 'unit' 127 | @DefaultAggregation: #SUM 128 | @EndUserText.label: 'Seats Occ Total' 129 | seatsocc_total, 130 | @Semantics.quantity.unitOfMeasure: 'unit' 131 | @DefaultAggregation: #SUM 132 | @EndUserText.label: 'Seats Occ Year 1' 133 | case when flyear = :p_year_1 then seatsocc_total 134 | else 0 135 | end as seatsocc_total_year_1, 136 | @Semantics.quantity.unitOfMeasure: 'unit' 137 | @DefaultAggregation: #SUM 138 | @EndUserText.label: 'Seats Occ Year 2' 139 | case when flyear = :p_year_2 then seatsocc_total 140 | else 0 141 | end as seatsocc_total_year_2, 142 | @Semantics.quantity.unitOfMeasure: 'unit_percent' 143 | @DefaultAggregation: #MAX 144 | @EndUserText.label: '100%' 145 | 100 as hundred 146 | } 147 | -------------------------------------------------------------------------------- /MB5LTransactionCDSViewEquivalent/ZI_MaterialStock.txt: -------------------------------------------------------------------------------- 1 | @AbapCatalog.sqlViewName: 'ZIMATERIALSTOCK' 2 | @EndUserText.label: 'Material Stock calculation' 3 | 4 | @VDM.lifecycle.contract.type: #PUBLIC_LOCAL_API 5 | @AbapCatalog.preserveKey: true 6 | @AbapCatalog.compiler.compareFilter: true 7 | @AccessControl.authorizationCheck: #CHECK 8 | @ObjectModel.usageType.sizeCategory: #XXL 9 | @ObjectModel.usageType.serviceQuality: #D 10 | @ObjectModel.usageType.dataClass:#TRANSACTIONAL 11 | @ClientHandling.algorithm: #SESSION_VARIABLE 12 | 13 | @VDM.viewType: #COMPOSITE 14 | @Analytics.dataCategory:#CUBE 15 | 16 | @Metadata: { 17 | allowExtensions: true, 18 | ignorePropagatedAnnotations: true 19 | } 20 | 21 | /*+[hideWarning] { "IDS" : [ "KEY_CHECK" ] } */ 22 | 23 | define view ZI_MaterialStock 24 | as select from I_MaterialStock_Aggr 25 | 26 | association [1..1] to I_Material as _Material on $projection.Material = _Material.Material 27 | association [1..1] to I_CompanyCode as _CompanyCode on $projection.companycode = _CompanyCode.CompanyCode 28 | association [1..1] to I_Plant as _Plant on $projection.Plant = _Plant.Plant 29 | association [0..1] to I_StorageLocation as _StorageLocation on $projection.Plant = _StorageLocation.Plant 30 | and $projection.StorageLocation = _StorageLocation.StorageLocation 31 | association [0..1] to I_Supplier as _Supplier on $projection.Supplier = _Supplier.Supplier 32 | association [0..1] to I_Customer as _Customer on $projection.Customer = _Customer.Customer 33 | association [0..1] to I_Supplier as _SpecialStockIdfgStockOwner on $projection.SpecialStockIdfgStockOwner = _SpecialStockIdfgStockOwner.Supplier 34 | association [1..1] to I_InventoryStockType as _InventoryStockType on $projection.InventoryStockType = _InventoryStockType.InventoryStockType 35 | association [1..1] to I_InventorySpecialStockType as _InventorySpecialStockType on $projection.InventorySpecialStockType = _InventorySpecialStockType.InventorySpecialStockType 36 | association [1..1] to I_UnitOfMeasure as _UnitOfMeasure on $projection.MaterialBaseUnit = _UnitOfMeasure.UnitOfMeasure 37 | -- View I_InvtryPrcBasicByKeyDate deliveres the same data as I_InventoryPriceByKeyDate but is performance optimized for stock value calculation from quantities 38 | -- View I_InventoryPriceByKeyDate has to stay for compatibility reasons (I_MaterialStock is C1 released) 39 | association [0..1] to I_InvtryPrcBasicByKeyDate as _InvtryPrcBasicByPeriodEndDate on $projection.CostEstimate = _InvtryPrcBasicByPeriodEndDate.CostEstimate 40 | association [0..1] to I_InventoryPriceByKeyDate as _InventoryPriceByPeriodEndDate on $projection.CostEstimate = _InventoryPriceByPeriodEndDate.CostEstimate 41 | and _InventoryPriceByPeriodEndDate.CurrencyRole = '10' 42 | //association [0..1] to I_CurrentMatlPriceByCostEst as _CurrentInvtryPrice on $projection.CostEstimate = _CurrentInvtryPrice.CostEstimate //Uladzislau Pralat 43 | association [0..1] to ZI_CurrentMatlPriceByCostEst as _CurrentInvtryPrice on $projection.CostEstimate = _CurrentInvtryPrice.CostEstimate //Uladzislau Pralat 44 | { 45 | // Stock Identifier 46 | @ObjectModel.foreignKey.association: '_Material' 47 | key Material, 48 | @ObjectModel.foreignKey.association: '_Plant' 49 | key Plant, 50 | @ObjectModel.foreignKey.association: '_StorageLocation' 51 | key StorageLocation, 52 | key Batch, 53 | @ObjectModel.foreignKey.association: '_Supplier' 54 | key Supplier, 55 | key SDDocument, 56 | key SDDocumentItem, 57 | key WBSElementInternalID, 58 | @ObjectModel.foreignKey.association: '_Customer' 59 | key Customer, 60 | @ObjectModel.foreignKey.association: '_SpecialStockIdfgStockOwner' 61 | key SpecialStockIdfgStockOwner, 62 | @ObjectModel.foreignKey.association: '_InventoryStockType' 63 | key InventoryStockType, 64 | @ObjectModel.foreignKey.association: '_InventorySpecialStockType' 65 | key InventorySpecialStockType, 66 | // Further Stock Groups 67 | @Semantics.fiscal.yearVariant: true 68 | key FiscalYearVariant, 69 | @Semantics.businessDate.at: true 70 | key MatlDocLatestPostgDate, 71 | // Units 72 | @Semantics.unitOfMeasure: true 73 | key MaterialBaseUnit, 74 | CostEstimate, 75 | @ObjectModel.foreignKey.association: '_CompanyCode' 76 | _CurrentInvtryPrice.CompanyCode, //Uladzislau Pralat 77 | _CurrentInvtryPrice.GLAccount, //Uladzislau Pralat 78 | 79 | 80 | // Quantities 81 | @Semantics.quantity.unitOfMeasure: 'MaterialBaseUnit' 82 | @DefaultAggregation : #SUM 83 | MatlWrhsStkQtyInMatlBaseUnit, 84 | @Semantics.quantity.unitOfMeasure: 'MaterialBaseUnit' 85 | @DefaultAggregation : #SUM 86 | MatlCnsmpnQtyInMatlBaseUnit, 87 | @Semantics.quantity.unitOfMeasure: 'MaterialBaseUnit' 88 | @DefaultAggregation : #SUM 89 | MatlStkIncrQtyInMatlBaseUnit, 90 | @Semantics.quantity.unitOfMeasure: 'MaterialBaseUnit' 91 | @DefaultAggregation : #SUM 92 | MatlStkDecrQtyInMatlBaseUnit, 93 | 94 | // Associations for names and descriptions 95 | _UnitOfMeasure, 96 | _Material, 97 | _CompanyCode, 98 | _Plant, 99 | _StorageLocation, 100 | _Supplier, 101 | _Customer, 102 | _SpecialStockIdfgStockOwner, 103 | _InventoryStockType, 104 | _InventorySpecialStockType, 105 | _InvtryPrcBasicByPeriodEndDate, 106 | _InventoryPriceByPeriodEndDate, 107 | _CurrentInvtryPrice 108 | } 109 | 110 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /S4HANAEmbeddedAnalyticsInventoryAgingReport/ZCL_RSROA_VARIABLES_EXIT.abap: -------------------------------------------------------------------------------- 1 | class ZCL_RSROA_VARIABLES_EXIT definition 2 | public 3 | final 4 | create public . 5 | 6 | public section. 7 | 8 | interfaces IF_BADI_INTERFACE . 9 | interfaces IF_RSROA_VARIABLES_EXIT_BADI . 10 | protected section. 11 | private section. 12 | 13 | methods GET_INVAGINGDATE 14 | returning 15 | value(RT_RANGE) type RSR_T_RANGESID . 16 | methods GET_INVAGINGRANGE 17 | importing 18 | !I_VNAM type RSZGLOBV-VNAM 19 | returning 20 | value(RT_RANGE) type RSR_T_RANGESID . 21 | methods GET_INVAGINGINTFLOWELIM 22 | returning 23 | value(RT_RANGE) type RSR_T_RANGESID . 24 | methods GET_INVAGINGRANGETEXT 25 | importing 26 | !I_VNAM type RSZGLOBV-VNAM 27 | !I_T_VAR_RANGE type RRS0_T_VAR_RANGE 28 | returning 29 | value(RT_RANGE) type RSR_T_RANGESID . 30 | methods CHECK 31 | importing 32 | !I_T_VAR_RANGE type RRS0_T_VAR_RANGE 33 | returning 34 | value(RT_RANGE) type RSR_T_RANGESID 35 | raising 36 | CX_RS_ERROR . 37 | methods CHECK_INVAGINGINTFLOWELIM 38 | importing 39 | !I_T_VAR_RANGE type RRS0_T_VAR_RANGE 40 | returning 41 | value(RT_RANGE) type RSR_T_RANGESID 42 | raising 43 | CX_RS_ERROR . 44 | methods CHECK_INVAGINGRANGE 45 | importing 46 | !I_T_VAR_RANGE type RRS0_T_VAR_RANGE 47 | returning 48 | value(RT_RANGE) type RSR_T_RANGESID 49 | raising 50 | CX_RS_ERROR . 51 | ENDCLASS. 52 | 53 | 54 | 55 | CLASS ZCL_RSROA_VARIABLES_EXIT IMPLEMENTATION. 56 | 57 | 58 | METHOD check. 59 | 60 | TRY. 61 | IF line_exists( i_t_var_range[ vnam = 'INVAGINGINTFLOWELIM' ] ). 62 | check_invagingintflowelim( i_t_var_range ). 63 | ELSEIF line_exists( i_t_var_range[ vnam = 'INVAGINGRANGE1' ] ) 64 | OR line_exists( i_t_var_range[ vnam = 'INVAGINGRANGE2' ] ) 65 | OR line_exists( i_t_var_range[ vnam = 'INVAGINGRANGE3' ] ) 66 | OR line_exists( i_t_var_range[ vnam = 'INVAGINGRANGE4' ] ). 67 | check_invagingrange( i_t_var_range ). 68 | ENDIF. 69 | CATCH cx_rs_error. 70 | RAISE EXCEPTION TYPE cx_rs_error. 71 | ENDTRY. 72 | rt_range = VALUE #( ). 73 | 74 | ENDMETHOD. 75 | 76 | 77 | METHOD check_invagingintflowelim. 78 | 79 | TRY. 80 | DATA(w_intflowelim) = CONV cacsyn( i_t_var_range[ vnam = 'INVAGINGINTFLOWELIM' ]-low ). 81 | IF w_intflowelim <> 'Y' AND w_intflowelim <> 'N'. 82 | DATA(w_msgv1) = |{ w_intflowelim } is not valid Internal Flow Elimination|. 83 | CALL FUNCTION 'RRMS_MESSAGE_HANDLING' 84 | EXPORTING 85 | i_class = 'OO' 86 | i_type = 'E' 87 | i_number = '000' 88 | i_msgv1 = w_msgv1. 89 | RAISE EXCEPTION TYPE cx_rs_error. 90 | ENDIF. 91 | CATCH cx_sy_itab_line_not_found. 92 | ENDTRY. 93 | 94 | ENDMETHOD. 95 | 96 | 97 | METHOD check_invagingrange. 98 | DATA: w_msgv1 TYPE string. 99 | 100 | TRY. 101 | DO 5 TIMES. 102 | DATA(w_test) = i_t_var_range[ vnam = |INVAGINGRANGE{ CONV i( sy-index ) }| ]-low. 103 | IF NOT matches( val = i_t_var_range[ vnam = |INVAGINGRANGE{ CONV i( sy-index ) }| ]-low regex = '^\d+$'). 104 | w_msgv1 = |Invalid Aging Range { CONV i( sy-index ) }|. 105 | CALL FUNCTION 'RRMS_MESSAGE_HANDLING' 106 | EXPORTING 107 | i_class = 'OO' 108 | i_type = 'E' 109 | i_number = '000' 110 | i_msgv1 = w_msgv1. 111 | RAISE EXCEPTION TYPE cx_rs_error. 112 | ELSEIF CONV i( i_t_var_range[ vnam = |INVAGINGRANGE{ CONV i( sy-index ) }| ]-low ) = 0. 113 | w_msgv1 = |Aging Range { CONV i( sy-index ) } should be greater then 0|. 114 | CALL FUNCTION 'RRMS_MESSAGE_HANDLING' 115 | EXPORTING 116 | i_class = 'OO' 117 | i_type = 'E' 118 | i_number = '000' 119 | i_msgv1 = w_msgv1. 120 | RAISE EXCEPTION TYPE cx_rs_error. 121 | ELSEIF ( sy-index > 1 ). 122 | IF CONV i( i_t_var_range[ vnam = |INVAGINGRANGE{ CONV i( sy-index ) }| ]-low ) <= 123 | CONV i( i_t_var_range[ vnam = |INVAGINGRANGE{ CONV i( sy-index - 1 ) }| ]-low ). 124 | w_msgv1 = |Aging Range { CONV i( sy-index ) } should be greater then Aging Range { CONV i( sy-index - 1 ) }|. 125 | CALL FUNCTION 'RRMS_MESSAGE_HANDLING' 126 | EXPORTING 127 | i_class = 'OO' 128 | i_type = 'E' 129 | i_number = '000' 130 | i_msgv1 = w_msgv1. 131 | RAISE EXCEPTION TYPE cx_rs_error. 132 | ENDIF. 133 | ENDIF. 134 | ENDDO. 135 | CATCH cx_sy_itab_line_not_found. 136 | ENDTRY. 137 | 138 | ENDMETHOD. 139 | 140 | 141 | METHOD get_invagingintflowelim. 142 | 143 | rt_range = VALUE #( ( sign = 'I' 144 | opt = 'EQ' 145 | low = 'Y' ) ). 146 | 147 | ENDMETHOD. 148 | 149 | 150 | METHOD get_invagingdate. 151 | 152 | rt_range = VALUE #( ( sign = 'I' 153 | opt = 'EQ' 154 | low = sy-datum ) ). 155 | 156 | ENDMETHOD. 157 | 158 | 159 | METHOD get_invagingrange. 160 | 161 | rt_range = VALUE #( ( sign = 'I' 162 | opt = 'EQ' 163 | low = SWITCH #( i_vnam+13(1) 164 | WHEN '1' THEN '180' 165 | WHEN '2' THEN '360' 166 | WHEN '3' THEN '540' 167 | WHEN '4' THEN '720' ) ) ). 168 | 169 | ENDMETHOD. 170 | 171 | 172 | METHOD get_invagingrangetext. 173 | 174 | TRY. 175 | rt_range = 176 | SWITCH #( i_vnam 177 | WHEN 'INVAGINGRANGETEXT1' 178 | THEN VALUE #( ( sign = 'I' 179 | opt = 'EQ' 180 | low = |0..{ CONV i( i_t_var_range[ vnam = 'INVAGINGRANGE1' ]-low ) }| ) ) 181 | WHEN 'INVAGINGRANGETEXT2' 182 | THEN VALUE #( ( sign = 'I' 183 | opt = 'EQ' 184 | low = |{ CONV i( i_t_var_range[ vnam = 'INVAGINGRANGE1' ]-low ) + 1 }..{ CONV i( i_t_var_range[ vnam = 'INVAGINGRANGE2' ]-low ) }| ) ) 185 | WHEN 'INVAGINGRANGETEXT3' 186 | THEN VALUE #( ( sign = 'I' 187 | opt = 'EQ' 188 | low = |{ CONV i( i_t_var_range[ vnam = 'INVAGINGRANGE2' ]-low ) + 1 }..{ CONV i( i_t_var_range[ vnam = 'INVAGINGRANGE3' ]-low ) }| ) ) 189 | WHEN 'INVAGINGRANGETEXT4' 190 | THEN VALUE #( ( sign = 'I' 191 | opt = 'EQ' 192 | low = |{ CONV i( i_t_var_range[ vnam = 'INVAGINGRANGE3' ]-low ) + 1 }..{ CONV i( i_t_var_range[ vnam = 'INVAGINGRANGE4' ]-low ) }| ) ) 193 | WHEN 'INVAGINGRANGETEXT5' 194 | THEN VALUE #( ( sign = 'I' 195 | opt = 'EQ' 196 | low = |{ CONV i( i_t_var_range[ vnam = 'INVAGINGRANGE4' ]-low ) + 1 }..| ) ) ). 197 | CATCH cx_sy_itab_line_not_found. 198 | ENDTRY. 199 | 200 | ENDMETHOD. 201 | 202 | 203 | METHOD if_rsroa_variables_exit_badi~process. 204 | 205 | TRY. 206 | c_t_range = 207 | COND #( WHEN NOT c_t_range[] IS INITIAL 208 | THEN c_t_range 209 | WHEN i_step = 1 210 | THEN COND #( WHEN i_vnam = 'INVAGINGDATE' 211 | THEN get_invagingdate( ) 212 | WHEN matches( val = i_vnam regex = '^INVAGINGRANGE[1-4]$' ) 213 | THEN get_invagingrange( i_vnam = i_vnam ) 214 | WHEN i_vnam = 'INVAGINGINTFLOWELIM' 215 | THEN get_invagingintflowelim( ) ) 216 | WHEN i_step = 2 217 | THEN COND #( WHEN matches( val = i_vnam regex = '^INVAGINGRANGETEXT[1-5]$' ) 218 | THEN get_invagingrangetext( i_vnam = i_vnam 219 | i_t_var_range = i_t_var_range ) ) 220 | WHEN i_step = 3 221 | THEN check( i_t_var_range ) ). 222 | CATCH cx_rs_error. 223 | RAISE EXCEPTION TYPE cx_rs_error. 224 | ENDTRY. 225 | 226 | ENDMETHOD. 227 | ENDCLASS. --------------------------------------------------------------------------------