"-Begin-----------------------------------------------------------------
  Report zGoogleTranslate.

  "-Type-Pools----------------------------------------------------------
    Type-Pools OLE2.

  "-Variables-----------------------------------------------------------
    Data Text2Translate Type String Value ''.
    Data TranslatedText Type String Value ''.

  "-Main----------------------------------------------------------------
    Text2Translate = 'Ein grünes Auto fährt schnell auf der Strasse.'.
    Write: Text2Translate.
    Perform TranslateByGoogle Using Text2Translate 'de' 'en'
      Changing TranslatedText.
    Write: / TranslatedText.

  "-Function TranslateByGoogle------------------------------------------
    Form TranslateByGoogle Using OriginalText Type String
      LangCodeFrom Type String LangCodeTo Type String
      Changing TranslatedText Type String.

      "-Constants-------------------------------------------------------
        Constants WebSite Type String Value
          'http://translate.google.com'.

      "-Variables-------------------------------------------------------
        Data IE Type OLE2_OBJECT.
        Data IEDoc Type OLE2_OBJECT.
        Data ResBox Type OLE2_OBJECT.
        Data URLTarget Type String Value ''.

        Create Object IE 'InternetExplorer.Application'.
        If IE-Handle > 0.
          Concatenate WebSite '/#' LangCodeFrom '|' LangCodeTo '|'
            OriginalText Into URLTarget.
          Call Method Of IE 'Navigate' Exporting #1 = URLTarget.
          Call Function 'AC_SYSTEM_FLUSH' Exceptions Others = 1.
          If sy-subrc = 0.
            Wait Up To 3 Seconds.
            Get Property Of IE 'Document' = IEDoc.
            If IEDoc-Handle > 0.
              Call Method Of IEDoc 'getElementById' = ResBox
                Exporting #1 = 'result_box'.
              If ResBox-Handle > 0.
                Get Property Of ResBox 'innerText' = TranslatedText.
              EndIf.
            EndIf.
          EndIf.
          Free Object IE.
        EndIf.

    EndForm.

"-End-------------------------------------------------------------------