I have no experience with ABAP programming and I'd like to know whether it's possible to call a 3rd party library with C programming language interface from within an SAP application.
To be more precise, the goal is to use the IBM CPLEX Optimizer (running on local machine) inside an SAP application. The Optimizer is a library and has an API adapted to C++, Java and .NET (C#, VB.NET). I suppose it's a DLL file.
So can you tell me whether it is possible to invoke the functions of an DLL from within an ABAP application?
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:
Please see https://support.sap.com/connectors for further info.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With