The translation process of ABAP objects; It has always been a software developer’s nightmare because it is made with primitive methods. This project automates the translation process of ABAP objects with the SAP RPA product.
1.Introduction
The project is very simple to use. The RPA process is completed by matching the translation information from the uploaded excel file with ABAP objects. After the process is completed, the request (via slxt transaction code) containing the translated objects is created by RPA. Additionally, the bot takes a screenshot of this request and sends an e-mail to the user.
2.Usage Areas of the Project
- Roll-out Projects
- The need for translation into more than one language of the newly written/untranslated product
- Easy translation of untranslated Z objects (many) in the ABAP dictionary with this product
3.Advantages of the Project
- %50 savings on time spent on translation
- Minimizing user-based translation errors
- Reduce translation effort (%80)
- Translation into multiple languages
4.ABAP Objects of the Project
- ABAP Objects already included in the project
- Data Element
- Message Class
- Smartforms
- AdobeForms
- ABAP Objects that can be added to the project
- Domain
- Structure
- Table
- Table Type
- Menu Area
- Reports (with screens)
- ABAP Objects that are not suitable for the project design
- Text Tables
5.Detailed Structure of the Project
- A separate workflow has been created for each ABAP object in the project.
- The workflows created in one MAIN workflow are called.
- We can specify which workflow RPA will call in the ‘Entry Sheet’ section in excel.
- RPA reads ABAP Objects’ information such as object name and translation language from separately created ‘Sheets’ (eg Data Element).
- It will be sufficient to create a new workflow for the ABAP objects to be added, to ‘REUSE‘ this workflow to the MAIN workflow and to update the excel file.
- Information such as system information, user name and password, request name, for which RPA will translate, can also be read from excel and defined from RPA Cloud Factory. (There is also a ‘Request Sheet’ in the sample excel file, but I preferred to read it from RPA Cloud Factory.)
Note: Since the translation interface of ABAP objects such as ‘Message, Data Element, Domain, Reports’ is almost the same, dynamic programming method can also be used for objects with similar interfaces by defining a general ‘Criteria’.
5.1.Workflow

5.1.1. Data Element
- Go to transaction code SE63.
- Click on Transport Object. (The loop should start here.)
- The bot repeats this process as much as the number of rows of translation information in the Excel file.
- Data element object information is entered.
- The fields to be translated are mathced with the data in the excel file.
5.1.2.Message
- Go to transaction code SE91.
- Message Class and Message number are entered. (The loop should start here.)
- The bot repeats this process as much as number of rows of translation information in the Excel file.
- Original Language and Target Language; it is entered by following steps Go to->Translation
- Translation is done.
5.1.3.Smartforms
- Go to transaction code SE63
- Click Other Text. (The loop should start here. It is also possible to start loop on SSF interface by using keystroke F3 command)
- Smartforms information in excel file is filtered by the bot. Smartforms informations are appended to the internal table using the method Deep Structure. The loop count is gotten by length of Deep Structure.
- The SSF object is found using search button and clicked.
- Smartforms object information is entered in the SSF interface.
- It will be appeared 2 GUI Containers. Container at the top is the original structure of the object. The number of rows here is calculated by scrolling down.
- Click Copy Source Text(SHIFT F8) to copy original structure of smartforms.
- The texts of Paragraph type which does not start with ‘/’ at the Bottom Container are compared with the data in the excel file and the translations are made line by line.
- When the translation process is completed, the bot click Save and Active button.
5.1.4.Adobeforms
- Go to trancation code SE63.
- Click Other Text. (The loop should start here. It is also possible to start loop on PDFB interface by using keystroke F3 command)
- Adobeforms information in excel file is filtered by the bot. Adobeforms informations are appended to the internal table using the method Deep Structure. The loop count is gotten by length of Deep Structure.
- It will be appeared 2 GUI Containers. Container at the top is the original structure of the object.The original structure of object is copied by clicking Copy Source Text (SHIFT F8).
- The data at the Bottom Container is defined as a new variable. Line by line data is compared with the data in the excel file, and the data is set by appending it to a new variable with the REPLACE function.
- The process is completed by clicking Save and Active.
5.1.5.Main Translation
- Data is retrieved from RPA Cloud Factory with Declare-Get methods.
- A simple excel upload Popup is designed from UI Designer to upload Excel.
- The path of the file from the designed Popup is assigned to the global variable.
- Excel data is retrieved by using RPA excel methods with path we have( a separate global internal table is used for each sheet).
- The workflows created with the Reuse method are called.
- Immediately after the Workflows are finished, the SLXT transaction code is accessed and the necessary information (such as Object Processor, Date, All languages, Workbench request) is entered and the transaction code is executed.
- Screenshot of each page is taken with the RPA screen-shot method on the incoming screen, and information about the request created is sent to the e-mail address defined in RPA Cloud Factory.

