05-30-2012 11:59 AM
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
05-30-2012 12:58 PM
Hi Costas,
May be this link would be of some help -
Thanks.
Kumar Saurav.
05-30-2012 2:02 PM
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
06-05-2012 6:58 PM
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.