I have a RAP Read Only application with a button made with CDS Custom Entity.
This throws a popup with value help for user to pick a new departmentcode.
At the METHOD save_modified I am calling the email template created in SE80, the CDS view in email template is the Root CDS View which joins my custom table with sales tables.
The custom table has new departmentcode field which is getting updated.
How do I get the new departmentcode in email CDS instead of old departmentcode please?
Request clarification before answering.
Hi @sh4il3sh ,
Yes, the email content can remain configurable through the Email Templates application, so future changes to the subject or email body can be made without changing the ABAP code.
The issue here is not the template itself. Since the email is being triggered from save_modified, the updated departmentcode is still in the RAP transactional buffer, while the email template CDS reads the persisted database value. Therefore, the CDS can return the old value.
I would suggest triggering the email after the RAP changes have been successfully saved, so that the CDS data source can read the latest value.
This way, the solution would be:
RAP update ā save ā email template ā CDS ā latest value
The email template can then remain completely configurable, without requiring ABAP changes when the customer wants to modify the email text.
SAP references:
Hope this helps.
Regards,
Aravindhan Chandran šæ
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @sh4il3sh
The email template is likely reading data directly from the CDS view before the updated department code is committed to the database. In save_modified, the new value may exist only in the transactional buffer.
To get the new department code in the email:
Read the updated value from the RAP transactional buffer (entities) instead of the database.
Or trigger the email after successful save/commit so the CDS view reads the latest persisted data.
If using a CDS-based email template, ensure the updated record is committed before the template is generated.
Thanks,
Sravan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 6 | |
| 5 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 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.