what determines the WorkItemLanguage attribute?

Florin Wach florin.wach at gmx.net
Mon Nov 14 08:10:17 EST 2011


Hallo Paul,


How and when the worflow's language is determined:

It depends on how the workflow instance is going to be created, wether by an event trigger (using the standard routines/functions such as

A) SAP_WAPI_CREATE_EVENT, SWE_EVENT_CREATE, cl_swf_event, ...

  or by a direct instantiation, such as

B) SAP_WAPI_START_WORKFLOW, ...


The overall rule is, that the workflow language is taken from the current logon language, whoever is initiating the business process. This means for the creation via an event, the language on event creation is leading, and on a direct instantiation, the current user's language is used. In both cases it can be broken down to the system field SY-LANGU.

For A) - Class CL_SWF_EVT_EVENT.Constructor()

This class is the basis for all workflow event creations and is memorizing the future workflow's language in object field me->m_standard_elements already within the constructor, which is later on picked up by the method .raise() that is actually creating and processing the event.

For B) - Function module SWW_WI_CREATE_VIA_EVENT_IBF()

Is reading from the standard workflow container element _EVT_LANGUAGE. If that is not found, sy-langu is used. Please refer to function module SWW_WI_CREATE_VIA_EVENT_INTERN.


Usually the sy-langu field is not modified within a program that raises an event. However, this can happen with the ABAP statement  SET LANGUAGE  which again could be used during the output management of Forms to use text elements in a different target language (e.g. the one of the Customer and not the one of the user, who's creating a sales order). Also the Extended Notification's class that creates the body text of the eMail is switching the system language to the Workflow's language to deliver the text always in that leading language.


Conclusion

So it can be said that logon language setting in the Logical RFC-Destination WORKFLOW_LOCAL_XXX, where the WF-Batch is usually logging in to consume workflow events and creates instances has no real consequences, unless the field _EVT_LANGUAGE was intentionally deleted or set to SPACE, where the RFC logon language would be a matter. In this case, only EN or DE is usually possible for RFC connections.

Secondly all the jobs or reports that create events are using the language, which is defined in the Job's step. This is usually the logon language of the administrator who was initially planning the first job (or who was executing the generic basic customizing for workflow). In this case, the system's default logon language doesn't play a direct role here, but it was used to set the default for all the jobs.
So Jocelyn is probably quite right here, in pointing out that this is probably running under FR.

However, the deadline notifications which are created by the RSWWDHEX job and create some of the SAP Office Mails, use the Workflow language to set the target eMail language of the body.


What can be done to change the behaviour on the Workflow default language?

As Jocely said, the workitem display can be switched to the logon language of the user, who's accessing them in the inbox. This will have some drawbacks in performance.

One can also think of switching the workflow language, the container element _EVT_LANGUAGE within a (new) check function module, where you could overwrite FR with EN.

You could also enhance the constructor of the swv_event class to set a different default language here.

The more complicated way is to redetermine the target language for process steps such as deadline notifications or workflow general notifications to use the recipient's standard logon language instead of the workflow's language.

It is not "really" possible to change the Workflow's leading language, once it was created, as all depending workitems use the propagated language attribute and a change (e.g. when talking about a simple container operation changing that standard field) is not simply written back to the workflow's administrative data.


With the very best wishes,
   Florin













-------- Original-Nachricht --------
> Datum: Fri, 11 Nov 2011 03:05:16 +0100
> Von: "Dart, Jocelyn" <jocelyn.dart at sap.com>
> An: "SAP Workflow Users\' Group" <sap-wug at mit.edu>
> Betreff: RE: what determines the WorkItemLanguage attribute?

> Hi Paul, 
> I'm sure Florin is the best person to guide you on this one... 
> But BTW suggest you check the SAP Notes on this one as well as I've
> noticed a number about work item language in passing. 
> 
> There is a workflow inbox setting in SBWP (personal workflow settings) to
> "Display work items in logon language"  - there are some performance issues
> to be aware of around this though so make sure you read the relevant SAP
> help. 
> 
> If it's being raised as part of deadlines - you might want to check the
> user id that created/executes the deadline batch job SWWDHEX as well. Just a
> thought. 
> Rgds,
> Jocelyn 
> 
> 
> 
> 
> -----Original Message-----
> From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf
> Of Paul.Bakker at osr.treasury.qld.gov.au
> Sent: Friday, 11 November 2011 8:50 AM
> To: SAP Workflow Users' Group
> Subject: Re: what determines the WorkItemLanguage attribute?
> 
> 
> Thanks for that Florin.. I suppose the next question is: where does the
> triggering event get the 'FR' language from?
> 
> In this case, the event is raised by WF-BATCH, after a deadline has passed
> in a workflow. I checked WF-BATCH in SUO1D, and it has no default
> language.
> So I'm guessing it is using some underlying, system-wide default language?
> The actual SAP instance is in France, so this is quite possible.
> 
> Is this a common problem, in multilingual systems...?.
> 
> ta
> Paul B
> 
> 
> 
> From:	"Florin Wach" <florin.wach at gmx.net>
> To:	"SAP Workflow Users' Group" <sap-wug at mit.edu>
> Date:	09/11/2011 05:02 PM
> Subject:	Re: what determines the WorkItemLanguage attribute?
> Sent by:	sap-wug-bounces at mit.edu
> 
> 
> 
> Hi Paul,
> 
> yes, it comes from the event, and the reports for email notifications are
> using this toplevel language id to determine the target language for the
> eMail.
> When using the extended notifications, you can enhance the logic within
> the
> ABAP classes to send eMails in the language of the recipient, not the
> workflow.
> 
> Florin
> 
> 
> 
> -------- Original-Nachricht --------
> > Datum: Tue, 8 Nov 2011 15:37:12 +1000
> > Von: Paul.Bakker at osr.treasury.qld.gov.au
> > An: SAP-WUG at mit.edu
> > Betreff: what determines the WorkItemLanguage attribute?
> 
> >
> > Wuggers,
> >
> > I am working on a multi-language system.
> > Sometimes, users who log on in English are getting workitems (and
> related
> > emails) in French.
> >
> > I checked one, and this workflow instance's 'WorkItemLanguage' attribute
> > is
> > set to 'FR'.
> > The event that triggered the workflow instance was created by WF-BATCH,
> > who
> > has no default language set.
> > There are hundreds of instances of this workflow (triggered by various
> > users), but only a few with the language 'FR'.
> >
> > My question:
> >   Does anyone know what determines the 'WorkItemLanguage' attribute of 
> a
> > top-level workflow instance? Is it passed from the triggering event?
> >
> > thanks pour votre help
> > Paul B
> >
> >
> >
> *********************************************************************************************
> 
> > Only an individual or entity who is intended to be a recipient of this
> > e-mail may access or use the information contained in this e-mail or any
> of
> > its attachments.  Opinions contained in this e-mail or any of its
> attachments
> > do not necessarily reflect the opinions of Queensland Treasury.
> >
> > The contents of this e-mail and any attachments are confidential and may
> > be legally privileged and the subject of copyright.  If you have
> received
> > this e-mail in error, please notify Queensland Treasury immediately and
> erase
> > all copies of the e-mail and the attachments.  Queensland Treasury uses
> > virus scanning software.  However, it is not liable for viruses present
> in
> > this e-mail or in any attachment.
> >
> ***************************************************************************************************
> 
> >
> > _______________________________________________
> > SAP-WUG mailing list
> > SAP-WUG at mit.edu
> > http://mailman.mit.edu/mailman/listinfo/sap-wug
> _______________________________________________
> SAP-WUG mailing list
> SAP-WUG at mit.edu
> http://mailman.mit.edu/mailman/listinfo/sap-wug
> 
> 
> _______________________________________________
> SAP-WUG mailing list
> SAP-WUG at mit.edu
> http://mailman.mit.edu/mailman/listinfo/sap-wug
> 
> _______________________________________________
> SAP-WUG mailing list
> SAP-WUG at mit.edu
> http://mailman.mit.edu/mailman/listinfo/sap-wug



More information about the SAP-WUG mailing list