Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling external function

Former Member
0 Kudos

Hi Gurus!

Lets assume that our partner has a C or Java lib.

From this lib we have to call a function that takes a string and gives back a string.

I would

  • make a runnable program (in C or Java),
  • call the function in it,
  • copy the program to the server,
  • RFC that program in ABAP.

Is there any better solution for that performance wise?

Thanks,

Best Regards,

David.

5 REPLIES 5

raphael_almeida
Active Contributor
0 Kudos

Hi David,


Would not it be better to create a webservice and consume the values that you want?


You will need:

Created the service;
A PI or connection created directly in SAP (Tcode SM59) ;
ABAP developer to process the data.


Warm regards,


Raphael Pacheco.




0 Kudos

RFC will generally be better performing than a web service.

venkateswaran_k
Active Contributor
0 Kudos

Hi

To call a RFC from external system - you need a SAP connector.  For example Java based application, you need JCO connector, through which you can call the RFC from your external program.

Otherwise,

Write a ODATA service and consume it from your application.

Regards,

Venkat

Former Member
0 Kudos

Dear All,

thanks for the answers!

Raphael: the webservice seems like a big hassle since the client does not have dedicated webserver.

Venkat: if I create a server program and set it in SM59 then I do not need any connector at all. Am I right?

Matthew: I assume you had done stuff like that (since you commented on the performance...). Could you affirm me, that the whole process could be achieved like that:

  1. Write a server program in C using the sapnwrfc.h lib as in this example
  2. copy the program to the server
  3. register the destination in SM59
  4. write a function module in ABAP that will act as a client and RFC the server program with input parameters and receives the server's answer as output parameters

It is really a matter of performance, so if you could advice something better than pls. do!

Thanks and best regards,

David.

matt
Active Contributor
0 Kudos

If you use a web service, then there are additional layers and data conversions that you don't go through if you use direct RFC. It seems evident then, that RFC will be faster. CPIC is an alternative to RFC, but don't know much about. I seem to recall that RFC relies on CPIC, so CPIC is likely to be the absolute fastest.

You may find that a web service's performance is "good enough", however. So you need to balance the relative complexity of RFC (bespoke, SAP only interface) with the simplicity of a web service (global standard).