Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9021

Re: Is it really necessary to make use of tables while implementing function imports

$
0
0

Hi Prathik,

 

Function import should work.

 

Your metadata looks fine. One point though - please make sure that the return type cardinality is correct in your case. It can be either an entity or an entity set. In your case it should be an entity I think.

 

In your DPC, execute action method -  I guess you have missed some things. You need to return the LV_RES in CR_DATA as an entity structure (return type of function import). So you need to create a local structure  ls_addition_entity of same type as the entity ADDITION with fields A, B, Res and fill the Res with LV_RES and other values. Now, use the following code:

 

copy_data_to_ref( EXPORTING is_data = ls_addition_entity

                   CHANGING  cr_data = cr_data ).

 

This should work.

 

Please remember that Function imports are custom operations which can be used if CRUD operation are not suited to one's requirements.

It may not require changing your FMs in order to create OData services.

 

Hope this helps.

 

Best regards,

Aakash


Viewing all articles
Browse latest Browse all 9021

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>