You are on page 1of 19

Translations

Posted on November 6, 2017 by easyabapforbeginners


Translating programs, Output Forms, Module Pools, Error messages etc … is important
for users. Imagine the company that you work with has a Plant in Italy and the employees
there they don’t speak English but they need to use the SAP system. You need to translate

everything in Italian
In this Tips and tricks blog post i will show you some of the used techniques for
Translations.

Text Translation In Programs


In Order to be able to translate text we need to create Text elements, then translate
them.In the example below I have created 3 Text elements TEXT-001,TEXT-002 and
TEXT-003.
The P_WERKS is declared ad reference to MARC-WERKS so we don’t need to translate it.
It will automatically get the translation from the standard field WERKS.
P_DAYS is declared as a numeric field so we need to translate it.

Translation:
Source code:

REPORT Z_RIM_ABASSI.

TABLES: MARC.

DATA: V_STRING TYPE STRING.

SELECTION-SCREEN: BEGIN OF BLOCK A1 WITH FRAME TITLE TEXT-001.


PARAMETERS: P_WERKS LIKE MARC-WERKS.
PARAMETERS: P_DAYS(3) TYPE N.
SELECTION-SCREEN: END OF BLOCK A1.

START-OF-SELECTION.

WRITE : TEXT-002.
WRITE TEXT-003.

END-OF-SELECTION.

Attach Translation in a Transport Request


Data Dictionary Translation
The most important thing to translate in Data Dictionary are the Data element and the
Table.

Table translation

Data Element Translation


You need to do the same thing for Views, structures, Table Types etc …

Attach translation into a Transport Request

Smartforms
There is no direct link in transaction SMARTFORMS for translation, so we need to use
transaction SE63. You can use this transaction for all translations.
Attach translation into the Transport Request
AdobeForms
For AdobeForms you can use transaction SFP, the translation tool is similar to programs
and data dictionary.

Attach translation into a Transport Request


Module Pool’s
I created a module Pool Z_MODULEPOOL with screen 100. There is 2 methods to translate
a screen.

Method 1
Go to the screen in SE80.
Method 2
Go to transaction SE51.

In Module Pool you can also translate PF_STATUS, Titles etc… via SE80 or by using
transaction SE41.
Step by Step tutorials
How to translate SAP
Smartforms ?
Jun 22, 2016 BY SAB125 IN ABAP TUTORIALS

Translate SAP Smartforms is explained step by step in the following


SAP ABAP tutorials.
Note that you have to transport the translation. First, how to navigate
to SAP Smartforms translate tools and then how to translate it.
Table of Contents

Translate SAP Smartforms Navigation


Launch the SAP tcode SE63 for: Standard Translation Environment.
Navigate to : ABAP Objects > Other Long Texts
The SAP objects corresponding to Smartforms’s text, as the screen
capture, is :
FS: Forms and Styles > SSF : SAP Smart Form

SAP Smartforms Translation


One you launch the smartforms translation screen, the screen is
splitted into two parts.

 The first part contains the different texts on the source language.
 The bottom part contains the Text in the Target language.
Tip1: copy the entire source Text into the target with the formatting.
Then translate the text directly in the bottom part. You will keep the
some formatting as the source text
Tip2: you can manage different formatting between the target
language and the source language for the SAP Smartforms.
The formatting for the SAP Smartforms texts follow the pattern:
T1 : <B>Text</> -> T1 is the Paragraph formatting and <B> is the
Character formatting. Both of them can define to Smartforms Style
Sheet and assigned to the Smartforms.

Transport SAP Smartforms Translation


SAP Smartforms Translation as the most translation in SAP can be
transported.
So launch the SAP Standard report RS_LXE_RECORD_TORDER (SE63
Translation Transport)
First select the Target language.
In the Transport Request Block, you can use an already existing
Transport Request or fill a description and the SAP will generated a
new Request for you.

You can set the selection for the translation by:

 Time Period ( in full mode or in delta mode )


 Object Type / Object Processor
