on 2023 Aug 04 7:37 AM
I have added notification type field using UI annotation in the "create maintenance request" app. I want to restrict values which are coming in dropdown for this field. Currently, it fetches Y1, M1, M2, M3, M4, M5 values but I want it to show only M1 and M5. How can it be achieved?
This field is using following value Help in the projection view C_MAINTWORKREQUESTOVERVIEWTP:
Value help I_PMNotificationTypeStdVH fetches data from I_PMNotificationType and has @accesControl.authorizationCheck active.
Please suggest how can I restrict values for this dropdown?
Request clarification before answering.
Hi Gaurav,
If authorization based control approach is not solving your problem, then I would suggest you to try out below mentioned approach -
Backend -
Frontend -
{
"changeType": "appdescr_app_addAnnotationsToOData",
"content": {
"dataSourceId": "mainService",
"annotations": ["localAnnotations01"],
"annotationsInsertPosition": "END",
"dataSource": {
"localAnnotations01":{
"uri": "changes/annotations/annotations.xml",
"type": "ODataAnnotation"
}
}
}
}
Regards,
Shyam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gaurav,
Rather than code...
Have you considered simply using authorizations as per https://blogs.sap.com/2023/01/25/sap-fiori-for-sap-s-4hana-how-to-restrict-filter-values-in-sap-fior...
You can check if the OData Service respects the authorizations using https://blogs.sap.com/2023/08/01/sap-fiori-for-sap-s-4hana-finding-authorization-objects-for-sap-fio...
P.s. For questions about S/4HANA apps, please use tag "SAP Fiori for SAP S/4HANA" and remember to include your S/4HANA release!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jocelyn,
Thanks a lot for responding to my query.
I had already explored the authorization object level restriction. If I allow only M1 and M5 notification type for authorization object I_QMEL then all the places (all the CDS views/fiori applications) wherever this auth object is used, only these two values will be allowed for all the users.
But this restriction is needed only for this application. Is there any other option through which we can add value restriction?
User | Count |
---|---|
78 | |
29 | |
9 | |
7 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.