Problem solve Get help with specific problems with your technologies, process and projects.

Translation in SAPscript

Here is how to call ABAP programs to translate headings and similar.

Here is how to call ABAP programs to translate headings and similar.
ZNFIXTEXT is a table with codes to text by language.
This way a single-language version is maintained that supports any language requested.
SAPscript...
/*   Text Shells 
/: DEFINE &CUST_TXT&          = 'CUST#'
/: DEFINE &VAT_TXT&           = 'VAT_NUM'
/*   Calculation Shells 
/: PERFORM  FIXED_TEXT IN PROGRAM ZZ_ES_SD_INVOICE
/: USING &NAST-SPRAS&
/: USING &CUST_TXT&
/: USING &VAT_TXT&
/: CHANGING &CUST_TXT&
/: CHANGING &VAT_TXT&
/: ENDPERFORM
abap:
 form fixed_text tables inttab structure itcsy
                        outtab structure itcsy.
   data:   lt_language like sy-langu,
           lt_iso      like t002-laiso,
           ln_tabix    like sy-tabix,
  read table inttab index 1.

  if sy-subrc eq 0.
    lt_iso = inttab-value.
    call function 'LANGUAGE_CODE_ISO_TO_SAP'
         exporting
              iso_code  = lt_iso
         importing
              sap_code  = lt_language
         exceptions
              not_found = 1
              others    = 2.
    if sy-subrc <> 0.
      "do nothing - it will pick up English by default
    endif.
  endif.

  describe table inttab lines ln_lines.
  if ln_lines < 2.
    exit.
  endif.
  loop at inttab from 2.
    read table outtab with key name = inttab-name.
    read table outtab with key name = inttab-name.
    if sy-subrc ne 0.
      continue.
    else.
      ln_tabix = sy-tabix.
    endif.

    perform svs_read_znfixtext using    inttab-value
                                        lt_language
                               changing outtab-value.
    modify outtab index ln_tabix.

  endloop.

endform.                                  " FIXED_TEXT
This was last published in November 2003

Dig Deeper on SAPscript and Smart Forms

PRO+

Content

Find more PRO+ content and other member only offers, here.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchManufacturingERP

SearchOracle

SearchDataManagement

SearchAWS

SearchBusinessAnalytics

SearchCRM

SearchContentManagement

SearchFinancialApplications

Close