cancel
Showing results for 
Search instead for 
Did you mean: 

what is main use of Function Imports

Former Member
0 Kudos

What is the use function imports in Gateway.

Accepted Solutions (0)

Answers (5)

Answers (5)

jaith_eranga
Explorer
0 Kudos

Direct answer to the question : I use GET to explain.

-With standard GET, it is not possible to filter by non-key fields in the data set which is returned.

- But with Function import : GET, it allows to filter data from non key fields

In below table: if you need to get all the user IDs for India, that's not possible with standard GET. (GET Entity method)
-with function import: GET , all the 3 userIDs are returend when India is passed in URL as a query parameter.

Refer to undertand when to use Function Import

Thank you
Jaith.

0 Kudos

Hi,

Whenever the given requirement does not fit into the crud operations, that time we will go for Function import in OData.

function imports are used to do the GET and POST operations for the requirements , which are not possible by the standard operations available in OData.

We will implement the function import code inside EXECUTE_ACTION method , by redefining this method in the DPC Extension class.

Based on non key field , if we want to fetch data , that time we can make use of the function imports and also it will be used in many scenarios, which are not possible by the standard operations.

Ragards,

Tanuja.

AbhijeetK
Active Participant
0 Kudos

Function Import is used when we dont want to send any payload data in request body, but passing some data(key like order) in URL or just calling that specific action(Function Import) that specific action is executed. Example in SAP EWM is like Picking, Packing or in SD and MM confirmation of any order where in only action need to execute with parameter, no need to payload in request.

So in SD, MM, PP for confirmation of any order just sending order number in url , confirmation action will be executed(where underneath method or function doesn't require any data except order).

Same for in EWM picking and packing, just need to pass order and corresponding function import will be executed.

As @Arkajeet Dasgupta mention few use case there as well if we see there is no need to pass any request body, which is necessary in Update and Create method.

0 Kudos

Hi Uday,

             Incase we need to perform specific actions at the backend we use function imports instead of common CRUDQ operations.Common examples would be manual ATP check/Release or Sales Orders or PO/etc. If you check the Standard Taskprocessing service for workflow task processing, you will find the events(approve/reject/etc) are handled internally by function imports and not by CRUDQ operations. Let me know if this helps.

Thanks

Arka

Ashg1402
Contributor
0 Kudos

Hi,

As we know that Gateway services performs CRUD operation via http/s call.

Function Imports are used to perform GET and POST for the scenarios which are not possible in standard.

For ex. we want to make an entity which shows the data from 2 or more tables , for that we can create a function import and write the working code in standard method provided - /IWBEP/IF_MGW_APPL_SRV_RUNTIME~EXECUTE_ACTION

For more info please refer to this link which explains the function import.

Function Imports - SAP Gateway Foundation (SAP_GWFND) - SAP Library

Regards

Ashish