Skip to Content
Event Information
Author's profile photo Jim Spath

Answer-Thon 2021: A Question For Today July 13th

After the launch of the 2021 Answerthon Challenge, I thought I’d share a question I found, along with the way I’d approach the answer. If I only knew.

How do I ensure that the session language is being used in unit tests of HANA calculation views?

Most people familiar with “classic” SAP GUI logon would be aware of a language setting that triggers later messages and title text to be in that language, as long as the system is new enough to include that capability (before Unicode, things were, well, complex). If you are bilingual, or multilingual, there might be a reason for you to switch; perhaps you’re working for a company based in North America that has staff that speak Spanish, or Portuguese.

As a developer, though, things are different. You may need to connect with the language you best understand in order to build out code and configurations. But you might need to enable multiple language texts for users. If your chiefs say “everyone uses English [insert any ISO here]” you’re off the hook. But check this out anyway, in case your future is different than your now.

Let’s say you have a team that populates message texts, and the developers’ job ends at verifying that at least one or two locales work. Simple, relatively. But maybe your testing and verification rules say every locale must be tested in a least some percentage of the delivered scenarios (screens, reports, visualizations, etc.). If the translation team is capable of also running quality checks, great. If they have no authority to access some areas, there’s a problem.

An enterprise scale production quality control process will have automated testing, perhaps several types, the more complex the landscape the more sophisticated the test harnesses. My experience was mainly with a scheduling package that could run batch jobs in SAP R/3 system(s). I managed to set up HANA system testing with the same scheduler, so my comments here are generalized to scriptable tests (typically kicking off ABAP jobs but any of the movable feast of APIs could and were leveraged, not to mention the (4GL) language of the day <cough, Perl>.

In the setup of an automated test user we assigned a classic Client ID, the typical account/password pair, and the logon language. While US-based Americas operations used English-only for batch work, European based teams required others. It was a limited set, e.g., there probably weren’t any Lithuanian-specific test scripts. There might be a delimited list of allowed languages that correspond to what varieties the software delivery teams “own.”

For other interfaces, whether JSON, GET, whatever, there may or may not be an equivalent logon language variable.

To figure out a good answer to today’s question, I tried this search:

https://community.sap.com/search/?ct=all&q=user%20session%20language%20in%20HANA

Got 788 results, most off-topic from my intent.

This one is interesting, as far as provisioning connection protocols:

SAP Analytics Cloud Live Data Connection to SAP BW

This is it (just shows my search found the OP):

https://answers.sap.com/questions/165046/how-do-i-ensure-that-the-session-language-is-being.html

A question tag is: “unit tests”

So, what other tags could help find an answer?

A similar question, back from 2014:

Change user session language in hana studio

( @Lars, ahem, said “this question had been answered already several times”; back then, but that topic is for interactive, not automated test scenarios. )

One I found, distantly related

Change Original Language of Package

It’s sort of twins to:

SAP HANA change sub-package language grey-out

 

The question is from 2017, and had only 250 views recorded when I began to look at it. There will be more as some of you take a look, please, and perhaps one more astute than I in the area of ” .xsodata services” can pitch in.

More questions of the day?

 

Assigned Tags

      3 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Julia Russo
      Julia Russo

      Thanks, Jim for the example on the process of how to find and answer questions. 🤗
      For anyone interested in the Answer-Thon game rules, please check out this blog post:
      https://blogs.sap.com/2021/07/20/answer-thon-rules/

       

      Author's profile photo Lars Breddemann
      Lars Breddemann

      Hi Jim,

      this feels a bit like some already forgotten answer is back to bite me...

      But reading through the original question, I would, still, go with my answer from back then.

      The logon language information is part of the DB users' login information.

      To check calculation views and the effect of different login languages, a new connection to the DB with different login languages is required.
      Personally, I would set up a different DB user for each language to be tested.

      Depending on your test driver, this may or may not be very simple to do.

      My experience is mostly with JMeter, where it is very easy to use a different DB connection to run tests multiple times.

      From the original question, I get the impression that the OP may have been using the XSC built-in unit test libraries (XSUnit/ Jasmine) - and for that, I do not know how to run tests in multiple languages.

      Not sure if this helps. But here we are.

       

      Cheers,

      Lars

      Author's profile photo Jim Spath
      Jim Spath
      Blog Post Author

      Appreciated, Lars. I was not trying to throw you under the proverbial bus, more so pushing the answer-thon contest with pseudo-answers. Your take fits my view, unsurprisingly.