You are on page 1of 49

www.abap-tutorials.

com/2009/07/05/pritty-
report-vs-pritty-printer/

Change ABAP report language at runtime


Ask Question

0
I was under the assumption that each time I use the following statement during the
runtime of an ABAP report, the text-symbols from the respective language would be
used from there on out (if they were translated accordingly):

SET LANGUAGE 'EN'.


However, this language switch only seems to work once, because in my report (where I
want the user to be able to select the output language) I can use any language I want
during the first run. But once I go back to the selection screen and enter a different
language code, the second SET LANGUAGE does not have any effect.
Is there some sort of text-symbols caching involved? Is there a way to prevent that for a
single report or trigger a refresh at runtime?

report translation abap

share improve this question


|

asked Jan 28 '15 at 21:09

Philip Allgaier

2,3071843

add a comment

2 Answers
active oldest votes

0
Probably, it worths to use CL_GUI_TIMER to refresh the screen after you switched
language. You can check it with SAP_TIMER_DEMO program.
share improve this answer |

answered Jan 28 '15 at 22:03

Mike B.

5,055145888

 I am failing to see how a timer is connected to my problem. Can you please elaborate. The timer does
not refresh the screen but simply executes logic after a given interval. – Philip Allgaier Jan 29 '15 at
10:15
 I mean, to execute the report reloading when the event FINISHED will occur. Example of report auto-
refreshing: sapdev.co.uk/reporting/rep_autorefresh.htm – Mike B. Jan 29 '15 at 12:11
add a comment

0
I just found the solution: There is none, since there is none needed.

SAP is not caching the language-dependent text symbols. You can at any point in the
execution change the runtime language via:

SET LANGUAGE 'EN'.


The reason I thought it did not work was, that I was using an HTML control inlined in the
SAP GUI that did not properly refresh and therefore on the second HTML display still
showed the old language texts.

ABAP CookBook | La rgest Directory of ABAP Tutorial s, Tips a nd Tricks

Large st Directory of ABAP T utorials, Tips a nd Trick s

 HOME
 PRIVACY POLICY
 FOR DUMMIES
 TUTORIALS
 TIPS & TRICKS
 SAMPLE CODES
 SAP NEWS
Adding SE63 Translation To A Transport Request
(TR)
You are here:

1. Home
2. ABAP
March 24, 2014ABAP, TutorialsBy ABAPCOOKBOOK EDITOR

Open transaction code ‘SLXT’ and follow the below steps:

1. Enter the ‘Target Language’, (as in our example it is French),


2. Enter the TR Description,
3. Change the transport request to ‘Workbench Request’,
4. Processing Date – the date on which the translation was implemented,
5. In the field Object Processor, enter the username of the person who implements
the translation,
6. In the field ‘Client Options’, please enter the value ‘I’ (Cross-Client Objects),
7. And finally, click on the button execute to create the transport request for the
translation.
http://www.abap-tutorials.com/2013/10/28/sap-smartforms-in-
hindi-language/

Former Member
March 1, 2006 14 minute read

ABAP Utility: SAP to Google : View translated ABAP


documentation online
FollowRSS feedLike

0 Likes 214 Views 6 Comments

This is about a simple ABAP Utility . It will post ABAP object’s documentation to Google, for the
purpose of displaying translated text in your logon language or in English.

You can also use this weblog for extending workbench functionality.

The Problem :

Not sure if you’ve faced this problem but I found that quite a few of the function modules are not
provided with English documentation – however documentation in German does exist for most of
these.

Actually I made the problem afterwards. Frankly speaking, I didn’t write this utility because I wanted
to solve any problem. It was just for the fun !!

[ Now where is the fun part? – keep on reading, it’s in The End 🙂 ]

Benefits :

You can write a weblog on SDN about it.

1. It will extend the functionality of the ABAP workbench function[-code] “documentation”


, to get the documentation translated online using Google.

1.
2.

It translates into (other) logon language – if documentation exist in English.

1. Translates into English – if documentation exists only in German.


2.

When no documentation exist at all then you can be sure about that immediately.
Processing :

You can run the report program directly from SE38 as well . But it will be good if you can embed the
functionality in ABAP Workbench itself .
Implementation for BADI WB_PROCESS_FCODE -Method DISPATCH

: It calls the main utility program Z_RMTIWARI_ABAP_DOC_TRANSLATOR, whenever someone clicks


on the ‘Documentation’ of ABAP Workbench Menu..

