Skip to Content
avatar image
Former Member

CDS View parameter within join


whats the correct syntax to user column values as parameter values on table joins at cds views?

i want the value lfgja from table prev to be used as parameter input at the join.

define view zbc_wcr_invent_6_months
as select from zbc_wcr_invent as prev
inner join zbc_wcr_invent_plus_month( p_yearIn:  :prev.lfgja , p_monIn: :prev.lfmon)  as future1  on future1.werks = prev.werks 
key prev.mandt,
key prev.vkorg,
key prev.spart,
prev.lfgja as prevlfgja,
prev.lfmon as prevlfmon,
prev.stockvalue as prevValue,
prev.stockvalue0815 as prevvalue0815,
future1.stockvalue as ValueFuture,
future1.stockvalue0815 as value0815Future

the joined view:

define view zbc_wcr_invent_plus_month
with parameters p_yearIn : abap.char(4),
               p_monIn: abap.char(2)
as select from zbc_wcr_invent_prev_mon_p_func ( p_yearIn: :p_yearIn, p_monIn: :p_monIn ) {//
    key werks,
sum (stockvalue) as stockvalue,
sum (stockvalue0815) as stockvalue0815
}  group by mandt,vkorg, werks, spart,lfgja,lfmon



Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Mar 29, 2017 at 09:13 AM

    Check the documentation to see that you cannot pass columns to parameters.

    Add comment
    10|10000 characters needed characters exceeded