Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Error reading infoprovider for cds view - Table function

Former Member
3,076

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

}

1 ACCEPTED SOLUTION
Read only

shilpabasavaraj
Participant
1,090

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

2 REPLIES 2
Read only

shilpabasavaraj
Participant
1,091

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

Read only

Former Member
0 Likes
1,090

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 !!!