{"id":7401,"date":"2025-08-05T16:15:26","date_gmt":"2025-08-05T10:45:26","guid":{"rendered":"https:\/\/www.sapewmhelp.com\/?post_type=question&#038;p=7401"},"modified":"2025-08-05T16:17:05","modified_gmt":"2025-08-05T10:47:05","slug":"creating-cds-view-with-table-join-and-where-condition","status":"publish","type":"question","link":"https:\/\/www.sapewmhelp.com\/?question=creating-cds-view-with-table-join-and-where-condition","title":{"rendered":"Creating CDS View with table Join and Where condition"},"content":{"rendered":"\r\n<p>Example CDS view to join delivery table LIKP and LIPS on VBELN field and with LFART in where condition<\/p>\r\n\r\n\r\n\r\n<div class=\"hcb_wrap\">\r\n<pre class=\"prism line-numbers lang-plain\"><code>------------------------------------------------------------\r\nCDS VIEW:\r\n------------------------------------------------------------\r\n@AbapCatalog.viewEnhancementCategory: [#NONE]\r\n@AccessControl.authorizationCheck: #NOT_REQUIRED\r\n@EndUserText.label: 'CDS - Inner Join'\r\n@Metadata.ignorePropagatedAnnotations: true\r\n@ObjectModel.usageType:{\r\n    serviceQuality: #X,\r\n    sizeCategory: #S,\r\n    dataClass: #MIXED\r\n}\r\ndefine view entity ZI_CDS_INNER_JOIN \r\nas select from LIKP               \/\/Left\r\ninner join LIPS                   \/\/Right\r\non LIKP.VBELN = LIPS.VBELN        \/\/Join Condition\r\n{\r\n    key likp.vbeln,\r\n    key lips.posnr,\r\n    likp.erdat,\r\n    likp.lfart,\r\n    lips.lfimg,\r\n    @Semantics.amount.currencyCode: 'meins'\r\n    lip.meins}\r\nwhere likp.lfart = 'LF'<\/code><\/pre>\r\n<\/div>\r\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","question-category":[173],"question_tags":[301,304,303,302,300],"class_list":["post-7401","question","type-question","status-publish","hentry","question-category-cdsviews","question_tags-cds-view-join","question_tags-implemenmt-where-condition-in-cds-view","question_tags-using-inner-join-in-cds-view","question_tags-using-join-in-cds-view","question_tags-where-condition-in-cds-view"],"_links":{"self":[{"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=\/wp\/v2\/question\/7401","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=\/wp\/v2\/question"}],"about":[{"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=\/wp\/v2\/types\/question"}],"author":[{"embeddable":true,"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7401"}],"wp:attachment":[{"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7401"}],"wp:term":[{"taxonomy":"question-category","embeddable":true,"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fquestion-category&post=7401"},{"taxonomy":"question_tags","embeddable":true,"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fquestion_tags&post=7401"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}