It is difficult to find always successor objects with standard methods, so this Excel-Sheet might help you to map your classic SAP tables to released CDS-Views.
Discussing with customers hands-on the "how" when it comes to the new way of creating extensions in SAP S/4HANA, Clean Core and ABAP Cloud are some of the key terms. Besides of the build-up of RAP knowledge and experience, the question of successor objects (which CDS view should I use instead of the table I use today?) seems to be slowing developers down from adopting the "clean" way of developing ABAP.
There are very useful tools for developers available, e.g. the released object trees in ADT, the cloudification repository or SAP's Business Accelerator Hub api.sap.com) that guide you through the jungle of new APIs.
All of the tools above rely on the successor information that is maintained for the classic objects. E.g. in Table MARA, you can see in the system as well as in the cloudification repository the successors (one of which is the famous I_Product). Unfortunately, there are some areas where the information given by SAP is not sufficient.
So the problem is: Which CDS-View to choose, if there is no successor mentioned in your table? (e.g. in T001L)
The approach as described in Andreas' Blog is straight forward - and still feels like reverse-engineering: There is a class available (cl_dd_ddl_field_tracker) that tells you all the base tables for every field for any given CDS view. With this class, you can build up a custom table containing all of the relations of classic tables and their fields to the existing CDS views in the system.
I personally used this in a first step for all C1-released CDS views and had a result of a low six digit number of relations, e.g.
CDS Entity | CDS Field | Base Table | Base Table field |
I_STORAGELOCATION | DIVISION | T001L | SPART |
If you store this data, you can then search for your Table (e.g. T001L) and identify which CDS view maps any field of your table.
Sticking with my example, I can identify that for T001L, there is "I_StorageLocation" that maps 9 of the fields (CONFIGDEPRECATIONCODE, VTWEG, SPART, XHUPF, XBLGO, WERKS, VKORG, LGORT, LGOBE) and is released for the usage in ABAP Cloud. So this is a good starting point, as there is no other view mapping that many fields!
However an important Disclaimer: This is not a guarantee, that this view is really a successor, e.g. there could be a limitation regarding the scope (like a fixed where condition in the CDS definition or missing columns. As an example you might check TADIR and its successor I_CUSTABAPOBJDIRECTORYENTRY, where only customer objects are in scope). But pragmatically speaking, having a starting point is better than having nothing.
In the tool approach linked in Andreas' Blog, you can of course extend this approach of "reverse engineering" over unreleased objects as well (maybe better take an unreleased CDS view that seems to be legit over the direct table access).
Still, while it is easy to lookup something and you do not need to code anything, I wanted to share my little Excel file with you (fun fact: Participants of the Vienna SAP CodeJam where the first to get the file shared - so join CodeJams! 😉).
Being a lot in workshops and talking in situations without immediate system access, this little Excel file was created. As I am a big fan of Excel and its Pivot Table functions (at the latest since working a lot with big ATC extracts before we had the custom code migration app), it was a natural step for me to create this little helper I want to share today.
In the analysis tab, you can scroll through a PivotTable that is build up based on the base table name (e.g. T001L) and you will see below all the CDS objects mapping a field of T001L (ordered by # of colums matched). It will lead you to the I_StorageLocation as a first hint, like mentioned above.
Note: The PivotTable is initially filtered on only base tables with no release state and on only views released for ABAP Cloud, as this is typically my use case.
Regarding the scope, this file is based on the extraction from an SAP S/4HANA 2023 FPS01 system (thanks, @DanielHuser!) and only contains the 106.946 lines of mapping information for the C1 released CDS Views in this system. (Otherwise, Excel is the wrong tool, as you struggle with millions of lines.)
In addition to the mapping, I also added the column "ABAP Cloud Released?" to check if the CDS view is released for ABAP Cloud (C1 release with ABAP for Cloud Development active), as there are views only released for key user tools.
Another information I added is if the table itself has a defined release state in the cloudification repository. Typically tables mentioned there have the status "NOT_TO_BE_RELEASED" and have most likely a successor assigned. In addition to this, I deleted all usages of the Client (MANDT) as it is not adding any value.
There are ~2.000 tables mentioned in the list, some of them have only "bad" mappings (e.g. only one field), but several having a legitimate candidate of a successor.
In case you have questions or ideas on how to improve this mapping, just leave a question here. I will try to update the link every now and then to have it not expiring!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
27 | |
25 | |
19 | |
14 | |
14 | |
11 | |
10 | |
9 | |
7 | |
7 |