The copyright window is the information, which is popping up when You are changing the language of your sessions. In this article I’m going to show You the simple trick of how to avoid this copyright window in SAP.
Probably You will see this message only once, during the first logging in to SAP.
But if You change the language next time to another, You will see the window showed below.
And this is that copywright window.
When I started to work in SAP I often changed the language from english to polish. I thought it will help me to better understand new system. So when I was using SAP manually I was forgetting about macros and changing the language.
Often it was just disrupting launched macros, because I did not know how to handle this. I didn’t know how to deal with the window, which appears sometimes, not always.
What to do in such situation?
First of all, You need to simulate the situation, in which that windows pops up and record it using SAP Script Recording.
In our case, the line responsible for clicking that green confirmation button to close the copyright window looks like showed below.
session.findById("wnd[1]/tbar[0]/btn[0]").press
Having that we can go to the possible solutions.
Solutions
To solve this issue I prepared for You 2 solutions – easy and little bit complex. Let’s start with the second one.
Check if wnd[1] exists
In this solution You need to create an object (somewhere the copyright window appears) and set there the wnd[1]. It stands for the any additional, popping out window. In our case it will look for the copyright window. If it popped up the wnd[1] is not nothing and the “clicking line” is proceeding.
On Error Resume Next
Dim wnd1 As Object
Set wnd1 = session.findById("wnd[1]")
On Error GoTo 0
If Not (wnd1 Is Nothing) Then
session.findById("wnd[1]/tbar[0]/btn[0]").press
End If
Simple error handling
In the easier solution You just need to do nothing but put the “clicking line” into error handling brackets. That’s all.
In case of no copyright window macro will go on skipping this line.
On Error Resume Next
session.findById("wnd[1]/tbar[0]/btn[0]").press 'language version
On Error GoTo 0
To sum up
Now You should know how to manage with copyright window in SAP macros. Choose the method that fits You more.
You can also use those solutions to deal with any pop up window, which appears once in a while. Just need to know, where they can occur and trap them down.
Hi,
I have the same issue but with another popup which appear during the logging into SAP.
The message in the popup is “You have unread documents in your inbox”.
In order to close this window I need to click the green confirmation button.
I tried to use the code lines you suggested here, but it doesn’t work.
Can you please help?
Hagai
I already answered by email, but will also paste it here:
Have You tried to record this additional window with script recorder?
Btw, usually that green sign button is the same object as in other ‘additional’ SAP windows, so if You cannot record this one, try to record another additional window and take that line from the recording.