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

Case Statement in CDS Views

Former Member
34,125

Hello,

In a CDS View how can I use the Case statement to validade a field that is not retrieved from an outer join?

Here follows the example:

How can I verigy if ekbe_mseg.belnr is empty?

Thank you.

1 ACCEPTED SOLUTION
Read only

simon_collet
Product and Topic Expert
Product and Topic Expert
16,723

Hi,

you're on the right path, the solution is

case when ekbe_mseg.belnr is null

  then '@S_LEDR@'

  else '@S_LEDG@'

  end as icon

Best regards,

Simon

Hello,

In a CDS View how can I use the Case statement to validade a field that is not retrieved from an outer join?

Here follows the example:

How can I verigy if ekbe_mseg.belnr is empty?

Thank you.

2 REPLIES 2
Read only

simon_collet
Product and Topic Expert
Product and Topic Expert
16,724

Hi,

you're on the right path, the solution is

case when ekbe_mseg.belnr is null

  then '@S_LEDR@'

  else '@S_LEDG@'

  end as icon

Best regards,

Simon

Read only

0 Likes
16,723

Hi Simon,

It worked. Thank you. The CDS View was activated successfully, but the editor does not seem to recognize the sintax. Is it normal?

Best Regards,

Luís Martins