‎2019 Feb 20 4:24 AM
Hello,
I am trying to use table function and AMDP Class method for one of the requirement. However table function is getting activated without any error but when I am trying to use that table function in consumption view... It throws error as 'ERROR READING INFOPROVIDER FOR CDS VIEW'
@EndUserText.label:'ZBHTBFTEST4'
define table function ZBH_TBF_TEST4
returns{
Mandt : abap.clnt;
Po: ebeln;-- ekko.ebeln
Vendor: elifn ;-- ekko.lifnr
Material: matnr ;-- ekpo.matnr
DocCat: bstyp;-- ekko.bstyp
Item: ebelp;-- ekpo.ebelp
NetPrice: bprei;-- ekpo.NETPR
PriceUnit: epein;-- ekpo.PEINH
Plant: ewerk;-- ekpo.werks
CreationDate: erdat;-- ekko.aedat
PriceControl: vprsv;-- mbew.vprsv
MaterialPrice: verpr;-- mbew.stprs/verpr
MaterialPriceUnit: peinh;-- mbew.peinh
}
implementedbymethod ZCL_BH_TBF4=>FETCH_DATA;
======================================================
@AbapCatalog.sqlViewName:'ZBHCTBFTEST4'
@AbapCatalog.compiler.compareFilter:true
@AccessControl.authorizationCheck:#NOT_REQUIRED
@VDM.viewType:#CONSUMPTION
@Analytics.query:true
@OData.publish:true
@EndUserText.label:'Test Consumption'
define view ZBH_C_TBF_TEST4 as select from ZBH_TBF_TEST4
{
@EndUserText.label:'Purchase Order'
key Po,
@Consumption.filter:{selectionType:#SINGLE,multipleSelections:false,mandatory:false}
key Vendor,
@Consumption.filter:{selectionType:#SINGLE,multipleSelections:false,mandatory:false}
key Material,
DocCat,
Item,
@DefaultAggregation:#SUM
@Semantics.amount.currencyCode:'ekko.waers'
NetPrice,
PriceUnit,
@Consumption.filter:{selectionType:#SINGLE,multipleSelections:false,mandatory:false}
Plant,
@Consumption.filter:{selectionType:#SINGLE,multipleSelections:false,mandatory:false}
CreationDate,
PriceControl,
@Semantics.amount.currencyCode:'t001.waers'
MaterialPrice,
MaterialPriceUnit
}
‎2019 Feb 21 6:30 AM
Try creating a simple basic view with a select query of fields from table function ZBH_TBF_TEST4 and then use this basic view in the consumption view.It will work
‎2019 Feb 21 6:30 AM
Try creating a simple basic view with a select query of fields from table function ZBH_TBF_TEST4 and then use this basic view in the consumption view.It will work
‎2019 Feb 21 10:01 AM
Hello Shilpa,
Thank you so much for the response. Suggestion worked. Only Minor change had to do was instead of Basic view made it as composite view as view contained few aggregated columns
@VDM.viewType: #COMPOSITE
@Analytics.dataCategory: #CUBE
@Analytics.dataExtraction.enabled: true
Another thing, Is it every time we have to make use of separate view to resolve this error ? can't we do changes in the original view
Cheers. Have a nice day !!!