Skip to Content
0

Calling Multiple DropDowns from Single EntitySet

Jan 12 at 04:25 AM

130

avatar image
Former Member

Dear All

I have a function modules "ZGET_CUSTOMER" which returns Customer Details, Custom Bank Data and Customer Ship to Party in three different tables while taking customer as input.

I have three drop down boxes on my view having customer detail, banks and shiptoparty.

I want to call above mentioned function module only once in my entityset and want to return data for all three drop downs instead of calling Entityset and same function module three times.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

5 Answers

VIPLOVE KHUSHALANI Jan 12 at 06:46 AM
1

Hi Adnan

Did you develop the gateway service for this.. which you will use in you UI5 application ??

Cheers

Viplove

Show 3 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Dear Khushalani

I have created oData with entityset but function module is returning three tables while entityset can return only structure not table.

0
0
Former Member

Thanks VIPLOVE

Very close to my requirement but how to call these expand from UI5 when clicking dropdown box.

Any example for calling Expand on SAP UI screen, as usually we call entityset e.g. /SOHEADSet

0
Sharath M G Jan 12 at 07:29 AM
1

Firstly create one oData service with three entities for the dropdowns.

Handling the call to function modules is decided in the entity class linked to oData. Now, for the custom function module pass the customer ID and handle the calls to relevant tables and populate at one go.

Then, populate the entities.

If any doubt, check on oData forums on calling function module in the most optimal way.

Regards,

Sharath

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Dear Sharath

I want to call function module only once. If I will create three Entity sets then I have to add Function Module in each entity set, which means it will be called by App three time.


SPAN {
font-family: "Courier New";
font-size: 10pt;
color: #000000;
background: #FFFFFF;
}
.L0S31 {
font-style: italic;
color: #808080;
}
.L0S52 {
color: #0000FF;
}

FUNCTION ZGET_CUST_DETAILS.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(KUNNR) TYPE ZISOH-KUNNR
*" TABLES
*" BANKS STRUCTURE ZODATA_BANKDTL
*" CUST STRUCTURE ZODATA_CUST
*" STP STRUCTURE ZODATA_STP EndFunction
0

Not an OData guy. However, since its your custom function module and oData, you must be able to get the data you want without calling it multiple times.

Change the primary tag of your question to OData.

Regards,

Sharath

0
Simon Perstorfer Jan 14 at 10:03 AM
1

Hi,

do it like P P descriped it.
Create 3 entities and connect CustomerBank and ShipToParty via assosiation with CustomerData. Call the service via $expand to read all three entities in one call.

https://stackoverflow.com/questions/43255561/sap-ui-model-odata-odatamodel-passing-expand-parameters-in-read

oModel1.read("/CustomerData", {
    urlParameters: {
        "$expand": "CustomerBank,ShipToParty"
    }
});

Regards

Simon

Show 4 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Great Simon

Its working but now calling GET_EXPANDED_ENTITYSET 4 times instead of one time.

0
Former Member

Hi Simon

One more last step/support is required i.e. how to bind expanded entity to dropdown in UI5.

0

Hi Adnan,

if your view is bound to an entry of your root entity, you can bind the dropdown to the navigation property. F. e. if your view is bound to an entry of the root entity CustomerData you can bind your dropdown(s) to CustomerBank or ShipToParty.

Do you fill the ET_EXPANDED_TEC_CLAUSES (not shure if this is exactly the correct name of the exporting table)? If yes, you can debug a little bit whats happening after the call of GET_EXPANDED_ENTITYSET. Here gateway checks if all requestet expands are listet in this exporting table...

Regards
Simon

0
1
P P Jan 14 at 07:30 AM
0

In this requirement, create the associations and call it as single call from UI using $EXPAND.

try explore more on $expand features...

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Thanks how to bind back expanded entity with dropdown.

0
avatar image
Former Member Jan 12 at 06:42 AM
0

Any tip

Share
10 |10000 characters needed characters left characters exceeded