Skip to Content

Selection criteria

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?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    Sep 07, 2015 at 10:33 PM

    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.


    hana_sel.JPG (15.7 kB)
    Add comment
    10|10000 characters needed characters exceeded

    • 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.  

  • Sep 07, 2015 at 05:36 AM

    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.

    Let's code association/navigation and data provider expand in OData service!

    Implementing Expand Entity/Entity Set

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

    $batch implementation of multiple operations on multiple entitysets in a single call

    Regards,

    Ekansh

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 07, 2015 at 05:38 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 07, 2015 at 09:45 PM

    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

    Add comment
    10|10000 characters needed characters exceeded