It
Requires Free Membership to View
When you register, you will start receiving targeted emails from my award-winning team of editorial writers. Our goal is to keep you informed on the hottest topics and biggest challenges faced by SAP professionals today.
Hannah Smalltree, Editorial Directore.g.
INCLUDE ZMEDRUCK_TEXT OBJECT TEXT ID ST LANGUAGE &NAST-SPRAS&
I have standard texts defined in all the languages I need. (advantage was that only 1 layout needed to be maintained)
DEFINE &ST_TO_BE_PRICED& = 'To be priced' in English DEFINE &ST_TO_BE_PRICED& = 'A pr?rquer' in French
Is there a way I can reuse this standard text by for example having a piece of code that would load the correct language and then populate the global variables?
You have come up with an elegant approach for dynamic handling of language-specific output in SAPscript. Unfortunately, as you probably have found already, this particular approach does not work in Smart Forms.
Within a Smart Form, you can set up an 'Include text' node to access standard texts as used in SAPscript. In addition, you can specify dynamically the language to retrieve (via a variable in the language parameter). However, any commands within these standard texts -- such as DEFINE -- are ignored.
Thus, I would recommend simplifying your approach. Based on your example above, since you can no longer assign the words 'To be priced' and 'A prÉmarquer' to variables within standard texts, why not put the words directly into these standard texts (or into text modules) instead and invoke them solely when you wish to produce output? As an alternative -- if you need tighter control over how these words appear or wish to minimize external text retrieval -- insert a language-dependent CASE statement assigning the words to variables within the Smart Form itself (in the Initialization section or a Program node).
Either approach will allow you to rely upon a single Smart Form for your multi-language output. If there are many, many such texts you may wish to reevaluate whether the benefits outweigh the disadvantages of having a single form for multi-language output.
This was first published in January 2004