Skip to Content

Dynamic style selection in smartform depending on language

Hi

Today I assign a style to a smartform statically in form attributes. I don't assign styles to any subnodes.

Is it possible to make the assignment of style to the smartform dynamically at runtime?

(If you can suggest a completely other solution for my problem, that will also be very much appreciated).

Reason: I have a requirement to translate a lot of smartform (maybe 100+) from English to Chinese, Japanese, Korean, Russian etc.

I'm in a Unicode environment and the translation itself seems to work quit simple.

But there seems to be a major problem about the font.

In our smartforms we use smartstyles with 2 fonts helve and times.

So far we have just translated a few smartforms to Chinese with SE63. We have also translated some material texts and addresses and we have defined a test printer with CNSAPWIN.

Test prints now shows that we can print all the Chinese texts, but all the texts and numbers that is not translated into Chinese (i.e. quantity, price, net value etc.) is printed with a bigger font size.

Now this is a know problem discussed in more forum threads and OSS nodes, and the solution seems to be, to change the style to use special Chinese fonts and adjust the font size.

We have tested this at it seems to solve the problem. But all the threads and notes discussing this issue is talking about "the English smartform" and u201Cthe Chinese smartform" and so on. This is not very smart.

If we follow this strategy and creates a form for each special language (special from our perspective), we will need 5 different versions of every smartform and the time needed for future maintenance will increase dramatically.

A much better solution would be to have one smartform that is translated with SE63 and only make 5 different styles to handle the different fonts etc. This solution requires however that we can assign the styles to the smartforms dynamically at runtime.

Yours sincerely / Med venlig hilsen / 此致敬礼 / Mit freundlichen Grüßen / Pozdrawiam

Thomas Madsen Nielsen

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Jun 13, 2008 at 07:37 AM

    Hi!

    In SAPScript there is an option for this, using the STYLE keyword. However I don't know will it work in Smartforms or not.

    If it is not working, I think you have to different character and paragraph formats within 1 smartstyle for each language.

    About the STYLE keyword:

    Changing the Style: STYLE Locate the document in its SAP Library structure

    The STYLE control command allows you to change the style within a text. The new style is in force until another STYLE command is issued. If you specify * as the name of the style, then the system reverts to the default paragraph of the original style or form.

    Syntax:

    /: STYLE style

    /: STYLE *

    A style set with this command has no effect in a text included with INCLUDE. The system takes the paragraph and character formats from the calling text. To use the style set with STYLE in the INCLUDE text as well, you must add DOMINANT to the command.

    Note

    If the INCLUDE text has a style assigned to it, in both cases, the system always takes the paragraph and character formats from the directly assigned style.

    Regards

    Tamá

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 12, 2011 at 10:09 AM

    This message was moderated.

    Add comment
    10|10000 characters needed characters exceeded