2023 Oct 13 5:36 PM
Ask: I have a CDS View which contains GLAccount for which I need to show the description in the report. There is also a filter at the GLAccount level where users can input multiple GLAccounts which they want to see in the report. Users will use SAC to view the report from the view.
Issue: As per below code, I'm able to see the GLAccount Description in the report only if I remove the filter on GLAccount. If I add filter on GLAccount then when user tries to enter another GLAccount (filter multipleselection = true) then they get error "Member ID not found". F4 is not showing up any values.
Code:
Composite View
@AbapCatalog.sqlViewName: 'ZCBVIEW'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'BasicCubeView'
@VDM.viewType: #COMPOSITE
@Analytics.dataCategory: #CUBE
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.sizeCategory: #XXL
@ObjectModel.usageType.dataClass: #MIXED
define view ZCB_VIEW
with parameters
P_CompanyCode : bukrs,
P_PostingStartDate : abap.dats,
P_PostingEndDate : abap.dats,
P_ProfitCenterGroup : setnamenew
as select from ZTF_VIEW(P_CompanyCode: $parameters.P_CompanyCode,
P_PostingStartDate: $parameters.P_PostingStartDate,
P_PostingEndDate: $parameters.P_PostingEndDate,
P_ProfitCenterGroup: $parameters.P_ProfitCenterGroup,
P_Client: $session.client)
association[0..*] to I_GLAccountText as _GLAccountText on _GLAccountText.ChartOfAccounts = '1000' and $projection.AccountNumber = _GLAccountText.GLAccount
{
CompanyCode,
LedgerGroup,
@ObjectModel.text.association: '_GLAccountText'
AccountNumber
Consumption View (WORKING): I am able to see the GLAccount description for AccountNumber field in the report
@AbapCatalog.sqlViewName: 'ZCQVIEW'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'ConsumptionView'
@VDM.viewType: #CONSUMPTION
@Analytics.query: true
@OData.publish: true
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.sizeCategory: #XXL
@ObjectModel.usageType.dataClass: #MIXED
define view ZCQ_VIEW
with parameters
@EndUserText.label: 'Company Code'
@Consumption.valueHelpDefinition: [ { entity: { name: 'C_CompanyCodeValueHelp', element: 'CompanyCode' } } ]
P_CompanyCode : bukrs,
@EndUserText.label: 'Posting Start Date'
P_PostingStartDate : abap.dats,
@EndUserText.label: 'Posting End Date'
P_PostingEndDate : abap.dats,
@EndUserText.label: 'Profit Center Group'
P_ProfitCenterGroup : setnamenew
as select from ZCB_VIEW(P_CompanyCode: $parameters.P_CompanyCode,
P_PostingStartDate: $parameters.P_PostingStartDate,
P_PostingEndDate: $parameters.P_PostingEndDate,
P_ProfitCenterGroup: $parameters.P_ProfitCenterGroup)
{
@EndUserText.label: 'Company Code'
CompanyCode,
@EndUserText.label: 'Ledger Group'
@Consumption.filter : { selectionType : #SINGLE,defaultValue: '0L' ,mandatory: false}
LedgerGroup,
@EndUserText.label: 'Account Number'
@Consumption.valueHelp: '_GLAccountText'
@AnalyticsDetails.query.display: #KEY_TEXT
AccountNumber
Consumption View (NOT WORKING): Once I add filter to the AccountNumber, in SAC I see the description coming up for default Account Number
but when I try to enter another AccountNumber, I get error "Member ID not found". Also F4 option doesnt show any values for AccountNumber
@AbapCatalog.sqlViewName: 'ZCQVIEW'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'ConsumptionView'
@VDM.viewType: #CONSUMPTION
@Analytics.query: true
@OData.publish: true
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.sizeCategory: #XXL
@ObjectModel.usageType.dataClass: #MIXED
define view ZCQ_VIEW
with parameters
@EndUserText.label: 'Company Code'
@Consumption.valueHelpDefinition: [ { entity: { name: 'C_CompanyCodeValueHelp', element: 'CompanyCode' } } ]
P_CompanyCode : bukrs,
@EndUserText.label: 'Posting Start Date'
P_PostingStartDate : abap.dats,
@EndUserText.label: 'Posting End Date'
P_PostingEndDate : abap.dats,
@EndUserText.label: 'Profit Center Group'
P_ProfitCenterGroup : setnamenew
as select from ZCB_VIEW(P_CompanyCode: $parameters.P_CompanyCode,
P_PostingStartDate: $parameters.P_PostingStartDate,
P_PostingEndDate: $parameters.P_PostingEndDate,
P_ProfitCenterGroup: $parameters.P_ProfitCenterGroup)
{
@EndUserText.label: 'Company Code'
CompanyCode,
@EndUserText.label: 'Ledger Group'
@Consumption.filter : { selectionType : #SINGLE,defaultValue: '0L' ,mandatory: false}
LedgerGroup,
@EndUserText.label: 'Account Number'
@Consumption.valueHelp: '_GLAccountText'
@AnalyticsDetails.query.display: #KEY_TEXT
@Consumption.filter : { multipleSelections: true, defaultValue: '12345', mandatory: true}
AccountNumber
Please let me know what am I doing wrong here and how can I make valuehelp for GLAccount work in both; filter and report level