Quantcast
Channel: SCN : All Content - SAP Gateway
Viewing all articles
Browse latest Browse all 2823

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

$
0
0

Hi,

 

      In the process of trying out different stuff on NetWeaver Gateway Service Builder, I came across a scenario where i had to actually use an internal table to perform a simple addition operation at runtime.( which I think is a overhead on the performance, not sure though ! )

     I did this by implementing a custom action using function import ( My function import calls an RFC which basically accepts two input parameters and returns the sum). as an odata service.

 

For implementing this I had to write some code in ABAP to redefine RUNTIME ~EXECUTE_ACTION (A method in one of the run time objects generated).   

 

Here is the sequence of steps I did ...

 

Name of the gateway project : ZMY_OPS

Name of the RFC : ZF_GWADD

Name of the function import : FI_ADD

 

segw_startup.JPG

 

SEGW screen

 

 

ZF_GWADD.JPG

 

RFC enabled function module screen

 

metadata_1.JPG

 

metadata screen 1

 

metadata_2.JPG

metadata screen 2

 

 

workbench.JPG

 

Implementation of RUNTIME~EXECUTE ACTION method

 

 

FI_Query.JPG

 

Gateway client screen with the service URI ( " /sap/opu/odata/sap/ZMY_OPS_SRV/FI_ADD?A=4&B=9 " )

 

Well, after trying this out I dint get the sum of two numbers. as you can see in the image the parameters show the value as 0.

I tried setting breakpoints in the function module and debugging it and realised the values being passed in the URI is not taken by the import parameters (A & B).

 

WHAT I FINALLY DID....

 

I created a gateway model in ABAP workbench, created a mapping with the RFC parameters and created a query operation

I made a few changes in the RFC as well, I created the RFC with import parameters and table parameters and passed the values to import parameters and get the values into table parameters. ( So this is like making use of the tables in SAP)

 

I felt this is kind of a work around way considering the fact that NetWeaver Gateway Service Builder is primarily supposed to help Non - ABAPpers and may be even a overhead.

 

 

Could someone please throw light on this.

Would be of great help.

 

 

 

Thanks & Regards,

Prathik


Viewing all articles
Browse latest Browse all 2823

Trending Articles



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