2020 Nov 25 1:04 PM
Hi,
when i try to create a value help for sales document then i am getting an error like "Association _vb is not available"
@AbapCatalog.sqlViewName: 'ZTEST_ASSOCV'
@VDM.viewType: #BASIC
@Analytics.dataCategory: #FACT
define view ztest_assoc as
select from vbap association [1] to vbak as _vb
on $projection.vbeln = _vb.vbeln
{
@ObjectModel.foreignKey.association: '_vb'
key vbeln,
_vb
}
Please correct me.
2020 Nov 27 8:35 AM
Hi ,
used this code your error is resolved
@AbapCatalog.sqlViewName: 'ZSCN'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'SCN QNS'
define view ZYPRACTICE_SCN as select from vbap association [1] to vbak as _vb on $projection.vbeln = _vb.vbeln {
@ObjectModel.foreignKey.association: '_vb'
key vbeln ,
_vb
}
2020 Nov 27 8:50 AM
Hi Lavanya, i did not see any difference between both code.
2020 Nov 27 9:10 AM
Yeah i agree that one but i was executed my query i did not got that error
2020 Nov 27 2:20 PM
Hi Ram,
I think there are some restrictions related to association to use in Analytics Views. I checked after
removing @Analytics.dataCategory: #FACT from query which is getting activated successfully.
Alternatively as you need to creat value help instead of @ObjectModel.foreignKey.association: '_vb' you can use @Consumption.valueHelp:'_vb.vbeln' which is working with analytics view as shown in below.
@AbapCatalog.sqlViewName:'ZTEST_ASSOCJ'
@VDM.viewType:#BASIC
@Analytics.dataCategory:#FACT
define view ztest_assocv as
selectfrom vbap association[1]to vbak as _vb
on $projection.vbeln = _vb.vbeln
{
//@ObjectModel.foreignKey.association: '_vb'
@Consumption.valueHelp:'_vb.vbeln'
key vbeln,
_vb
}
Thanks - Sai
2020 Nov 29 6:36 AM
Hello @Jallipalli Sai, I tried your suggestion still value help is not appearing in RSRT Transaction.
2020 Dec 01 11:37 AM
Hi Ram Kumar,
use this code
@AbapCatalog.sqlViewName: 'zbsales'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Foreign key'
@VDM.viewType: #BASIC
@Analytics.dataCategory: #FACT
define view ZB_Sales_04 as select from vbap
association [1] to vbak as _vbak on $projection.vbeln = _vbak.vbeln {
@ObjectModel :
{
foreignKey.association: '_vbak'
}
key vbeln,
_vbak
}