Batch Translation with SAP RPA – Workflow

Share

The translation process of ABAP objects has always been a software developer’s nightmare because only primitive methods were available. The project steps below show the automation of translating ABAP objects with the SAP RPA product.

1.Introduction

SAP RPA is very simple to use. The RPA process is carried out by matching the translation information from the uploaded excel file with ABAP objects. After the process is complete, the request (via ‘SLXT’ transaction code) containing the translated objects is created by RPA. The bot also takes a screenshot of the request and sends an e-mail to the user.

2.Usage Areas

  • Roll-out Projects
  • The need for translation into more than one language of a newly written/untranslated product
  • Easy translation of many untranslated Z objects in the ABAP dictionary

3.Advantages

  • 50% saving on the time spent on translation
  • Minimizing user-based translation errors
  • Reduced translation effort (80%)
  • Translation into multiple languages

4.ABAP Objects

  • ABAP Objects already included
    • Data Element
    • Message Class
    • Smartforms
    • AdobeForms
  • ABAP Objects that can be added
    • Domain
    • Structure
    • Table
    • Table Type
    • Menu Area
    • Reports (with screens)
  • ABAP Objects that are not suitable
    • Text Tables

5.Detailed RPA Usage Steps

  • A separate workflow is created for each ABAP object in the project.
  • The workflows created are called by one MAIN workflow.
  • We can specify which workflow RPA will call in the ‘Entry Sheet’ section in excel.
  • RPA reads the ABAP Objects’ (e.g., Data Element) information such as object name and translation language from separately created ‘Sheets’.
  • 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, and the request name that 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: Because the translation interface of ABAP objects, such as ‘Message, Data Element, Domain, Reports’, is almost the same then a dynamic programming method can also be used by defining a general ‘Criteria’.

5.1.Workflow

Figure 1: Process Diagrams
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 many times as the number of rows of translation information in the Excel file.
  • Data element object information is entered.
  • The fields to be translated are matched 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 many times as the number of rows of translation information in the Excel file.
  • Original Language and Target Language; this is entered by following steps Go to->Translation
  • Translation is finished.
5.1.3.Smartforms
  • Go to transaction code SE63
  • Click Other Text. (The loop should start here. It is also possible to start the loop on SSF interface by using keystroke F3 command)
  • Smartforms information in the excel file is filtered by the bot. Smartforms information is appended to the internal table using the method Deep Structure. The loop count is determined by the length of the Deep Structure.
  • The SSF object is found by clicking the search button.
  • Smartforms object information is entered in the SSF interface.
  • It will appear in two GUI Containers. The 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 the original structure of the Smartforms.
  • The texts of Paragraph type which do not start with ‘/’ in the Bottom Container are compared with the data in the excel file and the translations are made line by line.
  • After the bot completes the translation process click the ‘Save and Active’ button.
5.1.4.Adobeforms
  • Go to transaction code SE63.
  • Click Other Text. (The loop should start here. It is also possible to start the loop on the PDFB interface by using keystroke F3 command)
  • Adobeforms information in the excel file is filtered by the bot. Adobeforms informations is appended to the internal table using the method Deep Structure. The loop count is determined by the length of the Deep Structure.
  • It will appear in two GUI Containers. The container at the top is the original structure of the object. The original structure of the object is copied by clicking Copy Source Text (SHIFT F8).
  • The data in 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 the path we have set (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.
Figure 2: A section from the Main workflow

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 FlowCheck
Message ClassX
Data ElementX
Adobe FormsX
SmartFormsX
Domain
  • Message
Message ClassMessage NumberSource TextTarget TextSource LangTarget Lang
ZMO_TEST000No data found.keine Daten gefundenENDE
ZMO_TEST001Please choose the company code.Lütfen şirket kodunu seçin.ENTR
ZMO_TEST002Tax number is not correct.Vergi numarasi doğru değil.ENTR
  • Data element
Data ElementSource TextDTEXT(55)REPTEXT(40)SCRTEXT_L(40)SCRTEXT_M(20)SCRTEXT_S(10)Source LangTarget Lang
ZMO_DE_01Name and surnameAdı SoyadıAdı SoyadıAdı SoyadıAdı SoyadıAd.Soyad.enUStrTR
ZMO_DE_02Adress InformationAdres BilgileriAdres BilgileriAdres BilgileriAdres BilgileriAdres BlgenUStrTR
ZMO_DE_03Phone NumberTelefon NumarasıTelefon NumarasıTelefon NumarasıTelefon NumarasıTel.NoenUStrTR
  • Adobeforms
Adobe Forms NameSource TextTarget TextSource LangTarget Lang
ZMO_TEST12enUSdeDE
ZMO_TEST12INVOICE NORECHNUNG NRenUSdeDE
ZMO_TEST12INVOICE DATERECHNUNGS DATUMenUSdeDE
ZMO_TEST12SALES ORDER NO/DATEVERKAUFSAUFTRAG NR/DATUMenUSdeDE
  • Smartforms
SmartformsSource TextTarget TextSource LangTarget Lang
ZMO_DENEMEenUStrTR
ZMO_DENEMEPlate Number:Plaka Numarası:enUStrTR
ZMO_DENEMERegionBolgeenUStrTR
ZMO_DENEMEWaybill Number:Irsaliye No:enUStrTR
ZMO_DENEMERegionBolgeenUStrTR
ZMO_DENEMEAmoung of Contrat:Kontrat Miktarı:enUStrTR
ZMO_DENEMEMaterial:Malzeme:enUStrTR
ZMO_DENEMEDriver Name:Sürücü Adı:enUStrTR
ZMO_DENEMEDate:Tarih:enUStrTR
ZMO_DENEMEWeighing No:Tartım No:enUStrTR
ZMO_DENEMETEL :    E-MAIL:TEL :    E-MAIL:enUStrTR
ZMO_DENEMEWEIGHBRIDGE RECEIPTTARTIM FISIenUStrTR
ZMO_DENEMEWeighbridge No :Irsaliye No:enUStrTR
ZMO_DENEMECompany Name:Sirket :enUStrTR
ZMO_DENEMEAmount of Coming:Gelen Miktar:enUStrTR
ZMO_DENEMEAmount of Remaining:Kalan Miktar:enUStrTR
ZMO_DENEMEQuality Inspection Lot:Kalite Muayene Lotu:enUStrTR
ZMO_DENEME PO number:Satin Alma No:enUStrTR
ZMO_DENEMECarrier:NakliyeenUStrTR
  • Request
Request DescriptionProcessing DateProcessor
06.07.2021 Translation6.07.2021mokay

Check out our “Translation in Batch Powered by SAP iRPA” demo to see the implementation of this project.

Supporting your business processes with emerging technologies is the main goal of our business.

exp head deco 3
icon our expertise

Thank you

You’ll receive an email with download link shortly.

If not, reach us on solviamarketing@solviads.com

Created by icon 54from the Noun Project

Thank you

You’ll receive an email shortly.

If not, reach us on solviamarketing@solviads.com