method IF_EX_WB_PROCESS_FCODE~DISPATCH .
Data : lv_OBJECT type DOKHL-OBJECT.
Data : lv_obj_id type DOKHL-ID.
data : lv_langp type char5.
data : lv_typ type c.
data : lt_dokil type standard table of dokil.
data : wa_dokil type dokil.

*P_OK_CODE
Check P_OK_CODE eq ‘WB_DOCUMENTATION’.
break-point.
IF sy-tcode eq ‘SE37’.
get parameter id ‘LIB’ field lv_OBJECT.
lv_obj_id = ‘FU’.
lv_typ = ‘T’.
ELSEIF sy-tcode eq ‘SE38’.
get parameter id ‘RID’ field lv_OBJECT.
lv_obj_id = ‘RE’.
lv_typ = ‘E’.

ELSE.

 Not implemented as yet

ENDIF.

select *
into table lt_dokil
from DOKIL
where ID eq lv_obj_id
and OBJECT eq lv_OBJECT
and TYP eq lv_typ.

check sy-subrc eq 0.

READ TABLE lt_dokil into wa_dokil with key langu = sy-langu.

check sy-subrc ne 0.

READ TABLE lt_dokil into wa_dokil with key langu = ‘E’.

if sy-subrc eq 0 .

 Translate from english to logon language

concatenate ‘en|’ sy-langu into lv_langp.

else.
 Get German and translate to English.

lv_langp = ‘de|en’.

endif.

SUBMIT Z_RMTIWARI_ABAP_DOC_TRANSLATOR AND RETURN


WITH P_ID = lv_obj_id
WITH P_OBJECT = lv_object
WITH P_LANGP = lv_langp.

endmethod.

Program Z_RMTIWARI_ABAP_DOC_TRANSLATOR :

The program accepts inputs for the function module name & the language pair in. It simply gets the
available documentation of the object and then generates the HTML code for Google translation
FORM. The HTML Page gets downloaded to ‘C:\Temp’ folder on your PC and subsequently called by
the program in your default browser.

REPORT Z_RMTIWARI_ABAP_DOC_TRANSLATOR .
—-

 ABAP Document Translator – using Google – Date – 18.02.2006

—-

 Written By: Ram Manohar Tiwari

—-

 Presented By: http://www.rmtiwari.com

—-
 This utility will accept ABAP documentation objects and will submit
 the text to google in order to translate it from one language to
 other.

 This utility is useful for translating the function module and other
 ABAP Object’s documenations from German to English, in case it is
 only available in German.

 You can also translate the documentation from english to any other
 (available) language,in case, for you, English is as good as German.

*—-

 This utility is developed on MiniSAP .

*—-

 SELECTION SCREEN

*—-

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.


PARAMETERS : P_ID LIKE DOKHL-ID DEFAULT ‘FU’ OBLIGATORY,
P_LANGU LIKE SY-LANGU DEFAULT ‘D’ NO-DISPLAY,
P_OBJECT LIKE DOKHL-OBJECT OBLIGATORY,
P_LANGP TYPE CHAR5 default ‘de|en’ OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b1 .

SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE text-002.

SELECTION-SCREEN BEGIN OF LINE.


PARAMETERS: P_OUTDIR LIKE rlgrap-filename obligatory default ‘C:\temp’.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK B2.
—-

 Data declaration

—-

data : gv_directory LIKE rlgrap-filename,


gv_file_name TYPE STRING,
gv_html_file_name(100) TYPE C.

data : lt_doc_text type standard table of TLINE with header line.

DATA : BEGIN OF gt_html OCCURS 0,


rec(200) TYPE c,
END OF gt_html.

DATA : gv_html_wa like line of gt_html.

—-

DATA: begin of lt_VALUETAB occurs 0,


P_LANGP type char5,
DESC type char100,
end of lt_VALUETAB .

data : lt_return_tab type standard table of DDSHRETVAL with header line.


data : lv_prog type sy-repid,
lv_dynnr type sy-dynnr.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_LANGP.

CLEAR lt_valuetab. REFRESH lt_valuetab.


lv_prog = sy-repid.
lv_dynnr = sy-dynnr.

lt_valuetab-P_LANGP = ‘de|en’.
lt_valuetab-DESC = ‘German to English’.
APPEND lt_valuetab.

lt_valuetab-P_LANGP = ‘de|fr’.
lt_valuetab-DESC = ‘German to French’.
APPEND lt_valuetab.

lt_valuetab-P_LANGP = ‘en|de’.
lt_valuetab-DESC = ‘English to German’.
APPEND lt_valuetab.

lt_valuetab-P_LANGP = ‘en|es’.
lt_valuetab-DESC = ‘English to Spanish’.
APPEND lt_valuetab.

