2025 Mar 21 2:29 PM - edited 2025 Mar 21 7:40 PM
Hello,
I'm doing the SAP CodeJam Tutorial, in Part 10: "Create Action Project to Post Data to CAP Service", Step 8: "Build My Orders screen", I need to bind the condition for "customer" to a formula containing "systemVars.currentUser.email", however the screenshot there shows that the condition is directly bound to "System variable" -> "Currently logged in user.email"
When I bind it like in that screenshot I don't get any data displayed in the preview, because the filter is set to "currentUser.email" instead of the actual email-address.
When I bind it via a formula it works as expected and the filter in the request is set to the correct email-address.
I'd like to know if this is a normal behavior, a bug or I'm missing something here.
Thank you!
Request clarification before answering.
To use the current user's email as a filter in a basic table with a data adapter in SAP, you can follow these steps:
Retrieve Current User's Email:
Apply Filter in Data Adapter:
Here is an example of how you can implement this in your SAP UI5 application:
// Retrieve the current user's email
var userEmail = sap.ushell.Container.getService("UserInfo").getEmail();
// Apply the filter in the table binding
<Table
id="idExternalFindingTable"
updateFinished="onupdateFinished"
inset="false"
growing="true"
growingThreshold="5"
items="{ path: 'maindata>/Findings',
parameters: { expand: 'assignedTeamUsers' },
filters: { path: 'user_userEmailId',
operator: 'EQ',
value1: userEmail }}">
</Table>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 8 | |
| 7 | |
| 6 | |
| 6 | |
| 5 | |
| 3 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.