cancel
Showing results for 
Search instead for 
Did you mean: 

How to include Standard text in text element based upon the diff languag

Former Member
0 Kudos

Hello,

I need to display this Script in different languages...for that I need to create Standard text in different languages and then I have write the logic to select the Standard text in a text element depending upon the Langauge.

My Idea is like this.

************************************

Date : &sy-datum&

If tbl_ord-spras = 'EN'

Include 'Z_DATE_EN' object text id st language &tbl_ord-spars*

&TBL_ORD-LDATE&

Elseif tbl_ord-spras = 'japneese '

Include 'Z_DATE_JP' object text id st language &tbl_ord-spars*

&TBL_ORD-LDATE&

Elseif tbl_ord-spras = 'KOREA'

Include 'Z_DATE_KA' object text id st language &tbl_ord-spars*

&TBL_ORD-LDATE&

ELseif tbl_ord-spras = 'Chineese'

Include ''Z_DATE_CH' object text id st language &tbl_ord-spars*

&TBL_ORD-LDATE&

Can anyone gude me how i can impliment this logic in the Script text element.

Will this logic work as regardless of the language I had declared &Date = sy-datum& ?

Do I need to change anything here...?

Please suggest ...Any Suggestions will be apprecaited.

Regards,

Kittu

Edited by: Kittu on Jul 24, 2008 12:08 PM

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hello,

Thank you for all your response!

Regards,

Kittu

Former Member
0 Kudos

Hi

You can use the concept of text module.

http://saptechnical.com/Tutorials/AdobeForms/TextModules/page1.htm

with regards

Nikunj shah

Former Member
0 Kudos

Hello Nikun,

Thank you for your response!

It will work for all the languages. Except for the Asian Languages....Because in Chinese and Japneese languages it appears as SYmbol like Below :

日期:

And in the Text module it appears like ?? :

I am stuck here....

Thank you for your time

Regards,

Kittu

Former Member
0 Kudos

INCLUDE TEXTS

To include the contents of another text into the current text, use the INCLUDE control command. SAPscript still treats the text to be included as a separate text. The text is copied over only at the point at which the output is formatted.

Thus the use of the INCLUDE command always ensures that the most current version of a text is included into the output, since the text is not read and inserted until the output is formatted.

Syntax:

/: INCLUDE name OBJECT o ID i LANGUAGE l PARAGRAPH p

NEW-PARAGRAPH np

You must specify the name of the text to be inserted. It can be up to 70 characters long. If the name of the text contains spaces, then you must enclose it in quotes as a literal value. You can, alternatively, specify the name via a symbol. All remaining parameters in the INCLUDE command are optional. If an optional parameter is not specified, then SAPscript uses default values as applicable for the calling environment.

/: INCLUDE MYTEXT

The text MYTEXT is included in the language of the calling text.

/: INCLUDE MYTEXT LANGUAGE 'E' PARAGRAPH 'A1'

The text with the name MYTEXT and the language E is included, regardless of the language of the calling text. The paragraph format A1 will be used as the standard paragraph type for this call.

Optional parameters:

u2022 LANGUAGE

If this parameter is not specified, then the language of the calling text or the form language are used for the text to be included. If the language is specified, then the text will be fetched in this language, regardless of the language of the calling text.

u2022 PARAGRAPH

The text to be included is formatted using the style allocated. The PARAGRAPH parameter can be used to redefine the standard paragraph for this style for the current call. All *-paragraphs in the included text will then be formatted using the paragraph specified here.

u2022 NEW-PARAGRAPH

The first line of the text to be included will be given this format indicator, as long as it is not a comment or command line. If the optional PARAGRAPH parameter (see above) is not specified, then all *-paragraphs of the included text will also be formatted using the paragraph specified in the NEW-PARAGRAPH command.

u2022 OBJECT

In order to completely specify a text, information about the text object is also required. There are a number of restrictions and other rules that depend on the object type of the calling text:

o Any kind of text can be included in a form. If no object is specified, then TEXT will be used (standard texts).

o In the case of a document text (DOKU object), you can include only document texts. This object type is also assumed if no object is specified in this environment.

o Only hypertexts and document texts can be included in a hypertext (DSYS object). If the OBJECT parameter is missing, then DSYS is used as the default value.

o In the other kinds of text you can include only standard texts (TEXT object), document texts or hypertexts. If there is no specification, then the default object is TEXT.

u2022 ID

The text ID is a part of the text key, which permits further text objects within a given object. If no ID is specified, then the default include ID is used from the TTXID table for the calling text. If there is no entry in this table, then the text ID of the calling text is used.

The following consistency check is applied both to the ID and the object:

u2022 All text IDs are allowed in a form.

u2022 In document texts, only document texts may be included that have text IDs TX (general texts) or UO (authorization objects) and also other document texts with the same text ID as the calling document text.

u2022 In DSYS texts, all DSYS texts can be included, whatever ID they have. Document texts to be included must have one of the IDs TX or UO.

u2022 Into the other texts, standard texts with any allowable text ID, DSYS texts with all IDs, and document texts with the IDs TX and UO can be included.

The INCLUDE command returns a status code in the SAPSCRIPT-SUBRC symbol:

u2022 0: the text include was successful.

u2022 1: the command could not be executed because it contained syntax errors.

u2022 2: the rules governing the text to be included were not followed (see above).

This value cannot occur if the command is used in a SAPscript form.

u2022 4: the specified text could not be found.

Once you define the standard text in SO10 you can include text by the above process or use the function module read_text:

CALL FUNCTION 'READ_TEXT'

EXPORTING

CLIENT = SY-MANDT

id =

language =

name =

object =

ARCHIVE_HANDLE = 0

LOCAL_CAT = ' '

IMPORTING

HEADER =

tables

lines = i_tab

EXCEPTIONS

ID = 1

LANGUAGE = 2

NAME = 3

NOT_FOUND = 4

OBJECT = 5

REFERENCE_CHECK = 6

WRONG_ACCESS_TO_ARCHIVE = 7

OTHERS = 8

So you want to know how get the parametrs right. This is how"

In SO10 goto goto menu -> header

here u will find all the required parametrs.

The text lines will be returned in the i_tab.

U can loop at this itab and display the data.

Former Member
0 Kudos

Hi,

you have correct idea, but u don't need to add any logic in program just include the text in sapscript and also pass the language it will display automatically .. make sure that printer on which u r displaying also has that language format e.g chinese and all..if for different languages different logics are present create sap scripts with different languages.

regs,

saurabh

Former Member
0 Kudos

hey kittu

I think what you are doing is right, there should not be any problem with it

The doubt i have is why dont you just change the language like the below based on your language

INCLUDE &T024E-TXGRU& OBJECT TEXT ID ADRS LANGUAGE &EKKO-SPRAS&

based on the language i think it would be displayed automatically.

anyways all the best

regards,

RK