lt_valuetab-P_LANGP = ‘en|fr’.
lt_valuetab-DESC = ‘English to French’.
APPEND lt_valuetab.

lt_valuetab-P_LANGP = ‘en|it’.
lt_valuetab-DESC = ‘English to Italian’.
APPEND lt_valuetab.

lt_valuetab-P_LANGP = ‘en|pt’.
lt_valuetab-DESC = ‘English to Portuguese’.
APPEND lt_valuetab.

lt_valuetab-P_LANGP = ‘en|ja’.
lt_valuetab-DESC = ‘English to Japanese BETA’.
APPEND lt_valuetab.

lt_valuetab-P_LANGP = ‘en|ko’.
lt_valuetab-DESC = ‘English to Korean BETA’.
APPEND lt_valuetab.
lt_valuetab-P_LANGP = ‘en|cn’.
lt_valuetab-DESC = ‘English to Chinese(Simplified) BETA’.
APPEND lt_valuetab.

 Call the help value screen

CALL FUNCTION ‘F4IF_INT_TABLE_VALUE_REQUEST’


EXPORTING
retfield = ‘P_LANGP’
dynpprog = lv_prog
dynpnr = lv_dynnr
dynprofield = ‘P_LANGP’
value_org = ‘S’
TABLES
value_tab = lt_VALUETAB
RETURN_TAB = lt_return_tab
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc <> 0.

 …

ENDIF.

START-OF-SELECTION.

P_LANGU = P_LANGP(1).

 Get the document text

CALL FUNCTION ‘DOCU_GET’


EXPORTING

 EXTEND_EXCEPT =‘‘

ID = P_ID
LANGU = P_LANGU
OBJECT = P_OBJECT

 TYP = ‘E’
 VERSION =0
 VERSION_ACTIVE_OR_LAST = ‘L’
 PRINT_PARAM_GET = ‘X’
 IMPORTING
 DOKSTATE =
 DOKTITLE =
 HEAD =
 DOKTYP =

TABLES
LINE = lt_doc_text
EXCEPTIONS
NO_DOCU_ON_SCREEN =1
NO_DOCU_SELF_DEF =2
NO_DOCU_TEMP =3
RET_CODE =4
OTHERS =5
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

 Create the google html form for the document text.

PERFORM convert_doc_to_html TABLES lt_doc_text


gt_html.

Concatenate ‘Trans_’ P_OBJECT ‘.html’ into gv_html_file_name.

PERFORM prepare_file_name USING p_outdir


gv_html_file_name
CHANGING gv_file_name.

PERFORM download_html_file_on_pc tables gt_html


using gv_file_name.

PERFORM show_html_file using gv_file_name.

END-OF-SELECTION.

&—-
*& Form prepare_file_name
&—-

 text

—-

 –>x_directory text
 –>x_program_name text
 –>y_file_name text

—-

FORM prepare_file_name USING x_directory


x_file
CHANGING y_file_name.

CONCATENATE x_directory ‘\’ x_file into y_file_name.

ENDFORM. ” prepare_file_name
&—-

*& Form download_html_file_on_pc


&—-

 text

—-
 –> p1 text
 <– p2 text

—-

FORM download_html_file_on_pc tables yt_download


using x_outfile type string.

 Use gui_download if file is located on the local PC.


 WS_download only works in foreground

IF sy-batch EQ ‘X’.
MESSAGE e001(AQ) WITH
‘This program cannot be executed in background’.

 ERROR: Unable to download locally stored files when running in


 background

ELSE.

CALL FUNCTION ‘GUI_DOWNLOAD’


EXPORTING
FILENAME = x_outfile
FILETYPE = ‘ASC’
TABLES
DATA_TAB = yt_download
EXCEPTIONS
FILE_WRITE_ERROR =1
NO_BATCH =2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE =4
NO_AUTHORITY =5
UNKNOWN_ERROR =6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22.

 Status of download

CASE sy-subrc.
WHEN 0.
MESSAGE I002(AQ) WITH
‘HTML page downloaded as ‘ x_outfile.

WHEN OTHERS.

 Upload unsuccessful – error message

MESSAGE ID SY-MSGID TYPE ‘E’ NUMBER SY-MSGNO


WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDCASE.
ENDIF.

ENDFORM. ” download_html_file_on_pc
&—-

*& Form convert_code_to_html


&—-

 text

—-

 –>P_GT_REP_TABLE text
 –>P_GT_HTML text

—-
FORM convert_doc_to_html TABLES xt_REP_TABLE structure TLINE
yt_HTML.

