Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Create a dummy variable in CDS View

0 Likes
4,059

Hallo Experts,

In this CDS View -P_SalesAnalytics there are 3 CDS Views that are union ed and below are the CDS Views.


1.I_SlsDocSchedLineAnalytics--( i am adding two field to this View- Salesrepid and Salesrepname)

2.I_DeliveryDocItemAnalytics

3. I_BillingDocItemAnalytics( i was able to add to this view)

I am adding two field to one view.Since there is union used, i need to add a dummy fields in other 2 views.

How can i add 2 fields to the other CDS view. Any Suggesions.

Thanks

Madhu

2 REPLIES 2
Read only

former_member1716
Active Contributor
0 Likes
2,467

Madhu obireddy,

Below Sample code may help to some extend:

Select F1, F2, F3 from Table1

UNION

Select F1, Null as F2, Null as F3 From Table2

Note: It is not mandatory that the corresponding select statements should have same field names but it is mandatory that their Data types are same.

Regards

Read only

Nawanandana
Active Contributor
0 Likes
2,467

Hi,

please check sample code ABAP CDS - EXTEND VIEW