SAP CONVERT_ITF_TO_HTML Function Module for Text Conversion of the Internal SAPscript Format (ITF) to HTML









CONVERT_ITF_TO_HTML is a standard convert itf to html SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Text Conversion of the Internal SAPscript Format (ITF) to HTML processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.


See here to view full function module documentation and code listing for convert itf to html FM, simply by entering the name CONVERT_ITF_TO_HTML into the relevant SAP transaction such as SE37 or SE38.

Function Group: STXN
Program Name: SAPLSTXN
Main Program: SAPLSTXN
Appliation area: S
Release date: 29-Jan-1998
Mode(Normal, Remote etc): Normal Function Module
Update:



Function CONVERT_ITF_TO_HTML pattern details

In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.
CALL FUNCTION 'CONVERT_ITF_TO_HTML'"Text Conversion of the Internal SAPscript Format (ITF) to HTML
EXPORTING
* I_CODEPAGE = "Target character set
* I_TITLE = ' ' "Title in HTML header
* I_BACKGROUND = ' ' "File name for HTML image as background
* I_BGCOLOR = ' ' "Background color of text
* I_UNESCAPE_FORMATS = "Exception Formats for Masking Special Characters
* I_ESCAPE_' 'S = ' ' "Masking of Blank Characters
* I_ENCODING = ' ' "Define Character Set Coding in Header
I_HEADER = "Text header of input text
* I_PAGE = ' ' "Page specification for page window format
* I_WINDOW = ' ' "Window specification for page window format
* I_SYNTAX_CHECK = ' ' "Activating the ITF syntax check
* I_REPLACE = 'X' "Expanding symbols and includes
* I_PRINT_COMMANDS = ' ' "Outputting commands and text elements
* I_HTML_HEADER = 'X' "Output of the HTML header tag
* I_FUNCNAME = ' ' "Exit module for link interpretation

IMPORTING
E_HTML_TEXT = "Text Content in HTML as Xstring

TABLES
T_ITF_TEXT = "Text lines in ITF (input)
T_HTML_TEXT = "Text lines in HTML (output)
* T_CONV_CHARFORMATS = "Table for character formats
* T_CONV_PARFORMATS = "Table for paragraph formats

EXCEPTIONS
SYNTAX_CHECK = 1 REPLACE = 2 ILLEGAL_HEADER = 3
.



IMPORTING Parameters details for CONVERT_ITF_TO_HTML

I_CODEPAGE - Target character set

Data type: TCP02-CPCODEPAGE
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_TITLE - Title in HTML header

Data type: C
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_BACKGROUND - File name for HTML image as background

Data type: C
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_BGCOLOR - Background color of text

Data type: C
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_UNESCAPE_FORMATS - Exception Formats for Masking Special Characters

Data type: TEDFORMAT
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_ESCAPE_SPACES - Masking of Blank Characters

Data type: C
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_ENCODING - Define Character Set Coding in Header

Data type: C
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_HEADER - Text header of input text

Data type: THEAD
Optional: No
Call by Reference: No ( called with pass by value option)

I_PAGE - Page specification for page window format

Data type: ITCTH-TDPAGE
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_WINDOW - Window specification for page window format

Data type: ITCTH-TDWINDOW
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_SYNTAX_CHECK - Activating the ITF syntax check

Data type: C
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_REPLACE - Expanding symbols and includes

Data type: C
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_PRINT_COMMANDS - Outputting commands and text elements

Data type: C
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_HTML_HEADER - Output of the HTML header tag

Data type: C
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_FUNCNAME - Exit module for link interpretation

Data type: TFDIR-FUNCNAME
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for CONVERT_ITF_TO_HTML

E_HTML_TEXT - Text Content in HTML as Xstring

Data type: XSTRING
Optional: No
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for CONVERT_ITF_TO_HTML

T_ITF_TEXT - Text lines in ITF (input)

Data type: TLINE
Optional: No
Call by Reference: No ( called with pass by value option)

T_HTML_TEXT - Text lines in HTML (output)

Data type: HTMLLINE
Optional: No
Call by Reference: No ( called with pass by value option)

T_CONV_CHARFORMATS - Table for character formats

Data type: TLINE
Optional: Yes
Call by Reference: No ( called with pass by value option)

T_CONV_PARFORMATS - Table for paragraph formats

Data type: TLINE
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