DEFINE add_html.
yt_html = &1.
APPEND yt_html.

END-OF-DEFINITION.

 Add Header to HTML

add_html ‘‘
into lv_langp_html.
endif.

 Remove the space in < /textarea> – this is for SDN weblog

add_html ‘< /textarea>’.


add_html lv_langp_html.
add_html ‘

‘.
add_html ‘‘.
add_html ‘‘.
add_html ‘‘.
add_html ‘
‘.

 Close HTML Tags

add_html ‘</BODY>’.
add_html ‘</HTML>’.

ENDFORM. ” convert_code_to_html
&—-
*& Form show_html_file
&—-

 text

—-

 –>X_FILE_NAME text

—-

FORM show_html_file USING X_FILE_NAME.

data : lv_url(200) type c.

lv_url = x_file_name.
CALL FUNCTION ‘CALL_BROWSER’
EXPORTING
URL = lv_url.

ENDFORM. ” show_html_file

The Result:

For example : You can open a function module say ABAP_DOCU_SHOW using transaction SE37 .
Further click on Menu Function .

Since the BADI is implemented for function code ‘documentation’, the utility will be called and
Google translated text from German to English will be shown in your default browser.
Also there seems to be some problem with the google translation and it does not respect end-of-
sentence or line-breaks http://www.worldlingo.com/ could have done better . That makes the
translated text look like some kind of garbage. Also, there seems to be some encoding related issue.
But that should not be very difficult to resolve.
</P>


 Alert Moderator

Assigned tags

 Retagging required
 rammanohar tiwari

Related Blog Posts


 We are sorry but we are currently unable to retrieve related content.

Related Questions
 We are sorry but we are currently unable to retrieve related content.

6 Comments
You must be Logged on to comment or reply to a post.

Eddy De Clercq

March 2, 2006 at 2:31 am

Hi,

I wondered why you don’t use simplier methods like the one described in
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/web
as/abap/just%20browsi
ng%20Around.article
I’m not saying that my code is better (in the contrary), but using the local machine as in
between stage could result in unwanted problems with the browser (see the multitude of
forum threads on the call_browser) or the file system (e.g. Tivoli managed PCs).
If the SAP server act as client you don’t need to worry about that anymore.

Eddy

o Like(0)

o
Former Member Post author

March 2, 2006 at 7:24 am

Hi Eddy,

Thanks for your comments.


I do have that class cl_http_client in my miniSAP version and I also understand your
concern for Browsers 🙂

But
1. cl_http_client is only available from 4.7 onwards at least I could not find it on the
4.6C version to which I’ve the access.
2. In order to make that work, we might well have to first configure the proxies or
firewalls, which does not actually belong to the expertise domain of ABAP
developers.
3. Ultimately, Google result has to be shown in a browser [ as whatever that was
called was not an API / web-service ]..unless you want to go for
pattern match and then get the text

 Like(0)

Former Member

March 2, 2006 at 9:15 am

Ram,

I think it’s high time you download the NW04s preview edition which is here
on SDN and move on from your 610 you are missing out on
SOOOOOOOOOOOOOOOO much.

Besides configuring the proxy is nothing and most times it’s already done by
your Basis guys for many reasons.

SDN Meets Labs: Integrated Web Content


Craig

 Like(0)

Former Member

March 2, 2006 at 7:43 am


hi there,

I hope you’re not serious about using such a translation service for other reasons then for
making yourself a joke about it.

It’s not only those technical problems of line breaking or UTF characters, it just makes
almost no sense with respect to the very content.

I just say ‘User attitudes’.


Or my runner-up favourite ‘postage G parameters’.
But the best of all ist the translation of the coding …IF EMERGENCY of docu_container IS
INITIAL.

please don’t you ever trust in this. but I am sure you were just doing this for the fun of it :-))

regards,
anton

o Like(0)

Former Member Post author

March 2, 2006 at 8:48 am

In terms of getting comments, this weblog has crossed my previous best.


Earlier, in one of my very few weblogs, I was rewarded with 2 comments (including mine)

Thank You for your kind attention !!

 Like(0)

Former Member

August 15, 2013 at 12:36 pm

Wow – I was looking around for some post to consume a webservice from ABAP while
avoiding PI. AND WebAS AND Java. Plus I have no experience with this. PI Proxy bring it
on. That’s easy.

Anyway – I came across your post. I’m glad you got a record number of responses! I’m glad
they are pointing people like me in the right direction. I am disappointed you didn’t get any
positive comments.

So years later, and a dollar short. Thank you for the post! The responses and the blog have
helped me out. I’m glad you were exploring different parts of SAP, and figuring out how
they work.
I’m looking forward to reading your newer posts!

