Application Development and Automation 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: 
Read only

Calling a function from a DLL, exectution in background mode.

Former Member
0 Likes
934

Dear Experts,

We have created an ABAP report the calls a function from a DLL file. If the report is executed in on-line mode the program calls and executes the function from the DLL, but if the ABAP programa is executed in background mode it doesnt calls the DLL function.

Do you know a way to solve the problem when executing in background mode?

Best regards.

Antonio

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
851

Hello,

What is happening is that the file should be in the server, not in the computer, rememeber that background jobs can donwload, upload or execute files that in the server, not in you computer.

You should put your dll file there, not in your computer.

Hope this helps,

Dont forget to reward!!

Gabriel P.

7 REPLIES 7
Read only

Former Member
0 Likes
852

Hello,

What is happening is that the file should be in the server, not in the computer, rememeber that background jobs can donwload, upload or execute files that in the server, not in you computer.

You should put your dll file there, not in your computer.

Hope this helps,

Dont forget to reward!!

Gabriel P.

Read only

0 Likes
851

Hello Gabriel,

The DLL file is located in the server, even so it doesnt work. Could it be another kind of problem? In theory it should be working pretty well, right?

Best regards.

Antonio

Read only

0 Likes
851

Gabriel,

Do you know where is the folder(path), that a need to put physcally the file in the server? There is some procedure to make it work?

Best regards.

Antonio

Read only

Former Member
0 Likes
851

Hello Antonio,

Sorry for the delay, what does your dll function return?, check if that dll works properly on the server..., also you can check the permisions on the folder and tha file access, it coulb be restricted.

Dont forget to reward if this was helpfull.

Gabriel P,.

Read only

0 Likes
851

Gabriel,

My DLL function is a phonetic function, it generates a phonetic string and return the string to the abap program. If I execute the abap programa in on-line mode in the server it works good, but in background mode it doesnt works.

Thanks.

Read only

Former Member
0 Likes
851

Hello Antonio,

Sorry for the delay again, i guess we r in different times...

Phonetic function? Is this for speech recognition??, tell me more about what you are doing...why do you want it on background, how do you call the function, which are the parameters, wich is your program flow...do you get any interaction during execution?...try to avoid all dialogs during execution....etc....

Cheers...

Gabriel

Read only

0 Likes
851

Hi Gabriel,

Let me explain in details about my DLL function.

We are importing the business partners from legacy system into the SAP CRM system, so at the moment we created the BP master data via BAPI, I get the name of the BP and this moment I call the function in the DLL file. I export the parameter name and I receive back a simplified string with the name reduced to a code. This code I get back from the dll it is insert in a Z table, so there is no interaction in the screen, all must be executed in background mode, because there are a lot of business partners to be converted in SAP system.

I am sending my code for your considerations.

  • Instancia a DLL

CREATE OBJECT dll 'MTCODE.CPFONET'.

IF sy-subrc NE 0.

RAISE without_dll.

ENDIF.

  • Move para a tabela interna IT_NAME os valores recebidos na TI_NAME

it_name[] = ti_name[].

  • Para cada registro importado

LOOP AT it_name.

CLEAR v_string_ret.

wa_matchcode-zregid = it_name-zregid.

wa_matchcode-name1_text = it_name-name1_text.

v_string = it_name-name1_text.

CONDENSE v_string.

TRANSLATE v_string TO UPPER CASE.

CALL METHOD OF dll 'SetNome' EXPORTING #1 = v_string.

CALL METHOD OF dll 'ExecMatch'.

CALL METHOD OF DLL 'GetMCData' = v_string_ret.

FREE OBJECT dll.

  • Preenche os campos do match-code de acordo com o retorno da DLL

SPLIT v_string_ret

AT '|'

INTO wa_matchcode-zparmcln

wa_matchcode-zparmcfn

v_empty

wa_matchcode-name_first

wa_matchcode-name_last

wa_matchcode-namemiddle.

  • Adiciona o registro com o match-code correspondente na TE_MATCHCODE

APPEND wa_matchcode TO te_matchcode.

ENDLOOP.