on 2022 May 31 8:22 PM
Hi Expats
have a requirement to perform a select on a dynamic table in CDS view.
Table has name like /01/MDG/SID(SID is the systemID in suffix) so that table name gets changed in QA and PROD based on the system ID.
So in this case, how I can perform a select data from this table using CDS view ? My Final table name will be /01/MDG/DEV, where DEV represent the Development system ID.
when this object is moved to QA, it has a table name like /01/MDG/QAS.
The requirement is to achieve this using CDS view.
Thanks
Rufus Samuel
Normally in ABAP you were able to use SY-SYSID, however if I remember correctly this is not possible anymore in CDS views, only session variables left are client, user, language and date. If I remember correctly we can use a lookup of table TADIR based on the Object = 'SYST' and PGMID = 'HEAD' to get the system of our current environment fetching the SRCSYSTEM column.
With another customer the environment names didn't align with the system names, so we had to hard code an if else to set the name (not the prettiest solution, but it did the job).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
8 | |
6 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.