Translations for Transaction texts


By Sailaja Tadikonda

Introduction:

Translations into different languages for Transactions texts that are created through Tcode se93

Step 1:

Go to Transaction SE63.

The initial screen will be displayed.

Step 2:

Go to menu bar

Choose Translation -> ABAP Objects -> Short Texts

Step 3:

Popup will be displayed to choose the object type.

Select the Transactions under ABAO Texts as specified below.


Double click on the “TRAN Transactions”

Step 4:

The next screen will be displayed.

Step 5:

Using Tcode SE93, created Transaction ZTEST_TRANS for a program as shown below
Step 6:

Enter the name of Transaction code and to which language that you want to translate.

Here I given the transaction code as “ZTEST_TRANS “and translation from English (EN) to German (DE).
Choose Edit button.

Step 7:

Next screen will be displayed as below.

Step 8:

Give translation text in German for the Transaction text of English language.
And choose save button.

A success message is displayed that the text is saved in target language

Home

All Posts

Tutorials

ABAP

Ariba

ABAP for SAP HANA

Adobe Interactive Forms

APIs in SAP

BI/BW

Business Work Flow

Code Snippets

Core Data Services (CDS)

Fiori

Generic Object Services (GOS)

HANA

miniSAP Installation for Free

OData & SAP Netweaver Gateway

OOPs ABAP

Personas

S/4HANA

SAP Hybris

SAPUI5

Transportation Management & SAP IS Oil


Vistex

Web Dynpro ABAP

Web Services in SAP

CDS

UI5

Fiori

OData

HANA ABAP

S/4HANA

SAP ABAP for HANA

HANA Admin

Core Data Services (CDS)

Forums

YouTube Channel

Amazon

Discussion Forums

Register to Participate (Free)

Registered Member Login Here

Lost Password – Reset Here

Important SAP Interview Questions and Answers

Privacy Policy

Extra

Real SAP HANA Project Discussions and Lessons Learnt

EARN up to 500 INR per Article

SAP Quiz

SAP ABAP Quiz 1

SAP ABAP Quiz 2

Books

Jobs

Find

Apply
V-Courses

Introduction to SAP Netweaver Gateway & OData for Beginners

SAP HANA, HANA DB & ABAP Development Tools for Beginners

SAP Debugging for Non-Technical Consultants & Beginners

New Features and Syntaxes in ABAP 7.40 – Exercises

Help Us

Sign in

Welcome!Log into your account

your username

your password

Forgot your password?

Sign up

Welcome!Register for an account

your email

your username

A password will be e-mailed to you.

Password recovery

Recover your password

your email

Top of Form

Search

Bottom of Form

Saturday, March 23, 2019

Sign in / Join

miniSAP

Part 1 – Installation of Linux Mint for SAP

Part 2 – Configuring Linux for the SAP installation

Part 3 – Installation of SAP on Linux System

Part 4 – Installation & Configuration of SAPGUI


SAP YARD-athon

Yard-athon August 2017 – ABAP 7.4 Special

Yard-athon August 2017 – ABAP 7.4 Special (Answer)

Know thy Yard Men

About Us

Authors

Contact Us

Star Contributors

EARN

Write & Earn

Jobs

All SAP Tutorials

Forums

Discussion Forums

Please Register to Participate (It’s Free)

Login for Registered Members

Lost Password (Reset here)

Important SAP Interview Questions and Answers

Privacy Policy

SAPYard YouTube Channel

Amazon

FREE Trainings

Introduction to SAP Netweaver Gateway & OData for Beginners

SAP HANA, HANA DB & ABAP Development Tools for Beginners

SAP Debugging for Non-Technical Consultants & Beginners

New Features and Syntaxes in ABAP 7.40 – Exercises

Donate

SAP Access

Sign in

Welcome! Log into your account

your username
your password

Forgot your password? Get help

Create an account

Create an account

Welcome! Register for an account

your email

your username

A password will be e-mailed to you.

Password recovery

Recover your password

your email

A password will be e-mailed to you.

SAPYard Suggests to Check this Info.

Home

All Posts

Tutorials

ABAP

Ariba

ABAP for SAP HANA

Adobe Interactive Forms

APIs in SAP

BI/BW
Business Work Flow

Code Snippets

Core Data Services (CDS)

Fiori

Generic Object Services (GOS)

HANA

miniSAP Installation for Free

OData & SAP Netweaver Gateway

OOPs ABAP

Personas

S/4HANA

SAP Hybris

SAPUI5

