cancel
Showing results for 
Search instead for 
Did you mean: 

Selection criteria

anilkumar_raina
Participant
0 Kudos

My UI screen has top selection criteria based on which data needs to be extracted for different sections of screen.

Data Selection criteria

Company Code,  Profit center , Date Range   - Only one Company code can be selected but option to select multiple profit centers from dropdown and date range.

Now all 5 sections of screen shows summarized data(diff criteria) based on input from selection criteria. I know we can get this data through regular get_entity set method for each screen section but that will be like calling service multiple time for each of them. How can we accomplish this task in single service using expanded entity set method. It is like I wanted to use the top selection criteria to get all data and then summarize data for diff section and pass it back to UI. Not sure if it is possible?

Accepted Solutions (1)

Accepted Solutions (1)

anilkumar_raina
Participant
0 Kudos

Hi All

Thanks for your reply.

Let me put some more details to explain my scenario.

As mentioned in my post my data selection criteria has multiple input criteria (company codes, Profit center, Date Range) based on which I need to extract initial data and then summarize them based on diff criteria

Assume this to be my UI data selection criteria.

.  

Section 1 :Summarize data by Material

Output like :

[

{ "MATNR" :"1mk888888", "Amt": "450.20 " },

{ "MATNR" :"234k888888", "Amt": "150.20 " },

{ "MATNR" :"7888888888", "Amt": "250.20 " },

]

Section 2: Summarize data by Document type

Output like:

[

{ "DOCTYPE" :"PE", "Amt": "345678 " },

{ "DOCTYPE" :"XE", "Amt": "945678 " },

{ "DOCTYPE" :"YE", "Amt": "745678 " },

]

Section 3: Summarize by Profit center.

Output Like:

[

{ "PRCTR" :"PC01", "Amt": "307838 " },

{ "PRCTR" :"XC01", "Amt": "995678 " },

{ "PRCTR" :"UC01", "Amt": "305678 " },

]

Section 4: Summarize by F Year.

Output Like:

[

{ "FYEAR" :"2010", "Amt": "3679002 " },

{ "FYEAR" :"2011", "Amt": "7679002 " },

{ "FYEAR" :"2012", "Amt": "9679002 " },

]

All examples which i skimmed through SCN tend to concentrate on SO+SOITEM+PRODUCT as base example to explain expanded entity set which looks decent but with my scenario I am looking for more insight into correct approach for such scenarios where we may not have direct way to establish associations to leverage expanded entity set.

Appreciate your valuable feedback.

EkanshCapgemini
Active Contributor
0 Kudos

Hi Anil,

First of all, it would be better if you perform this aggregation/summarization logic in the backend. Coming to the gateway part, if you are not able to make a clear association with some common key properties, you can delete the referential constraint at the time of declaring the associations. So you can have association n navigations with any common key. Then implement the get_expanded_entityset method and get all 4-5 tables in the single call.

Otherwise you can opt for batch but the above method would be better in terms of performance as it is calling the RFC single time.

Regards,

Ekansh

anilkumar_raina
Participant
0 Kudos

Ekansh

Thanks for your valuable inputs.

Summary logic mentioned in question is in backend only.

I was finally able to pull data using expanded entity set by having one header level dummy entity as selection and rest other for different sections of screen using associations without referential constraints.  

Answers (3)

Answers (3)

Varamanoj
Participant
0 Kudos

Hi Anil,

you can use either Frame work expanded methodology or data provided expand to fulfill your requirement.

Both have their own Pros and Cons..

I prefer Data provided expand for better perfomance.

Manoj

kammaje_cis
Active Contributor
0 Kudos

Anil,

First I would expect you to have one Header entity and entityset.

For each section, I would create separate entity set (though pointing to same entity).

Then you will have different navigation properties from Header entity set to each section entityset.

When you do a $expand, you can mention all the navigations (pointing to sections) required.

Regards

Krishna

EkanshCapgemini
Active Contributor
0 Kudos

Hi Anil,

If the 5 sections on the screen are related to each other(i.e. you can define association between those entitysets), you can use data provider expand for your scenario and get data of all 5 entitysets in a single call.

If there is no association between those entitysets, you can use $batch to group these 5 calls into 1 single call.

Regards,

Ekansh