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: 

SAP ABAP CDS Min Operation

nishantbansal91
Active Contributor
0 Kudos

Hi Team,

i want to get the from table PTRV_HEAD.

Table has 3 key fields.

REINR

PERNR

HDVRS : possile value is 99, 98, 97, 96

In CDS i want to fetch the complete table with only minimum record. I tried to use minimum but it returns me complete table. Below is my query. There is syntax error GROUP BY clause is missing.?

Can you please help me to solve it.

define view ZPTRV_HEAD as select from ptrv_head { mandt, pernr, reinr, min(hdvrs) as hdvrs, molga, morei, schem, kzrea, berei, kztkt, zort1, zland, hrgio,ndnst, kunde, datv1, uhrv1, datb1, uhrb1, dath1, uhrh1, datr1, uhrr1, agrz1, grgio, grber, uzkvg, zusag, endrg, depar, arrvl, retrn, dates, times, uname, repid, dantn, fintn, request, travel_plan, expenses, st_trgtg, st_trgall, periodenart, dat_reduc1, dat_reduc2, datv1_dienst, uhrv1_dienst, datb1_dienst, uhrb1_dienst, abordnung, st_trg_typ, st_wohn_typ, kein_reisegeld, tax_per_diem, tax_pd_man, tax_ov_man, exchange_date, rounding, dz_limit_180, calid )

Thanks
Nishant

0 REPLIES 0