Package
 Software Component

Check if a Translation exists for a


Smartforms
In the bonus section, I will add this topic how to know if a Smartforms
translation exists.

The keys here is to check one of the following tables:

 STXFTXT: SAP Smart Forms: Texts


 STXFADMT :Smart Forms: Administration – Textual Description
Let’s make a foucs on the first tables STXFTXT

Smartform Transalation and SAP Table STXFTXT


The SAP Table STXFTXT stores all the text information of a SAP
Smartforms.
SAP Smartforms Related Tables & Tcodes
As we are dealing with Smartforms, let’s list the main SAP Smartforms
( and Sapscript ) Tables and Tcodes. It can be helpfull for some cases.

Important Smartforms Tables


 STXFADM – Smart Forms: Administration Basis
 STXH – SAPscript text file header Basis
 STXD – SAPscript text file header Basis
 STXFOBJT – Smart Forms: Subobject Long Texts Basis
 STXFCONT – Smart Forms: Form Subobjects (Active) Basis
 STXFCONTS – Smart Forms: Form Subobjects (Saved) Basis
Main SAP Smartforms Tcodes
 SO10 – SAPscript: Standard Texts Basis – SAPscript
 SE63 – Translation: Initial Screen Basis – Translation Tools
 SE38 – ABAP Editor Basis – ABAP Editor
 SE37 – ABAP Function Modules Basis – Function Builder
 SPRO – Customizing – Edit Project Basis – Customizing Project
Management (IMG)
 SE11 – ABAP Dictionary Maintenance Basis – Dictionary Maintenance
Further ressources
Check also:

 Smart Form Language Translation – Step by Step procedure


 How to maintain Smartforms in different languages?
 STXFTXT – SAP table

 Welcome !
Welcome to Zevolving - place where you find one of the best articles, tutorials for ABAP
 Recent Posts

Display ALV Grid on List Generated by WRITE


Ever wondered how to generate the ALV Grid on the list generated by WRITE statement. Lets see today ...

Why NOT to have a wrapper around Exception (RAISE) ?


Class based exception are more powerful compared to the "legacy" exceptions. But you don't want to c...

What you need for ABAP Custom Programs when you migrate to HANA?
Since HANA uses a different underlying architecture, there would be some impact to the custom ABAP C...

o More Post →
 OO Concepts
o Abstract class vs Interface
o Multiple Inheritance
o When to use Local Class
o Class Based Exceptions
o Constructors
o More »
 Design Patterns
o Singleton
o Model View Controller
o Singleton Factory
o Decorator
o Observer
o More »
 Performance
o FieldSymobls vs WA
o Parallel Cursor
o ITAB Copy
o FOR ALL Entries
o Between breakpoints
o More »
 Concepts
o New TYPE Category BOXED
o Pragmas replacing Pseudo Comments
o Method Chaining
o ITAB Secondary Keys
o More »
 Tutorials
o SALV Table Display
o SALV HS Table Display
o Classic
o Generic Object Services (GOS)
o Dynamic ITAB
o Case Studies

SEARCH Search in Zev


Search:

o Or Explore Archives
 Code Snippets

 Home
 Recent Posts
 OO Concepts
 Design Patterns
 Performance
 Concepts
 Tutorials

5
 Home
 Concepts
 SAP ABAP Pragmas in 7.02 EhP2, replacing SLIN Pseudo Comments
SAP ABAP Pragmas in 7.02 EhP2,
replacing SLIN Pseudo
Comments
By Naimesh Patel | February 20, 2013 | Concepts | 22,779 | 5

Going forward Pseudo Comments are getting replaced by Pragmas which are
introduced since ABAP release 7.0 EhP2. So, What are Pragmas? Lets check it out.

What are Pragmas?

Pragmas are program directives which would use to hide warnings and errors from
Compilers and Extended Program checks. Program directive are statements which don’t
affect the flow of the execution of the program but it provides a direction to Compiler
what to do when specific error or warning situation occurs.

