CDS Table Function Usage Scenario
CDS Table Function Usage Scenario
-------------------------------------------------------
Requirement: We need to extract the latest Reference Code for each Customer
based on the latest Reference Date(NOTE: the reference codes are not following the
same order as the reference dates)
Table Structure: (MANDT,CUSTOMER,REFCODE,REFDATE)
When we try with GROUP BY and MAX() in ABAP CDS the output is not correct:
(define view ZCDS_GRP as select from <> { key customer, max(refcode),max(refdate)}
group by customer )
Open order requested not goods issued scenario e.g. open order = requested – goods
issued. All calculations are done in CDS view table function using SQL.
Let me walk you thought set base calculations inside the table function.
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
-----------------------------
Static method COMBINE_SELTABS( ) of the new class CL_SHDB_SELTAB shall be used for
the conversion of SELECT-OPTIONS parameters (selection tables or range tables) into
an SQL WHERE clause when running on HANA DB.
2) Handling of dynamic WHERE clauses within the AMDP method using the function
APPLY_FILTER
Use the SQLScript function APPLY_FILTER to apply the selection criteria to the
selected data in the AMDP
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
-------------------------------
Adding custom fields to SAP Fiori apps in 3 steps. OData fields extensibility.