2017 Mar 29 9:59 AM
Hi,
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,
mandt,
vkorg,
spart,
lfgja,
lfmon,
sum (stockvalue) as stockvalue,
sum (stockvalue0815) as stockvalue0815
} group by mandt,vkorg, werks, spart,lfgja,lfmon
thanks
Philipp
2017 Mar 29 10:13 AM
Check the documentation to see that you cannot pass columns to parameters.
2017 Mar 29 10:13 AM
Check the documentation to see that you cannot pass columns to parameters.
2020 Jul 01 8:48 PM
Hi Horst,
If you have a view with a parameter, then if we are not able to join with other views and use those fields as input to the parameters, the only way is to wrap the view with a parameter with another view. Is that the only way?
I have a scenario, where the date is an input parameter. I need to get this input date from a join from other tables. So the only way it appears is to wrap the view with a parameter with another view without this parameter but just a field instead.
Your feedback would be appreciated. I did post another question and tagged you but I did not hear back from you.
Thanks,
Jay
2020 Jul 03 11:05 PM
Why do you need the parameter? Is one more join not possible?
A date parameter requires a single date value. A literal, a parameter (with a default system field value or without), a session-variable. Even in AMDP you need something like a scalar variable. A field of a view is not scalar at all.