on ‎2022 Aug 23 4:59 AM
Hi experts....
I have developed a simple app using Fiori Elements to show products for a particular store. For the app to work the user needs to provide the store or select the store.

As you can see it's a fixed value drop down list that I was able to achieve using the following annotation.

So now my next assignment is to assign a default value to it e.g. store name "ABC"; to save the user time from selecting it. However, the default value must be one from the existing list of stores (i.e. . ZPOS_C_STORE_NAME)
Can anyone advise how I can achieve this using Annotations or by App extension?
So basically, when the app loads; then it should look something like this before I press GO:

The App just uses 2 CDS views one for the complete list of Stores and Products/Material and CDS2 that provides a list of stores (which I am using for the Drop-Down List).
Regards,
Pablo Ghosh Roy
Request clarification before answering.
Hi,
The annotation below should do the trick.
<Annotation Term="Common.FilterDefaultValue" String="ABC"/>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bernard,
Thank you so much for your response. Can you please advise; how can I retrieve the value "ABC" in this case without hardcoding the value "ABC"?
Do I need to create another CDS View that would only contain the default value "ABC" as a single row and associate it to the main CDS Service?
Regards,
Pablo Ghosh Roy
Hi Bernard,
Thank you again for your response and I apologise if you found my question vague.
The scenario is .... Users will be assigned to a particular store. So, when a user logs onto the app; I must default the value of the store to which the user is assigned to; however, they do have the option to change and see the data for other stores.
e.g. User A, B, C are assigned to Stores 1,2,3. So, when User A opens the app; they can see the value 1 defaulted in the Store; similarly, B will see the value 2 as the store and C will see 3.
Now I have a single CDS view that lists all the materials across all stores. "C_MAT_STOCK_BY_PLANT_CDS"
Then I have another CDS that has the list of store and store names (which forms the Value List). "C_STORE_NAME"
Now I am trying to find a way to default the Store in the Value List/Drop Down. (The relation between the store and user is maintained in a table).
Regards,
Pablo Ghosh Roy
You could add an association to your OData service (Consumer CDS view) where you have the user-to-store mapping.
You could then do a Fiori App extension, retrieve the store for the current user and set the relevant filter (i.e. your store filter) to the value retrieved.
Thank You Bernard. Your solution/suggestion worked.
Thanks Bernard.
| User | Count |
|---|---|
| 13 | |
| 8 | |
| 7 | |
| 5 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.