Transportation Management & SAP IS Oil

Vistex

Web Dynpro ABAP

Web Services in SAP

CDS

UI5

Fiori

OData

HANA ABAP

S/4HANA

SAP ABAP for HANA

HANA Admin

Core Data Services (CDS)

Forums

YouTube Channel

Amazon

Discussion Forums

Register to Participate (Free)


Registered Member Login Here

Lost Password – Reset Here

Important SAP Interview Questions and Answers

Privacy Policy

Extra

Real SAP HANA Project Discussions and Lessons Learnt

EARN up to 500 INR per Article

SAP Quiz

SAP ABAP Quiz 1

SAP ABAP Quiz 2

Books

Jobs

Find

Apply

V-Courses

Introduction to SAP Netweaver Gateway & OData for Beginners

SAP HANA, HANA DB & ABAP Development Tools for Beginners

SAP Debugging for Non-Technical Consultants & Beginners

New Features and Syntaxes in ABAP 7.40 – Exercises

Help Us

Top of Form

Search

Bottom of Form

Home ABAP 4 Smart Steps to Avoid Junk Characters using SAP Language Translation Approach

ABAP

Form

Tweaks

4 Smart Steps to Avoid Junk Characters using SAP Language Translation Approach

By

Sumit Naik

-
October 23, 2018

Share on Facebook

Tweet on Twitter

SAP Language Translation has been there since the birth of SAP. If you are in a project with Global
Roll Outs, you must have faced the issue of Language and Translation. In the mid 2000 era, I was
working for a USA client who were rolling out for South America and Asia. The USA release was
perfect but we had to put major effort for Language and Currency conversions for other
geographies.

Application developers (read ABAPer) often get junk character issue during Form Translations in roll
out engagements. Though Language Translation activity is one of the basic requirements in SAP
Forms (SmartScript, SmartForm or Adobe), at times if can consume high efforts to troubleshoot junk
character issues, and stress the developers and the team to great extend, if not approached

diligently.

Also Read : Free Video Tutorials on HANA, OData and ABAP 7.40
We have followed the simple below strategy for smooth Translation Activity for localize
requirement. You might use it as a guide for your project needs.

Pre-requisites for any Language Translation Activity

If you are in a team who are performing the language translation activity, do not neglect the below
two points:

1. Configure and Use Correct Font for Printing

For instance, we need to use JPMINCHO for language Japanese. Similarly for Chinese language, we
should use CNSONG or CNHEI.

2. Configure and Use Correct Device Type and Printer

Having said that, the million dollar question is, how do we really identify the correct font and device
type that should be used?

How? How? How?

Do not worry. We are here to help you. Adopt the below simple procedures and you would never
see those unwanted characters in your output forms.

Hands on Exercise

For our understanding we would pick Chinese Language for Translation. We know that for Simplified
Chinese, ‘ZH’ is the SAP language code.

If you want to know the Language Keys or SAP Language Code, then go to table T002.
Coming back to the exercise, we would see how we can Translate a simple Purchase Order Texts
from English to Chinese.

Below steps would help us identify the correct Font and Device Type which in turn would help us
address the Language Translation requirement.

Step 1: Prepare Language Translation Template

A language translation template should be prepared to collate the localize language (Chinese (ZH)
for our example) from the business/end/super users.

Step 2: Identify the Correct Font

Identifying the correct font that should be used for the Purchase Order Form is our next step.

Go to t-code SE71, give the SAPScript name, for PO case it is MEDRUCK and Language as ‘ZH’. Select
the Paragraph Formats and hit display.

Click the Font to get the Chinese Font name. Check the font is CNHEI. We need to leverage the same
for our business case.
For some of us, it might look like below.

Also Read : Step by Step Tutorials on SAP Adobe Forms

Step 3 : Identify the Correct Device Type

Now we need to analyse and figure out the correct device type which would support the Chinese
font CNHEI identified above.

The SAPscript Printer Fonts table TFO03 comes to our rescue. Provide the font identified (CNHEI) in
above step and get the correct Device Type. It has one to many relationship. Based on the fonts,
character per inch, bold, italics etc choose the most appropriate one for your landscape.
Step 4: Identify the correct Printer for the Device Type

The Spool Printer declaration table TSP03 has the information. Provide the device type CNHPLJ4 and
it would provide you the correct Printer.

Above is one of the Printer which supports Chinese Language.

That’s it. Follow the above 4 steps and have a smooth Translation and Printing activity. This is my
first article at SAPYard. Please do provide your genuine feedback. It would help me for my next
article.