6.Important Notes
- The SAP Logon page must be called at every Workflow start.
- killSAP functions must be called at each Workflow start and end..
- Every Workflow must start with Start Application and end with Close Application.
- If the ‘Entry Sheet’ data in the Excel file is ‘X’, workflows should start, otherwise workflows should be terminated with sc.endStep() functions.
7.Important Code Blocks
- Getting Excel Values
//Get Entry Details
/****************************************************************************************************************************/
ctx.excel.sheet.activate(“Entry”);
var row1 = ctx.excel.sheet.getLastRow(“A1”);
var col1 = ctx.excel.sheet.getLastColumn(“A1”);
rootData.ExcelData.Entry = ctx.excel.sheet.getFullRangeValues(“A”,1,String.fromCharCode(64+col1),row1-1,””);
//Get Data Element Details
//****************************************************************************************************************************
ctx.excel.sheet.activate(“Data Element”);
var row2 = ctx.excel.sheet.getLastRow(“A1”);
var col2 = ctx.excel.sheet.getLastColumn(“A1”);
rootData.ExcelData.DataElement = ctx.excel.sheet.getFullRangeValues(“A”,1,String.fromCharCode(64+col2),row2-1,””);
//Get Smartforms Details
//****************************************************************************************************************************
ctx.excel.sheet.activate(“Smartforms”);
var row3 = ctx.excel.sheet.getLastRow(“A1”);
var col3 = ctx.excel.sheet.getLastColumn(“A1”);
rootData.ExcelData.SmartForms = ctx.excel.sheet.getFullRangeValues(“A”,1,String.fromCharCode(64+col3),row3-1,””)
//Get Adobe Forms Details
/****************************************************************************************************************************/
ctx.excel.sheet.activate(“Adobe Forms”);
var row4 = ctx.excel.sheet.getLastRow(“A1”);
var col4 = ctx.excel.sheet.getLastColumn(“A1”);
rootData.ExcelData.AdobeForms = ctx.excel.sheet.getFullRangeValues(“A”,1,String.fromCharCode(64+col4),row4-1,””);
//Get Message Details
//****************************************************************************************************************************
ctx.excel.sheet.activate(“Message”);
var row5 = ctx.excel.sheet.getLastRow(“A1”);
var col5 = ctx.excel.sheet.getLastColumn(“A1”);
rootData.ExcelData.Message = ctx.excel.sheet.getFullRangeValues(“A”,1,String.fromCharCode(64+col5),row5-1,””);
//Get Request Details
//****************************************************************************************************************************
ctx.excel.sheet.activate(“Request”);
var row6 = ctx.excel.sheet.getLastRow(“A1”);
var col6 = ctx.excel.sheet.getLastColumn(“A1”);
rootData.ExcelData.Request= ctx.excel.sheet.getFullRangeValues(“A”,1,String.fromCharCode(64+col6),row6-1,””);
- killSAP
function killSAP(){
var __result = ctx.wmi.query(‘Win32_Process’, [ ‘ProcessId’, ‘Name’, ‘ExecutionState’ ], “Name=’saplogon.exe'”);
if(__result.length > 0) {
for(var __counter = 0; __counter<__result.length; __counter++) {
ctx.sleep(500);
var __result2 = ctx.wmi.query(‘Win32_Process’, [ ‘ProcessId’, ‘Name’, ‘ExecutionState’ ], “ProcessId=”+__result[__counter].ProcessId);
if(__result2.length > 0) {
ctx.wmi.killProcess(__result2[0].ProcessId);
}
}
ctx.log(“All running instances of process ‘saplogon.exe’ have been killed.”, e.logIconType.Info);
}
else {
ctx.log(“No found running instance of process ‘saplogon.exe’.”, e.logIconType.Warning);
}
}
- Screen-shot Metod
var path = “C:\\Users\\” + ctx.options.userName + “\\Desktop\\” + “name.png”;
ctx.screenshot({ ID: “usr”,
X: 0,
Y: 127,
CX: 1920,
CY: 884,
File: path });
- Embed image as binary to mail body
ctx.base64.encodeStream(ctx.fso.file.read(path, e.file.encoding.Binary));
body_text += ‘<img src=”data:image/png;base64,’ + ctx.base64.encodeStream(ctx.fso.file.read(path, e.file.encoding.Binary))+'”>’;
8.Structure of Excel
- Entry Sheet
Work Flow | Check |
Message Class | X |
Data Element | X |
Adobe Forms | X |
SmartForms | X |
Domain |
- Message
Message Class | Message Number | Source Text | Target Text | Source Lang | Target Lang |
ZMO_TEST | 000 | No data found. | keine Daten gefunden | EN | DE |
ZMO_TEST | 001 | Please choose the company code. | Lütfen şirket kodunu seçin. | EN | TR |
ZMO_TEST | 002 | Tax number is not correct. | Vergi numarasi doğru değil. | EN | TR |
- Data element
Data Element | Source Text | DTEXT(55) | REPTEXT(40) | SCRTEXT_L(40) | SCRTEXT_M(20) | SCRTEXT_S(10) | Source Lang | Target Lang |
ZMO_DE_01 | Name and surname | Adı Soyadı | Adı Soyadı | Adı Soyadı | Adı Soyadı | Ad.Soyad. | enUS | trTR |
ZMO_DE_02 | Adress Information | Adres Bilgileri | Adres Bilgileri | Adres Bilgileri | Adres Bilgileri | Adres Blg | enUS | trTR |
ZMO_DE_03 | Phone Number | Telefon Numarası | Telefon Numarası | Telefon Numarası | Telefon Numarası | Tel.No | enUS | trTR |
- Adobeforms
Adobe Forms Name | Source Text | Target Text | Source Lang | Target Lang |
ZMO_TEST12 | enUS | deDE | ||
ZMO_TEST12 | INVOICE NO | RECHNUNG NR | enUS | deDE |
ZMO_TEST12 | INVOICE DATE | RECHNUNGS DATUM | enUS | deDE |
ZMO_TEST12 | SALES ORDER NO/DATE | VERKAUFSAUFTRAG NR/DATUM | enUS | deDE |
- Smartforms
Smartforms | Source Text | Target Text | Source Lang | Target Lang |
ZMO_DENEME | enUS | trTR | ||
ZMO_DENEME | Plate Number: | Plaka Numarası: | enUS | trTR |
ZMO_DENEME | Region | Bolge | enUS | trTR |
ZMO_DENEME | Waybill Number: | Irsaliye No: | enUS | trTR |
ZMO_DENEME | Region | Bolge | enUS | trTR |
ZMO_DENEME | Amoung of Contrat: | Kontrat Miktarı: | enUS | trTR |
ZMO_DENEME | Material: | Malzeme: | enUS | trTR |
ZMO_DENEME | Driver Name: | Sürücü Adı: | enUS | trTR |
ZMO_DENEME | Date: | Tarih: | enUS | trTR |
ZMO_DENEME | Weighing No: | Tartım No: | enUS | trTR |
ZMO_DENEME | TEL : E-MAIL: | TEL : E-MAIL: | enUS | trTR |
ZMO_DENEME | WEIGHBRIDGE RECEIPT | TARTIM FISI | enUS | trTR |
ZMO_DENEME | Weighbridge No : | Irsaliye No: | enUS | trTR |
ZMO_DENEME | Company Name: | Sirket : | enUS | trTR |
ZMO_DENEME | Amount of Coming: | Gelen Miktar: | enUS | trTR |
ZMO_DENEME | Amount of Remaining: | Kalan Miktar: | enUS | trTR |
ZMO_DENEME | Quality Inspection Lot: | Kalite Muayene Lotu: | enUS | trTR |
ZMO_DENEME | PO number: | Satin Alma No: | enUS | trTR |
ZMO_DENEME | Carrier: | Nakliye | enUS | trTR |
- Request
Request Description | Processing Date | Processor |
06.07.2021 Translation | 6.07.2021 | mokay |
Check out our “Translation in Batch Powered by SAP iRPA” demo to monitor the implementation of the project.