cancel
Showing results for 
Search instead for 
Did you mean: 

Webservice logon language

Former Member
0 Kudos

Hi,

I have a problem with webservice generated from RFC enabled function module. The function module returns data depending on logon language (technically, it's comparation of short texts). Therefore I need to be able to influence the language used when consuming a webservice.

When I look at logon data in SICF, there is EN as a language and it can't be changed (message You cannot use transaction SICF to modify this service). I guess this is because of the generation by SOAMANAGER. But in SOAMANAGER I'm unable to find where to change logon language for the service call. Also, when I tested the webservice with soapUI, I tried to provide sap-language=CS parameter and the WSDL URL, but also without success. When debugging the RFC call, I see the sy-langu field is still EN.

Any help is appreciated.

Regards,

Tomas

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

Solved the issue in a different way. I made the service use user/password authentication. It seems the language is then read from user master record, where I set the default language to CS.

Former Member
0 Kudos

Hi Tomas,

Good to hear you have found a workaround. I just thought I would add some additional food for thought...

There is also a sequence SAP uses for determining the logon language:

[http://help.sap.com/saphelp_nw70ehp2/helpdata/EN/85/81033c42663b34e10000000a11402f/content.htm]

I didn't reply to this post originally because I thought the original requirement was to dynamically determine the logon language (on the client side) based on a specific user's requirements (and there could be different language requirements).

Your approach would work quite nicely but if you have additional language requirements then you would need to start creating additional users accordingly. I remember doing something similar in Java (as opposed to PHP) where I dynamically set the language requirement in the HTTP header requests from the client side but I couldn't remember exactly how I achieved it so I couldn't provide any solid advice to you

Regards, Trevor

Former Member
0 Kudos

Hi Trevor,

thank you for the information, it's good to know how things work. Now I'm able to supply the logon language using sap-language parameter in HTTP header (tested in soapUI), cool! I guess this is the correct aproach for my requirement.

Thanks again, that was really useful.

Regards,

Tomas

jschoetteler
Participant
0 Kudos

Language is derived from user-default-language.

However - this can be overruled by using HTTP header field "Accept-Language" - which is pretty good explained in following blog:

https://blogs.sap.com/2013/05/20/multi-language-support-in-abap-web-services/

(Just found this blog - and it's much more flexible than the user-default-language)

Answers (2)

Answers (2)

taryckbensaili
Participant
0 Kudos

Hi,

You can use ABAP Instruction : SET LANGUAGE to define the language.

See SAP Documentation : ABAP Keyword Documentation

Former Member
0 Kudos

Hi,

By prefixing "?sap-language=DE" in url you can manipulate language (in this case German) used by webservice. In comsumer proxy you cal try to alter RFC destination which is used by Logical Port to use language of your choice.

Sy-Langu field is EN because you are logged with language EN.

Regards,

Gourav

Former Member
0 Kudos

Hi Gourav,

could you please provide me more details to your solution? How to change the RFC destination or logical port in consumer proxy? I'm not aware of calling any consumer proxy, I plan to use the webservice in PHP application.

Thanks in advance.

Regards,

Tomas

Former Member
0 Kudos

Hi,

I plan to use the webservice in PHP application

Oh sorry! ignore my previous post "all consumer proxy, RFC thing", just tryout adding sap-lanugage= parameter in wsdl while you are trying to consume service in PHP (try first with sap-lanugage=DE, and then replace DE with your language)

Also check if that particular language exist in SAP.

Regards,

Gourav

Former Member
0 Kudos

Hi,

as I wrote in my initial post, I already tried to use the sap-language parameter with correct language that is present in the system (I tried CS and DE as well, both do exist in the system). But it doesn't work, when I try external debugging, the language is always set to EN regardless what I pass to WSDL URL in sap-language parameter.

Regards,

Tomas