2024 Apr 18 12:51 PM
Hi Experts,
I have a scenario where I want to fetch records from standard table 'A' and display in a CDS.
Also, need to get records from custom table 'B' if it exists in server and display in same CDS.
So, if table - B exists then CDS should have records from both the tables (A & B)
else records from table A only.
kindly suggest me some way to get this resolved.
Thanks.
2024 Apr 19 5:33 AM
Hi,
this is exactly the behavior of LEFT OUTER JOIN.
Best regards,
Michael
2024 Apr 19 7:17 AM
I may not have explained my issue correctly. Let me try with tables and output expected.
Table A
Order (Key) | Notification (Key) | Operation (Key) | Notification text |
4000000 | 10000000 | 0010 | notif txt 1 |
4000001 | 10000001 | 0020 | notif txt 2 |
Custom Table B (if exist) will not have any data for Order, Operation . It will have data for Notification.
Notification (Key) | Notification text |
10000003 | Desc 1 |
10000004 | Desc 2 |
Output expected in CDS :
Order (Key | Notification (Key) | Operation (Key) | Notification text |
4000000 | 10000000 | 0010 | notif txt 1 |
4000001 | 10000001 | 0020 | notif txt 2 |
10000003 | Desc 1 | ||
10000004 | Desc 2 |
if I add association / join : i need to be confirmed that table B exist in system. only then i will be able to use that table and access its fields
if i add table function : we have to mention all tables which will be getting used in that method.
so, if the table does not exist then i will give error and table function will not activate.
Please suggest what can be other ways.
Thanks.