<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>nested case statement in cds view &#8211; SAP EWM Help</title>
	<atom:link href="https://www.sapewmhelp.com/question-tag/nested-case-statement-in-cds-view/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.sapewmhelp.com</link>
	<description>SAP EWM questions answered by experts — ABAP, S/4HANA, warehouse management</description>
	<lastBuildDate>Tue, 05 Aug 2025 10:47:48 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.2</generator>
	<item>
		<title>How to use Case Statement in CDS View</title>
		<link>https://www.sapewmhelp.com/question/how-to-use-case-statement-in-cds-view/</link>
					<comments>https://www.sapewmhelp.com/question/how-to-use-case-statement-in-cds-view/#respond</comments>
		
		<dc:creator><![CDATA[basantbharti]]></dc:creator>
		<pubDate>Tue, 05 Aug 2025 09:29:20 +0000</pubDate>
				<guid isPermaLink="false">https://www.sapewmhelp.com/?post_type=question&#038;p=7399</guid>

					<description><![CDATA[Here in this example, We are going to create CDS view with Case statement, here new field &#8220;DocText&#8221; will be added and value will be calculated based on below. &#160; &#160;]]></description>
										<content:encoded><![CDATA[
<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<p class="wp-block-paragraph">Here in this example, We are going to create CDS view with Case statement, here new field &#8220;DocText&#8221; will be added and value will be calculated based on below. </p>



<pre class="wp-block-code"><code>    case vbtyp
        when 'A' then 'Inquiry'
        when 'B' then 'Quotation'
        when 'C' then  
            case netwr
                 when 0 then 'Not Paid Order'
                else 'Paid Order'
            end    
        else 'Unknown'
    end as DocText, </code></pre>
</div></div>



<p class="wp-block-paragraph">&nbsp;</p>



<div class="hcb_wrap">
<pre class="prism line-numbers lang-plain"><code>@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'CDS - Session Variables'
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType:{
    serviceQuality: #X,
    sizeCategory: #S,
    dataClass: #MIXED
}
define view entity ZCDS_CASE 
as select from vbak
{
    key vbeln as SaleDoc,
    vbtyp as DocCatCode,
    vkorg as SalesOrg,
    vtweg as DistChannel,
    spart as Div,
    kunnr as CustNo,
    
    case vbtyp
        when 'A' then 'Inquiry'
        when 'B' then 'Quotation'
        when 'C' then  
            case netwr
                 when 0 then 'Not Paid Order'
                else 'Paid Order'
            end    
        else 'Unknown'
    end as DocText,     
}
</code></pre>
</div>



<p class="wp-block-paragraph">&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sapewmhelp.com/question/how-to-use-case-statement-in-cds-view/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
