on 06-29-2008 6:07 PM
Hello,
I'm using the BEx Analyzer on BI 7.
The user can select the language when connecting. But then how can I get the selected language in VBA, in order to do some VLOOKUP in my excel sheets, regarding the user language ?
Thanks a lot,
Remi
Any idea ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ivan,
I didn't find a solution to pick up the language directly from a SAP variable...
So I used an old taltic : I pick up the language through the windows registry
Here is my VBA code to do it :
Public Function Get_User_Language() As String
Dim oShell As Object
Dim strDefaultSysID As String
On Error GoTo ErrorHandler
Set oShell = CreateObject("Wscript.Shell")
strDefaultSysID = oShell.RegRead("HKCUSoftwareSAPSAPLogonDefaultSystemID")
If strDefaultSysID = "" Then GoTo ErrorHandler
Get_User_Language = oShell.RegRead("HKCUSoftwareSAPSAPLogonSystems" & strDefaultSysID & "Language")
EndFunction:
Set oShell = Nothing
Exit Function
ErrorHandler:
MsgBox "Error when getting the user language. Be sure to have selected a default system. English selected.", vbInformation
Get_User_Language = "EN"
GoTo EndFunction
End Function
Warning :
This code works only if you've ticked the option "Use selected System as Default" in the SAP logon dialogbox.
Have a good day,
Rémi
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.