I'm trying to convert a SAPscript into a Smart Form. The problem I'm having relates to the multiple-language capability of the SAPscript.
It starts with an INCLUDE of a standard text containing DEFINE statements.
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.
Dig Deeper on SAPscript and Smart Forms
Related Q&A from Mark Smithson
An SAP user is working with an SAPscript form to create the form development for an Invoice List, and wants to know if it's possible to migrate the ... Continue Reading
An SAP user is looking to fix an error with a packing slip print-out in an SAP Smart Form. Continue Reading
An SAP user is trying to align a barcode in the center of a defined window on an SAP Smart Form. Continue Reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.