Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

translation in sap script

Former Member
0 Likes
902

In my sap script, i am using a standard text. Now I need to maintain this standard text for 2 languages.

I have created two standard text with name name ZCPQM_INSPECTION_RESULT and maintained differerent values for language EN and FR in SO10.

In script, i have to write it as

INCLUDE ZCPQM_INSPECTION_RESULT OBJECT TEXT ID ST LANGUAGE &lv_langu&.

Now I am not sure wher eto declare the variable lv_langu. Please help

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
825

Hi Niti

Do like this put if condition in script editor and chk the languagae for eg

if languaga eq 'E'.

text1. write incluude syntax here

else .

text2

And check in debugging whether the form is getting the language correctrly or not by activating the debugger..

5 REPLIES 5
Read only

Former Member
0 Likes
825

Hi Niti,

Do this way,

/: INCLUDE TESTTEXT OBJECT TEXT ID ST LANGUAGE &NAST-SPRAS&

this will include a SO10 Standard text "TESTTEXT" in the corresponding lagnuage in your form.

in SAP-Script you can not use statements like call funtion: edit_text, read_text, save_text, commit_text, delete_text.

to do so you need to jump off to an external perform like following:

/: Perform edit_text in program YSD_PERFORM

/: USING &NAST-SPRAS&

/: CHANGING &VARIABLE&

/: ENDPERFORM

Regards

Abhii...

Read only

Former Member
0 Likes
826

Hi Niti

Do like this put if condition in script editor and chk the languagae for eg

if languaga eq 'E'.

text1. write incluude syntax here

else .

text2

And check in debugging whether the form is getting the language correctrly or not by activating the debugger..

Read only

0 Likes
825

Thanks for all your ans . but still I am stuck.

i have writeen the code like below

/: IF SY-LANGU = 'E'

/: INCLUDE ZCPQM_INSPECTION_RESULT OBJECT TEXT ID ST

/: ELSE IF SY-LANGU = 'F'

/: INCLUDE ZCPQM_INSPECTION_RESULT_FR OBJECT TEXT ID ST

pls correct me if i am doing wrong anywhere.

Read only

0 Likes
825

Hi

Chk whether your sy-langu is getting in Script...Otherwise do like this nast-spras eq ;E; else.

something.

Read only

0 Likes
825

do like this I think it will work.if u hav any queries let me knw

/: IF SY-LANGU = 'E'

/: INCLUDE ZCPQM_INSPECTION_RESULT OBJECT TEXT ID ST language E

/: ELSE IF SY-LANGU = 'F'

/: INCLUDE ZCPQM_INSPECTION_RESULT_FR OBJECT TEXT ID ST langauage F