cancel
Showing results for 
Search instead for 
Did you mean: 

Help wanted in designing CDS & Fiori Elements: Approving hours over several days

Jan-WillemK
Active Participant
0 Kudos

Hello,

I am creating a Fiori-Elements app that lets a manager approve hours. We use the "standard" SAP CATS functionality, and are still using SAP ECC. The hours are booked on a daily basis, and the users have to choose an activity on which they book their hours. Every activity corresponds to a WBS element. All WBS elements are assigned to a project.

What I want is that a project manager gets an overview of all the hours written on a project for which he is responsible, for a given period. Something like this (excuse me for the black spots - I don't want to share details from my client):

For this I created CDS views in which I use parameters for the selection period and summarize the hours. I use this on several levels:

  • summarized per period & project ,
  • summarized per period & project & WBS-element
  • summarized per period & project & WBS-element & employee
  • summarized per period & project & WBS-element & employee & date

One schematic example for a CDS-view:

define view ZI_CATSDB with parameters
p_date_from: datab,
p_date_to: datbi
as select from catsdb join prps on prps.pspnr = catsdb.rproj
// some fields,
catsdb.rproj as wbsElement,
prps.psphi as project,
sum( catsquantity ) as hours
where workdate between $parameters.p_date_from and $parameters.p_date_to
group by ... // several fields

I use associations to be able to drill-down from project --> WBS --> employee --> date

I notice that during my development I continuously run into problems with the aggregation & summarization on multiple levels. For instance, if I want to import my CDS views in the Gateway Service Builder, I cannot use the predefined associations due to the parameters.

Question one:
What would be a good solution to display summarized hours ( from CATSDB ) and still being able to use drill-down navigation?


Another problem I experience is that in approving a (sub)set of hours, those entities are no longer existing and the Fiori Elements app yields an error. This is illustrated in the following example. These hours are written and need to be approved (the CDS shows only hours to be approved):

In the Project overview we see this:

More detail from the project Whisky, drilling down yields this:

This looks good, and we approve this. However, this leads to the fact that this entry does not exist anymore: the to-be-approved entry is changed to an approved entry. The OData service returns an empty Entity(set) and the Fiori Elements returns an error. In a more elaborate scenario (that my client wishes) is that a manager should be able to change the hours to another WBS element. This leads to a similar situation, in which the key of the displayed entity is changed and hence cannot be returned by the OData service.

Question two:
Does Fiori Elements support navigating to another page after executing an OData action? For instance by using a Side Effect?

Any suggestion would be more than welcome. I would welcome a different approach to my OData / CDS services, different use of Fiori Elements, navigating after using an OData action in my Fiori Elements app.

Thanks in advance!

Accepted Solutions (1)

Accepted Solutions (1)

Jan-WillemK
Active Participant
0 Kudos

I solved this with a lot of old-fashioned ABAP code in de *DPC_EXT coding, where I do some things with the parameters (getting them out of the REST-based URI and manually add them to the select.

A lot of labour, but it works.

Answers (0)