Pragmas are introduced in release 7.02 EhP2. For time being, Pragmas will replace the
Pseudo comments for

 Compiler warnings
 Extended Program errors and warnings

Pseudo comments for suppressing errors and warnings for Code Inspector would be still
effective. Means, you would still need to use Pseudo comments to overpass those
warnings and errors coming from the Code Inspector.

How to use Pragmas?

To use Pragmas is quite different from what you do with Pseudo comment. Since
Pseudo comment is actually a half line Comment, you put the Pseudo comments after
end of the statement ‘.’ Or ‘,’. Like this:

Pseudo Comments to hide SLIN errors/warnings

REPORT ztest_np_pseudo_comments.
*&------------------------------------------------------------------
---*
*& Purpose : Psuedo comments usage to hide SLIN Errors / warnings
*& Author : Naimesh Patel
*& URL : http://zevolving.com/?p=1831
*&------------------------------------------------------------------
---*
*
* In SLIN, This would produce a warning that its not read anywhere
DATA text TYPE STRING. "#EC
NEEDED
*
* IN SLIN, This would produce error in character string
text = 'Hello Zevolving using Pseudo Comments'. "#EC
NOTEXT

Since Pragmas are part of the statement, it has to be added before end of the
statement. It can’t occur after end of the statement, otherwise, system would generate
an error. Something like this:

Pragmas to hide errors of SLIN

*&------------------------------------------------------------------
---*
*& Purpose : Pragmas usage on hiding the errors / warning
*& Author : Naimesh Patel
*& URL : http://zevolving.com/?p=1831
*&------------------------------------------------------------------
---*
REPORT ztest_np_pragmas.
*
* Hidden using pragmas instead of the pseudo code.
* Also notice that pragmas are part of the statement, end of
statement
* is after the pragmas.
DATA text TYPE STRING ##needed.
DATA text_new TYPE STRING ##needed.

text = 'Hello Zevolving using Pragmas' ##no_text.


text = 'Hello Zevolving using Pseudo Comments'. "#EC
NOTEXT

Another small difference is, Pseudo comments gets formatting properly to the end of the
line when we use Pretty Printer. Pragmas stay at exactly that position, even when pretty
printer is used as they are part of the statement.

When you do the Extended Program check for this demo program with selecting both
Character String and Also display hidden messages (Pseudo comments), you
would notice the messages like this. I guess, SAP still have to update this option with
Display hidden messages (Pragmas & Pseudo Comments).

Result of Pragmas Usage to hide Character String error:


Result of Pragmas Usage to hide Unused variables warning:

As you can see in the screenshot, message also points out which Pragmas can be used
as an alternative to Pseudo comments to hide that error or warning.

We can also specify Parameter to the Pramas using []. But I still have to figure that out.

Program ABAP_SLIN_PRAGMAS

So how would you know which Pseudo comment is replaced by which Pragma? When
run the program ABAP_SLIN_PRAGMAS, you see the list of Pseudo comments and its
replacement Pragmas. The info is coming from the table SLIN_DESC. Table
SLIN_DESC contains all the Pseudo code which can be used to suppress various errors
and warnings from the Extended Program Check (SLIN). The texts are maintained in
German only so, we need to ask our friends from Germany to translate it for us

The table does exist in the earlier releases. In earlier releases, you would also notice
that there are many SLIN checks which can be hidden using Asterisk (*). So, there are
many entries in table where PSEUDO_COM = ‘*’ in earlier release. But with introduction
of Pragma, all the entries which can be just hidden using pseudo comment “#EC * are
now replaced with specific Pragma as well as specific Pseudo comments.

Conclusion

Pseudo comment will eventually replaced every where with different ways either by
Pragmas or by Using additional Keywords like in ABAP Unit. ABAP Unit, would be next
new adventure.

Have you used Pragmas yet? What do you think about this? Ple

You might also like