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: 

How to get a structure back from a dll function using ABAP????

Former Member
0 Kudos

Hi everyone,

I have a requirement to call a dll function that takes 2 parameters:

a) port enumerator

b) time delay in seconds

and returns back a structure consisting of 3 different text fields (all add up to 36 characters long).

I have manged to call the dll function using the

CALL METHOD OF Win32 'Register'
  EXPORTING
    #1 = 'epos_xenta.dll'
    #2 = '_EDPOS_InitComm'
    #3 = 'i=hh'
    #4 = 'r=l'.

CALL METHOD OF Win32 '_EDPOS_InitComm' = ret
  EXPORTING
    #1 = 3
    #2 = 4.

The problem is I don't know how to get back the return structure (how must i declare it, and how to pass it to the function etc).

The specs for the function are as follows:

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

int err = EDPOS_InitComm(port, timeout_sec, [cfgPOS])

This function should be the first one called by the ECR, and should be called only once per system boot. It

informs the EDPOS system about: a) in which serial port is the EFT/POS connected, and b) what time-out (in

seconds) to set for each transaction. The static transaction parameters are saved in the cfgPOS structure,

which is an output parameter. Note that, since no dynamic allocation occurs in the implementation, the output

parameter should be pre-allocated.

The function operates synchronously and when it returns with zero, it informs that the serial communication

with the EFT/POS was successful, and that the configuration is saved in cfgPOS. Otherwise, the return value is

non-zero, and this usually indicates a problem in the serial-port setup/connection.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Thanks for any help,

Costas

3 REPLIES 3

former_member186491
Contributor
0 Kudos

Hi Costas,

May be this link would be of some help -

   http://wiki.sdn.sap.com/wiki/display/Snippets/How+to+call+functions+from+a+client+DLL+in+an+ABAP+pro...

Thanks.

Kumar Saurav.

0 Kudos

Hi Kumar,

thanks for your reply. I have already seen this, but unfortunatelly it does not answer my main question: How can I get the return structure back using this method.

Costas

0 Kudos

Hi Costas,

If you mean Call Back from Non-ABAP - RFC Server Program - to ABAP, please have a look on this Help Link -

http://help.sap.com/saphelp_erp2004/helpdata/en/22/042899488911d189490000e829fbbd/frameset.htm

This may clear your doubts.

However, there are few Blogs - by Thomas Jung - available, that again give you better understandings, are as below -

  http://scn.sap.com/thread/75724

Thanks.

Kumar Saurav.