cancel
Showing results for 
Search instead for 
Did you mean: 

Passing default user parameter value in KPI Drilldown report

AbhishekSharma
Active Contributor
0 Kudos
930

Hi Gurus,

Please help, how to pass user default parameter value to KPI tile/Drilldown report. Please find below screenshot for what value I am trying to access in Tile/Drilldown report.

When user get into the Fiori account user should be able to get records from his/her default Warehouse.

As per my knowledge this can be done by maintaining values in Filter and Parameter section but I don't know what value to maintained and what changes are needed in my CDS view (apart from making it parameterized).

If there is any reference, please suggest.

Thanks-

Abhishek

ama_touzani13
Participant

Hello ,

The default parameters need to be activated before they can be used , these links explain how to :

https://blogs.sap.com/2017/09/14/activating-user-defaults-in-sap-s4hana/

https://blogs.sap.com/2017/09/14/applying-user-defaults-in-sap-s4hana/

To pass default warehouse , you can filter your CDS on the user warehouse by getting first the username and then its warehouse number.

Regards.

AbhishekSharma
Active Contributor
0 Kudos

Hi Amal,

Thanks much for reference blogs... since Warehouse is one of the default user parameter I want to use it in KPI report something like %%UserDefaults.Warehouse%% and in this way I no need to retrieve warehouse manually by first getting username and then the warehouse no.

Thanks-

Abhishek

ama_touzani13
Participant

Hello ,

You are welcome.

If the default Warehouse number works from the KPI , it is great , but in case not , you can do it from the CDS.

Regards.

View Entire Topic
AbhishekSharma
Active Contributor

Hi ama_touzani13

I got it working as below... Posting solution may be helpful for someone...

@Consumption : Helped solving problem.
@AbapCatalog.sqlViewName: 'ZTESTPARAM'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'CDS with Parameter test'
@VDM.viewType: #CONSUMPTION
@OData.publish: true

define view ZTEST_PARAM
    with parameters 
    
    @Consumption.hidden: true
    @Consumption.derivation: { lookupEntity: 'I_UserParameter_F2200',
    resultElement: 'UserParameterValue', binding: [
    { targetElement : 'UserParameter' , type : #CONSTANT, value : '/SCWM/LGN' } ]
    }
    p_LGNUM : /scwm/lgnum
as select from ZTEST_PARAM_I (p_lgnum : $parameters.p_LGNUM){
    
    WarehouseNo,
    WarehouseTask,
    WarehouseProcessCategory,
    MaterialId,
    DocumentCategory,
    USERNM,
    @DefaultAggregation:  #SUM
    cast ( 1 as abap.int4 ) as countRecord
}

Thanks-

Abhishek

ama_touzani13
Participant
0 Kudos

Thanks for Sharing.

sweta1196
Explorer
0 Kudos
Hello Abhishek,
sweta1196
Explorer
0 Kudos
What is 'I_UserParameter_F2200' passed to lookupEntity