cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 oData filter in SinglePlanningCalendar

jakob_steen-petersen
Active Participant
216

Hi

I am using the Single Planning Calendar to show some reservations. In the OData service i have the option to filter by username. But i need to apply the filter when initializing the Planning Calendar. If i use this approach with Hardcoded username it is all fine:

<SinglePlanningCalendar id="SPC1" class="sapUiSmallMarginTop" title="Title " 
    						        stickyMode="All"
    						        startHour="7" 
    						        endHour="18" 
    						        fullDay="false"
    						        showWeekNumbers="true"
 appointments="{path: '/ReservationSet', filters:[{ path: 'Uname', operator: 'EQ', value1:'USERNAME' }]}" >

But of course i need the data to be filteret based on the Logged In username?!

Any good ideas?

Accepted Solutions (0)

Answers (2)

Answers (2)

jakob_steen-petersen
Active Participant

Hi Jhodel

Actually i am also the Backend Developer 🙂

We use a Frontend/backend approach - so when the call reaches the Backend system, the SY-UNAME is not the Actual user but a Technical user.

Also it could be usefull to filter on MULTIPLE users based on the App functions. I.ex. i could get the Users from the logged on user department in order to show data from all Colleages.

So i really need to apply the filter to the View.

jhodel18
Active Contributor
0 Kudos

Hi Jakob,

Do not do it in the UI, ask the backend developer to do the filtering in the backend OData service. Anything that is utilizing the login information to control the data is best dealt with in the backend.