Is a library (with C programming language interface) callable from within ABAP?

You can use external DLLs directly in a following manner:

 DATA: cmp_dll TYPE ole2_object.
 CREATE OBJECT cmp_dll 'COMPANY.STOCK_DLL'.
 CALL METHOD OF cmp_dll 'check_order' = order
 EXPORTING p_num = 'number'
           p_date = 'date'
           p_vendor = 'vendor'.

Prior to that you should register your DLL in SOLE transaction, it can be registered either on client or on application server (and thus accessible from any client).

The better option may be an RFC wrapper, mentioned by Trixx.
Also it is possible to run C code directly on AS via SXPG_COMMAND_EXECUTE but this is out of the scope of your question.


Yes, that's possible, but only with some own development at external side. For example, you can address and call external programs from ABAP via SAP's RFC protocol. The external program needs to use some SAP Connector SDK for receiving such a Remote Function Call. Then your own program can do whatever you want, of course also use some other programs or libraries.

SAP offers these RFC Connector SDKs for various programming languages and runtime environments:

  • for Java : the SAP Java Connector (JCo)
  • for .NET : the SAP .NET Connector (NCo)
  • for C/C++: the SAP NetWeaver RFC SDK (NW RFC SDK)

Please see https://support.sap.com/connectors for further info.

Tags:

Abap

Cplex