cancel
Showing results for 
Search instead for 
Did you mean: 

Hide userLanguage in datalist with languagecode column

ixdse
Explorer

Hi community,

In the Workcenter ServiceProduct (Cost and Revenue - Services) in the OIF Screen you can select the Tab "Other Languages" (General) and there you can create different langueges for the Description field in ServiceProduct. The special thing is that you can choose all languages except the language you log in with.

We want to do the same thing in our Custom Business Object.

We want long texts in different Languages. So we created a [DependentObject(TextCollection)] node TextCollection that contains all the languages as Detailed Descriptions (10006).

so we bind this TextCollection in the UI Designer of the OIF in a created "Other languages" tab sceen to a Datalist and display it in an advancedlistpane with language code and a text as columns. Now we have the problem that the logon language is still choosable in the Dropdown in the languagecode column.

How can we filter the Logon language from the list without to delete it in the textcollection?

Here are the Examples:

In the ServiceProduct OIF with logon language englisch. No english in the list:

Here our custom BO OIF with the list and with english in the list (bad):

If you need further information do not hesitate to ask. And thank you for your help.

dse

Accepted Solutions (0)

Answers (1)

Answers (1)

HarshalVakil
Active Contributor
0 Kudos

Hello David

I am not sure, but I can suggest a use of system variable sy-Langu.

when you generate the list that you would like to display (List of Languages), exclude or hide the logon Language. This you can do by Using the system variable SY-LANGU. This system variable is commonly used in SAP products (Specially SAP ERP , Netviewer etc.). However from my previous experiences, I know that this works also for Bydesign. (I used this while Configuring the external Catalogs, however I used directly in the Business configuration activity in Bydesign and i was able to show the catalog based on the user log on Language, So system recognized the variable name and content, which is a good sign).

I am not sure if this works with the cloud Application studio as well but this would be worth a try. if it works then only thing left to do is to hide or exclude the Language from the list or raise error /warning based on the requirement.

let me know if this works.

Regards,

Harshal

ixdse
Explorer
0 Kudos

Hello Harshal,

Thank you for your fast reply.

Maybe I am wrong but I think there is no SY-LANGU in Cloud Application Studio with a byd Solution. In my understanding byd does not use the ABAP language.

It is not a problem to get the user language and save it to an element in the BO. You can archive this by simply doing this:

var userLanguageCode = Context.GetCurrentUserLanguage().ToString();
this.LanguageCode = LanguageCode.ParseFromString(userLanguageCode);

So we can use the current logon language. But my question is how can we hide the language in the dropdown on the OIF Screen within the UI Designer? Is there somewhere a configuration where we can exclude some values in a datastructur or something like that?

We managed to remove the entry with the language from the list with a script in an event handler but if you do this on a datalist that is bound to a Textcollection the the entry gets complete lost and the logon language is still in the dropdown.

Kind regards,

David

former_member606838
Participant
0 Kudos

Dear Harshal,

I have a qusetion off-topic. Since you have worked with external catalogs, I am struggling in setting up the HOOK_URL. I set up the catalogs based on the OCI data provided by the supplier. In that case I leave HOOK_URL blank but when I check out. I am still in the supplier catalog(or sometimes I got error from the supplier) and the items aren't moved to the byd cart. I would appreciate if you can help.

Thanks,

Mousa