Download Telegram App in your mobile and join the most active SAP Technical Discussion Group
where we have dedicated members (2580+) from 6 continents.
Log On


o Edit My Profile
o Account Settings
o Notifications
o Followed Activities

 Logout

 Home
 Community
 Archives
 Discussions Archive
 ABAP Development

 Ask a Question
 Write a Blog Post
 Login / Sign-up

o Send a Message
o Manage My Blog Posts
o Quick Start Guide

Archived discussions are read-only. Learn more about SAP Q&A

How to translate table entries


description.
This question is answered

Hi Gurus,
I have a table with entries. I want to translate the table entries into different language.
for that i entered as
SM30--> Goto --> Translation. But inthis position its Greyed out. Can anyone tell where can i
change translation for my description of entries.
Mohana
Tags:

 abap
Former Member
November 11, 2008 at 09:32 AM
0 Likes
Correct Answer

Former Member replied


November 11, 2008 at 09:32 AM

hello Vijayan ,
All the above solutions are to translate the elements in table but not table entries ,
For this you have to create a Text table , like suppose you have a table ZTAB , Create another
table with the same fields and also one extra field language ( SPRAS ) .
if your table is already used in many places then better create a new text table for that , or else
modify the existing table by adding a field ( SPRAS ) .
for example consider TSTC - SAP Transaction Codes
TSTCT - Transaction Code Texts ( this is text table ).
To create text table , in change mode select a primary key and press foreign key button a new
pop screen appears in tht give the check table name (text table ) and select radio button 'key
fields of text table'.
hope it might be helpful,
Regards ,
Aby
1 Likes 1 View this answer in context
Not what you were looking for? View more on this topic or Ask a question

8 replies

Former Member replied


November 11, 2008 at 08:00 AM

Hi,
You go to se11
Go To --> Transalation --> it will help you to write the language of transaction.
Thanks & Regards
0 likes
Former Member replied
November 11, 2008 at 08:06 AM

Hi,
u can do the translation from one language to another using SE11 ..
goto -> translation ........
Regards
Renu
0 likes

Former Member replied


November 11, 2008 at 08:14 AM

Hi
If i enters SE11--> Translation. It not for table entries na. It for table only. But i want translate my
table entries.
pls guide.
Mohana
0 likes

Former Member replied


November 11, 2008 at 08:43 AM

Anyone having idea? anyone faced this before?


Mohana
0 likes

Thomas Zloch replied


November 11, 2008 at 09:20 AM

The translation option is disabled for a reason. Most likely because your table is not translatable,
i.e. it does not contain a key field of data type LANG (language).
You will have to include such a field in your table and re-generate the maintenance dialog, then
try again.
Thomas
0 likes

Former Member replied


November 11, 2008 at 09:28 AM

is it a SAP standard table or "Z" table?


0 likes

Always Learner replied


November 11, 2008 at 08:45 AM

Hi Mohan,
Copy Code

1. Use Tcode SE63

Thanks & Regards


0 likes

Correct Answer

Former Member replied


November 11, 2008 at 09:32 AM

hello Vijayan ,
All the above solutions are to translate the elements in table but not table entries ,
For this you have to create a Text table , like suppose you have a table ZTAB , Create another
table with the same fields and also one extra field language ( SPRAS ) .
if your table is already used in many places then better create a new text table for that , or else
modify the existing table by adding a field ( SPRAS ) .
for example consider TSTC - SAP Transaction Codes
TSTCT - Transaction Code Texts ( this is text table ).
To create text table , in change mode select a primary key and press foreign key button a new
pop screen appears in tht give the check table name (text table ) and select radio button 'key
fields of text table'.
hope it might be helpful,
Regards ,
Aby
1

Smart Form Language Translation - Step by


Step procedure
Skip to end of metadata

 Created by Guest, last modified by Moshe Naveh on Sep 16, 2010


Go to start of metadata
Applies to:
Developers who work on Smart Forms language translation requirements.

Summary:
This white paper gives you the step by step procedure to translate the Smart Form from one language to another
language (Language Translation) easily.

Author(s):
Company: Larsen and Toubro Infotech Ltd.
Created on: Date 9/15/2010
Author(s) Bio
SAP ABAP consultant with around 1 year of experience in Smart Forms, SAP scripts, Enhancements, Module Pool,
Reports.

Language translation in smart forms:

Language translation in smart forms


Here are the steps...

1. Go to transaction 'SE63'.

2. Click on 'Translation' -> 'ABAP objects' -> 'Other long texts'.

3. Click on 'FS forms and Styles' and select 'SSF SAP Smart form'.

4. Then enter the smart form name in the object name text field.

