It is not ordinary but very easy to use DLL calls in ABAP language. Yuri Popov programmed a module, called DynamicWrapperX. It is an ActiveX component, which allow to call each function in a DLL you want via COM. A great module, you find the module here.
It is necessary before, with the transaction code SOLE, register the OLE application DynamicWrapperX in the SAP system. Type in:
And it is necessary to register DynamicWrapperX on the client system too, with regsvr32.exe dynwrapx.dll.
Look at the following example how easy it is to use a Windows function from USER32.DLL:
INCLUDE OLE2INCL. DATA: IDYes TYPE i VALUE 6, IDNo TYPE i VALUE 7. DATA: Win32 TYPE OLE2_OBJECT, ret TYPE i. CREATE OBJECT Win32 'DynamicWrapperX'. CALL METHOD OF Win32 'Register' EXPORTING #1 = 'user32.dll' #2 = 'MessageBoxW' #3 = 'i=hwwu' #4 = 'r=l'. CALL METHOD OF Win32 'MessageBoxW' = ret EXPORTING #1 = 0 #2 = 'Hello World' #3 = 'Test'#4 = 4. IF ret = IDYes. WRITE 'Ja'. ELSEIF ret = IDNo. WRITE 'Nein'. ELSE. WRITE '?'. ENDIF. FREE OBJECT Win32.
Important hint: This method works only with foreground jobs and online processes and not with background jobs and batch processes.
Enjoy the possibilities.