SYNTAX_CHECK - Incorrect inout text ITF syntax

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

REPLACE - Errors expanding includes and symbols

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

ILLEGAL_HEADER - Text header incorrect

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for CONVERT_ITF_TO_HTML Function Module

The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.

DATA:
lv_i_codepage  TYPE TCP02-CPCODEPAGE, "   
lt_t_itf_text  TYPE STANDARD TABLE OF TLINE, "   
lv_e_html_text  TYPE XSTRING, "   
lv_syntax_check  TYPE XSTRING, "   
lv_i_title  TYPE C, "   SPACE
lv_i_background  TYPE C, "   SPACE
lv_i_bgcolor  TYPE C, "   SPACE
lv_i_unescape_formats  TYPE TEDFORMAT, "   
lv_i_escape_spaces  TYPE C, "   SPACE
lv_i_encoding  TYPE C, "   SPACE
lv_replace  TYPE C, "   
lv_i_header  TYPE THEAD, "   
lt_t_html_text  TYPE STANDARD TABLE OF HTMLLINE, "   
lv_i_page  TYPE ITCTH-TDPAGE, "   SPACE
lv_illegal_header  TYPE ITCTH, "   
lt_t_conv_charformats  TYPE STANDARD TABLE OF TLINE, "   
lv_i_window  TYPE ITCTH-TDWINDOW, "   SPACE
lt_t_conv_parformats  TYPE STANDARD TABLE OF TLINE, "   
lv_i_syntax_check  TYPE C, "   SPACE
lv_i_replace  TYPE C, "   'X'
lv_i_print_commands  TYPE C, "   SPACE
lv_i_html_header  TYPE C, "   'X'
lv_i_funcname  TYPE TFDIR-FUNCNAME. "   SPACE

  CALL FUNCTION 'CONVERT_ITF_TO_HTML'  "Text Conversion of the Internal SAPscript Format (ITF) to HTML
    EXPORTING
         I_CODEPAGE = lv_i_codepage
         I_TITLE = lv_i_title
         I_BACKGROUND = lv_i_background
         I_BGCOLOR = lv_i_bgcolor
         I_UNESCAPE_FORMATS = lv_i_unescape_formats
         I_ESCAPE_SPACES = lv_i_escape_spaces
         I_ENCODING = lv_i_encoding
         I_HEADER = lv_i_header
         I_PAGE = lv_i_page
         I_WINDOW = lv_i_window
         I_SYNTAX_CHECK = lv_i_syntax_check
         I_REPLACE = lv_i_replace
         I_PRINT_COMMANDS = lv_i_print_commands
         I_HTML_HEADER = lv_i_html_header
         I_FUNCNAME = lv_i_funcname
    IMPORTING
         E_HTML_TEXT = lv_e_html_text
    TABLES
         T_ITF_TEXT = lt_t_itf_text
         T_HTML_TEXT = lt_t_html_text
         T_CONV_CHARFORMATS = lt_t_conv_charformats
         T_CONV_PARFORMATS = lt_t_conv_parformats
    EXCEPTIONS
        SYNTAX_CHECK = 1
        REPLACE = 2
        ILLEGAL_HEADER = 3
. " CONVERT_ITF_TO_HTML




ABAP code using 7.40 inline data declarations to call FM CONVERT_ITF_TO_HTML

The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.

"SELECT single CPCODEPAGE FROM TCP02 INTO @DATA(ld_i_codepage).
 
 
 
 
DATA(ld_i_title) = ' '.
 
DATA(ld_i_background) = ' '.
 
DATA(ld_i_bgcolor) = ' '.
 
 
DATA(ld_i_escape_spaces) = ' '.
 
DATA(ld_i_encoding) = ' '.
 
 
 
 
"SELECT single TDPAGE FROM ITCTH INTO @DATA(ld_i_page).
DATA(ld_i_page) = ' '.
 
 
 
"SELECT single TDWINDOW FROM ITCTH INTO @DATA(ld_i_window).
DATA(ld_i_window) = ' '.
 
 
DATA(ld_i_syntax_check) = ' '.
 
DATA(ld_i_replace) = 'X'.
 
DATA(ld_i_print_commands) = ' '.
 
DATA(ld_i_html_header) = 'X'.
 
"SELECT single FUNCNAME FROM TFDIR INTO @DATA(ld_i_funcname).
DATA(ld_i_funcname) = ' '.
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!