on 09-18-2012 2:58 PM
Is there a best practice position for how SMARTforms should be designed to cater for global implementations – in particular how Latin (e.g. English) and non-Latin (e.g. Simplified Chinese) characters can be printed by the same SMARTform?
More specifically, is it possible to dynamically change the font being used for a SMARTform?
I saw the post http://scn.sap.com/thread/545537 (from 2007) which seemed to be quite similar, but posting the question again to see any progress has been made since 2007.
We have a global template invoice (using SMARTforms), and we need the ability to be able to print different fonts based on the output language (e.g. NAST-SPRAS).
We have created text modules to allow the literal texts to be translated (works well), but the problem is that when we have to print text elements (which contains value from some customizing table and can have Chinese characters depending on language). There we don't find any option for changing the font dynamically.
The reason for this is that it is only possible to pass a fixed font to the text element.
Scenario 1 – font HELVE is assigned to the Text Element
Scenario 2 – font CNSONG is assigned to the Text Element
So to repeat the question above, is it possible to dynamically specify the font at run-time of a SMARTform based on the language the form is being printed in (e.g. use CNSONG if language = ZH, use JP… if language = JA etc. etc.)
As an (bad) work around, we could have separate (text element) nodes in the SMARTform – one for English (i.e. Latin) and others for Simplified Chinese etc. but this does not seem to be a very intelligent design.
Many thanks in advance for any help.
Alistair Crawshaw
Hi Phil,
If you use the cascading fonts unicode windows device type SWINCF(see SAP note 812821) to process your Smart Form, the font used in the Smart Form is not relevant anymore. A suitable windows font will be chosen based on the unicode code point of the character. So if you print via SWINCF, then you will get a correct print for both scenarios above or for any mixture of languages. The SAP font is not so important when you print via SWINCF.
Regards,
Aidan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Alistair,
Regarding your concern, Yes we can dynamically change the font in Smartform based on the language.
Let us take your requirement, To complete this please follow the below steps:
1st you need to create two SmartStyles, one for font HELVE and other for font CNSONG.
ZSS_STYLE1 - set default font HELVE
ZSS_STYLE2 - set default font as CNSONG
Both the Smartstyle must contain the all the paragraph & character format which all are used by Smartform.
Next In Smartform driver program you need to write code to get program name of Smartform.
for that by using FM "SSF_FUNCTION_MODULE_NAME" to get FM name of your created Smartform into the variable w_form_fmname. Now use following code to get program name:
CONSTANTS: c_sapl(4) TYPE c VALUE 'SAPL'.
DATA: w_sf_progname TYPE string,
w_form_fmname TYPE rs38l_fnam.
CLEAR w_sf_prog_name.
IF e_form_function IS NOT INITIAL.
CONCATENATE w_form_fmname+0(8) c_sapl w_form_fmname+8
INTO w_sf_progname.
CONDENSE w_sf_progname NO-GAPS.
ENDIF.
Now the variable "w_sf_prog_name" contains the Smartform program name this you need to pass under Exporting parameter while calling Smartform function module.
Now get this program name inside Smartform into a variable. Afer this access the structure %HEADER with the help of program name and Assign/Move new Smartstyle in the field %header-stdstyle value based on the languages.
IF ie_langu eq 'E'. "English
MOVE 'ZSS_STYLE1' TO %header-stdstyle. "HELVE
ELSE. " for other languages
MOVE 'ZSS_STYLE2' TO %header-stdstyle. "CNSONG
ENDIF.
**The field %header-stdstyle is containing the default smartstyle name which we set to Form Attributes->Output Options->Style field.
Hope it also works for you , let me know if you have any doubt related to above solution.
Thanks & Regards,
Piyush Payasi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.