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

    Important T codes for FI GL AR AP

    Details of T Codes Accounting for Finances SPRO Put in the IMG OX02 Company Code to Create, Verify, and Delete OX03. Create Business Area Functional Areas for OKBD OB45 Establish…

    Dynamically Download Data From Any SAP Table in ABAP-740 – Part 1

    A few days ago, one of my SAP BI/BW friends requested a program that would accept any table as input and download it as a file to the local machine.…

    Leave a Reply

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

    You Missed

    Important T codes for FI GL AR AP

    • By Varad
    • December 21, 2024
    • 19 views
    Important T codes for FI GL AR AP

    Dynamically Download Data From Any SAP Table in ABAP-740 – Part 1

    • By Varad
    • December 20, 2024
    • 13 views
    Dynamically Download Data From Any SAP Table in ABAP-740 – Part 1

    Error While Setting Up Trusted System RFC

    • By Varad
    • December 19, 2024
    • 11 views
    Error While Setting Up Trusted System RFC

     Credit Management T codes in SAP

    • By Varad
    • December 18, 2024
    • 24 views
     Credit Management T codes in SAP

    Troubleshooting SAP BD22: Delete Change Pointer Not Picking Correct Processed Messages

    • By Varad
    • December 17, 2024
    • 56 views
    Troubleshooting SAP BD22: Delete Change Pointer Not Picking Correct Processed Messages

    Working with Shell Scripts in SAP ABAP Environment

    • By Varad
    • December 16, 2024
    • 34 views
    Working with Shell Scripts in SAP ABAP Environment