SAP Knowledge Base Article - Preview

2245602 - Number of fields in selection lists in unions must be the same - Error in ABAP CDS when using UNION

Symptom

ABAP CDS View cannot be activated when using a 'UNION' or 'UNION ALL' on two tables where the same data element exists with different fieldnames.

For example if you define a view Ycds_Error as:

select from rsecuserauth as a { a.uname as uname } union select from ust04 as b {b.bname as uname }

This results in an error in check / activation: "Number of fields in selection lists in unions must be the same". Both fields have the data element "XUBNAME" but the fieldnames are different: (BNAME and UNAME). If the fieldnames are equal the union works fine without error for example:

select from usr01 as a { a.bname as uname } union select from ust04 as b { b.bname as uname }


Read more...

Environment

SAP Hana Database 1.0

Product

SAP HANA, platform edition all versions

Keywords

Core Data Services (CDS) internal client handling; CDS client handling , KBA , HAN-DB , SAP HANA Database , Problem

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP for Me (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.