cancel
Showing results for 
Search instead for 
Did you mean: 

Add New Registry Entries and SAP Logon Ignores It

stefan_schnell
Active Contributor
0 Kudos

Hello community,

over three years ago I asked the same question here. My problem is that I add some entries in the Windows registry at the runtime of an ABAP report and the report ignores the new entries until the SAP logon restarts. Now in a 64-bit Windows environment I have the same problem again. I hope that I can alleviate this with a script which I presented here, but I am searching for another solution.

Thanks for hints and tips.

Cheers

Stefan

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Hi,

have you tried to register the dll from RUNDLL32.EXE present in "C:\Windows\SysWOW64" folder, instead of the default system32 folder?

stefan_schnell
Active Contributor
0 Kudos

Helle Daniele,

thanks for your reply and your hint.

Yes, I had tried the RunDLL32.exe from SysWOW64 directory, I called the program direct with the path. Unfortunately it makes no difference. As far as I know it is not possible to call a 64-bit process from a 32-bit process. So if we call cl_gui_frontend_services=>execute it is always a 32-bit process, because SAP GUI for Windows is also a 32-bit process.

Thanks again and cheers

Stefan

0 Kudos

Try with a vbs script.

First, make the script locally on your pc and execute it(without abap, just clicking on it) to be sure it's working. Then upload it on server side and, from abap, download it on each application server you need, then execute.

Be sure to execute the script as administrator, there are many example about how to do it.

stefan_schnell
Active Contributor
0 Kudos

Hello Daniele,

thanks for your reply and your interesting suggestion for a test case.

I create two programs, one in ABAP and the second in VBScript.

"-Begin-----------------------------------------------------------

  Report zCOMIPC.

    "-Includes----------------------------------------------------

      Include OLE2INCL.

    "-Variables---------------------------------------------------

      Data oIPC Type Ole2_Object.

    "-Main--------------------------------------------------------

      Create Object oIPC 'COMIPC'.

      If sy-subrc = 0 And oIPC-HANDLE > 0.

        Write: / 'Object created successfully'.

        Free Object oIPC.

      Else.

        Write: / 'Can''t create object'.

      EndIf.

      Break-Point.

      Create Object oIPC 'COMIPC'.

      If sy-subrc = 0 And oIPC-HANDLE > 0.

        Write: / 'Object created successfully'.

        Free Object oIPC.

      Else.

        Write: / 'Can''t create object'.

      EndIf.

"-End-------------------------------------------------------------

'-Begin-----------------------------------------------------------

  '-Main----------------------------------------------------------

    On Error Resume Next

    Set oIPC = CreateObject("COMIPC")

    If IsObject(oIPC) Then

      MsgBox "Object created successfully"

      Set oIPC = Nothing

    Else

      MsgBox "Can't create object"

    End If

    MsgBox "Register the library now..."

    Set oIPC = CreateObject("COMIPC")

    If IsObject(oIPC) Then

      MsgBox "Object created successfully"

      Set oIPC = Nothing

    Else

      MsgBox "Can't create object"

    End If

'-End-------------------------------------------------------------

Both programs are functional equal.

My proceeding:

  1. I start the ABAP report.
  2. I start the VBScript program.
  3. Both stop and are parallel standby.
  4. I register the library.
  5. I continue the ABAP report.
  6. I continue the VBScript program.

As you can see in the result, after step 6 of my proceeding, the VBScript creates an object and the ABAP report doesn't.

Thanks again and cheers

Stefan

0 Kudos

If you can, try to attach the dll.

I will try something with it.

stefan_schnell
Active Contributor
0 Kudos

Hello Daniele,

thanks for your reply.

I tried the same way with a COM library from another source - in this case scrdbg.dll from Microsoft. But the behaviour is exactly the same.

You can download the library temporary from here.

Let me know the results of your tries.

Thanks again and cheers

Stefan

0 Kudos

Hi Stefan,

I tried to play with the dll, but even if i register manually the DLL, I can't load it with VBS.

With other dll I've no issues.

Can it be a problem inside the DLL?

stefan_schnell
Active Contributor
0 Kudos

Hello Daniele,

I register the library via regsvr32 and rundll32 and all works well. How do you register the library manually?

Here the library in the context of VBA:

Thanks and cheers

Stefan

0 Kudos

I tried both with Regsvr32 and rundll32. But VBS can't initializate it.

stefan_schnell
Active Contributor
0 Kudos

Hello Daniele,

thanks for your reply.

Please call your program like this and post your results.

%windir%\SysWoW64\wscript.exe C:\MyPath\YourProgram.vbs

This ensures that you use 32-bit WSH.

Cheers

Stefan

0 Kudos

Hi Stefan, I tried your cmd line and works well.

But i'm not able to solve your issue.. I tried several times but the ABAP flow can't load the DLL.

I believe you must find other solution, like 2 reports instead of 1.

For example.. the first report register the DLL, then launch the second.

I haven't much time to try different solutions..

stefan_schnell
Active Contributor
0 Kudos

Hello Daniele,

thanks for your reply and the confirmation of the behaviour. Now we know definitely that is no problem of the library. This is valuable information.

It is a challenge to think about a restart of the SAP Logon from an ABAP program.

Cheers

Stefan

0 Kudos

I'm not talking about restart SAP Logon. It's enough to restart the report to load the dll fine.


So, you can execute the first report that register the DLL, then with the istruction "SUBMIT"(inside the first rep.), you can run the second report that load the dll and make needed operation.