Application Development 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: 

Facing a Problem in ABAP CDS view related to join condition

Former Member
0 Kudos

example is ,

select from vbak as head

inner join vbap as item

inner join konv as cond

on head.knumv = cond.knumv

and item.posnr = cond.kposn and prc.cond_type = cond.kschl

inner join konh as kon

on on kon.knumh = cond.varcond (here i just need first 10 char of this field to be macth).

Can this is possible with CDS view??

4 REPLIES 4

horst_keller
Product and Topic Expert
Product and Topic Expert
0 Kudos

Yes, use the built-in function left for the RHS of the ON condition.

https://help.sap.com/http.svc/rc/abapdocu_752_index_htm/7.52/en-US/index.htm?file=abencds_f1_sql_fun...

0 Kudos

Thanks for the link.But this all operations does not support with the Join on condition.Like in my example i want first 10 char from my on condition cond.varcond .. i have tried of using substring and cast but it doesn't support here.

horst_keller
Product and Topic Expert
Product and Topic Expert
0 Kudos

It does support it

define view demo_cds_join1
  as select from spfli
    inner join   scarr on
      spfli.carrid = left( scarr.carrid, 2)
  { ...

horst_keller
Product and Topic Expert
Product and Topic Expert
0 Kudos

Right Hand Side