5. Select the source language as English and the target language as the language u want to convert. (In our ex.
Portuguese)

6. Click edit.

7. It will open the smart form in two frames.


8. Now add the translated content to the target text window and click 'Save Active'.

Related Content:
SAP Smart form language translation ( Translate smart form from one language to another language).
 smartforms
 step-by-step-procedure
 language-translation

2 Comments

1.
Former Member
good indications. But for my is little bit confusing when don't have the same number of text betwen original language
and destination language
o Jun 22, 2016
2.
Patrick Fichtner
Hi Jose Antonio,

that's why normally you first copy the whole source into the new language, and then start the translation. (via copy-icon
or edit→copy source text).

Un saludo

Patrick
o Feb 10, 2017
Log On


o Edit My Profile
o Account Settings
o Notifications
o Followed Activities

 Logout

 Home
 Community
 Blogs

 Ask a Question
 Write a Blog Post
 Login / Sign-up

o Send a Message
o Manage My Blog Posts
o Quick Start Guide

Gaurang Gujar
January 25, 20133 minute read

Language Translation Tool for SAP Technical Objects


FollowRSS feedLike

0 Likes 3,540 Views 15 Comments

Applies to:
SAP NetWeaver 2004s, mySAP ERP 2005

Created on:

22-01-2013

Author:

Gaurang Gujar, Capgemini , Consultant , Appsone.

Summary:

Many of the MNC’s require SAP implementation all over the globe involving a lot of custom objects and
custom text. It is a tedious task to translate this text manually where lot of hours are burnt for the same
and moreover the translation may still have some human related translation typo errors, which will
require more efforts to be put in to correct it .

Purpose:

The tool developed increases the efficiency of language translation objects as it helps in avoiding human
errors. This tool also does the translation for Reports, Function groups, Includes in seconds. This tool not
only saves time for translation but also helps in reviewing the translation done with an additional Excel
tool.

Traditional method of LT

In most of the cases the Language translation for various Custom Texts is made available in Excel
worksheet.

Below is sample screen shot of the same.


Now Here the Translation in SAP is done by using SE63 T-code or SE38 GoTo->Translation

Enter the Source and Target Language

Find the Text in source language and enter the corresponding translation from Excel Worksheet in as
shown below.
LT by using this tool

The tool is made considering the most common input and output medium used for translation to be Excel
worksheet. The Text Types and Translation are Read from Excel using an ABAP Program and Insert this
translation into the Text Pool of the Program Specified in the Selection Screen of the Tool. This tool can be
used for Uploading and Reviewing the Translation.

Section 1

Uploading the Translation

 Execute the ABAP Program (Tool). Selection screen is shown below

 Choose the Radio Button “TRANS” for translation.


 Enter the Program Name for which the Translation is to be done in “PROG”
 Specify the Source Excel File Path which has translation in “FILENAME”.
 Specify the source language and target languages in “S1” “T1” “T2” “T3” where ‘’T2” and “T3” are
optional. A maximum of 3 target language’s can be translated at once using this sample tool.
 Execute the Code and translation will be completed.

Section 2

Reviewing the Translation

 Choose the Radio Button “REVIEW” for reviewing the translation.


 Enter the program name, Source and Target Language’s and Path of the blank destination Excel file.
 Execute The Code

This code will export the current language translation in Excel file mentioned in the above selection

screen.

Output will be as shown below

The 2 Excel file (Source and Review) can be compared using another Excel based tool

Whose opening screen is shown below.


 Open the Macro Enabled Excel Tool
 Click On LT utility for Reports

 Excel based Form Is to be provided with both(Source and review) Excel file details:

1) Excel File Path

2) Sheet Name

3) Source and Target Index of Translation Text in the Worksheet

 Output of this tool execution is shown below


 The 2 files are compared for source and target language and in case of any error, this is displayed
as highlighted in red in the source column and the non-highlighted cells in the target column
indicates the mismatch else they are highlighted in yellow. If no entries exist in any one of the file
for a record, then the cells in the target columns are not highlighted. This is shown in the above
screenshot.
 This incorrect Translation can then be corrected and uploaded.

Future Scope

This methodology is currently capable of doing automatic language translation for Reports, Includes,

Programs and Function Groups. This Tool with additional changes can be used for language translation
of almost all SAP objects like Smart forms , Adobe Forms, Workflow etc

Related content

Complete documentation on language translation of SAP objects using SE63 Tcode

http://help.sap.com/saphelp_nw04/helpdata/en/77/5719d2492011d1894a0000e829fbbd/frameset.ht
m

You might also like