Section 17 of CDS. How Can I Fix the ABAP CDS GUID Mismatch Linking Issue?

I attempted to demonstrate Open SQL’s limitations in relation to SQL Script in my most recent piece. Today, I want to draw attention to a CDS constraint and provide a quick workaround. One issue with ABAP CDS Views is that you can’t join tables together if the GUIDs aren’t the same, that is, if one GUID is declared as CHAR and the other as RAW.

CRMD_PARTNER has PARTNER_NO defined as CHAR(32), while BUT000 has PARTNER_GUID defined as RAW(16). The mismatched join fields will cause an error and prevent the view from activating when you attempt to combine these two tables together in an ABAP CDS view. This limitation stems from the HANA SQL query language.

GUID is what we’ll be using for the demonstration. Any field with a mismatched data type could be the problem. And everyone would benefit from our modification.

Making another TYPE of view to handle the join is an easy way to get around this problem. What I’m talking about is an ABAP Dictionary View.Yes, the CDS View can be saved via the standard ABAP Dictionary View.

Dictionary views, as opposed to ABAP CDS views, use Native SQL, which enables the joining of data types that aren’t compatible for GUIDs.

Dictionary views don’t need source code entries, hence there isn’t a DDL source file connected with them because they are built within the SAP GUI editor (ABAP Perspective of HANA Studio or in regular GUI).

Several restrictions on dictionary views

Joins can only be made between tables.

Only INNER JOIN can be used to join them.

There is only one use per table in the view because you cannot alias table names.

No grouping or computation is feasible.

The aforementioned restrictions make it clear that these views must be kept basic, which is appropriate given our goal, which is to merely establish a connecting view between two tables so that it can be used with other, more intricate ABAP CDS views.

Dictionary views can be made using transaction code SE11 directly in the SAP GUI or via the ABAP perspective in SAP HANA Development Studio.

To create in SAP HANA Development Studio, take the following actions:

  • Visit the ABAP viewpoint.
  • Launch the package that needs the view added to it.
  • Expand the Folder Dictionary >> Views.
  • Right-click the name of the “Views” folder.
  • Choose “New Dictionary View.”
  • Alternatively
  • Visit the ABAP viewpoint.
  • To add the view, right-click on the package and select
  • Choose “Other ABAP repository object” by clicking New.
  • Slide open the Dictionary folder.
  • Choose Dictionary View, then Click Next.
  • Next

6. You’ll see the screen that follows.

You can construct two different kinds of views: External View and Dictionary View.In this instance, dictionary views are the only thing that matter.

7. Enter the view name desired and select Dictionary View

  1. The transaction code SE11 maintenance screen appears. From there, you may choose the relevant tabs to add tables, join criteria, fields to output, and selection criteria to apply.

Alternatively, the following procedures can be used to construct the view directly within the SAP GUI.

  • Put in the transaction code SE11.
  • After entering the view name, select Create.

After entering a description, specify the tables and necessary join requirements.

4. Fill out the required basic fields. For a link table, these should only include the CLIENT and the two GUIDs that are used in the join.

You can add more fields if you’d like, but remember that the main purpose of this view is to serve as a connecting table, so simplicity is preferable.

The type mismatch between the GUIDs will be displayed in the activation log, along with the following cautions.

After making all the necessary entries, save, activate, and designate to a transport.

We can disregard the alert.The database view is now available.

See Also: Complete SAP ABAP on HANA Tutorials.

As of right now, the following view can be used to join CRMD_PARTNER with BUT000 inside of an ABAP CDS view:

SELECT FROM CRMD_PARTNER AS PART
INNER JOIN ZVW_PARTNER_LINK AS LINK
ON LINK.CLIENT = PART.CLIENT 
AND LINK.PARTNER_NO = PART.PARTNER_NO
INNER JOIN BUT000 AS B000
ON B000.CLIENT = LINK.CLIENT
AND B000.PARTNER_GUID = LINK.PARTNER_GUID
{
<desired fields>
}

Take a good look at the database view in the sample above. By serving as the intermediary between the two CDS Views, the database view has successfully solved the issue of joining CRMD_PARTNER direct with BUT000 with GUID mismatch (data element mismatch). Additionally, as it is a CDS View, it allows for the possible use of LEFT OUTER JOIN between the tables.


  • Related Posts

    Part 28 of Advance SAPUI5: SAPUI5 Responsive Table – Contextual Width

    One of the most popular aspects of a responsive table is its automatic contextual width. Automatic contextual width refers to the way columns change from covert to popin content and…

    Accounting Entries for Inventory

    A vital component of corporate operations is inventory management, which makes sure that products are properly recorded, valued, and accounted for. In addition to showing a company’s financial health, accurate…

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    You Missed

    Part 28 of Advance SAPUI5: SAPUI5 Responsive Table – Contextual Width

    • By Varad
    • February 27, 2025
    • 23 views
    Part 28 of Advance SAPUI5: SAPUI5 Responsive Table – Contextual Width

    Accounting Entries for Inventory

    • By Varad
    • February 26, 2025
    • 29 views
    Accounting Entries for Inventory

    How may an existing ABAP report be converted to OOPs ABAP

    • By Varad
    • February 25, 2025
    • 40 views
    How may an existing ABAP report be converted to OOPs ABAP

    Advanced SAPUI5 – Part 26 – SAPUI5 Grid Table Sorting Feature

    • By Varad
    • February 24, 2025
    • 37 views
    Advanced SAPUI5 – Part 26 – SAPUI5 Grid Table Sorting Feature

    Upgrade SAPUI5-14: Utilizing SAPUI5, Create an e-Signature Pad

    • By Varad
    • February 23, 2025
    • 49 views
    Upgrade SAPUI5-14: Utilizing SAPUI5, Create an e-Signature Pad

    Important Tables with SAP FI

    • By Varad
    • February 22, 2025
    • 27 views
    Important Tables with SAP FI