SAP CN_TX_TEXT_PRINT Function Module for NOTRANSL: PS: Text lesen und Drucken









CN_TX_TEXT_PRINT is a standard cn tx text print SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for NOTRANSL: PS: Text lesen und Drucken 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 cn tx text print FM, simply by entering the name CN_TX_TEXT_PRINT into the relevant SAP transaction such as SE37 or SE38.

Function Group: CNTX
Program Name: SAPLCNTX
Main Program: SAPLCNTX
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function CN_TX_TEXT_PRINT 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 'CN_TX_TEXT_PRINT'"NOTRANSL: PS: Text lesen und Drucken
EXPORTING
* ASK_PRINT_OPTIONS = FLGX "X=dialog for print options / space= continue printing
* HEADERTEXT = ' ' "optional text, is added at the beginning of the text
* FORMAT = ' ' "Text Form.
* LANGUAGE = SY-LANGU "Language key
NAME = "Text name
* OBJECT = TEXTOB "Texts: Application Object
* TDID = TEXTID "Text ID

IMPORTING
PAGES = "No. of pages output
SPOOLID = "Spool request identifier
.



IMPORTING Parameters details for CN_TX_TEXT_PRINT

ASK_PRINT_OPTIONS - X=dialog for print options / space= continue printing

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

HEADERTEXT - optional text, is added at the beginning of the text

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

FORMAT - Text Form.

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

LANGUAGE - Language key

Data type: THEAD-TDSPRAS
Default: SY-LANGU
Optional: Yes
Call by Reference: No ( called with pass by value option)

NAME - Text name

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

OBJECT - Texts: Application Object

Data type: THEAD-TDOBJECT
Default: TEXTOB
Optional: Yes
Call by Reference: No ( called with pass by value option)

TDID - Text ID

Data type: THEAD-TDID
Default: TEXTID
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for CN_TX_TEXT_PRINT

PAGES - No. of pages output

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

SPOOLID - Spool request identifier

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

Copy and paste ABAP code example for CN_TX_TEXT_PRINT 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_pages  TYPE ITCPP-TDPAGES, "   
lv_ask_print_options  TYPE C, "   FLGX
lv_spoolid  TYPE ITCPP-TDSPOOLID, "   
lv_headertext  TYPE STXH-TDTITLE, "   SPACE
lv_format  TYPE PSTX-PSFORMAT, "   SPACE
lv_language  TYPE THEAD-TDSPRAS, "   SY-LANGU
lv_name  TYPE THEAD-TDNAME, "   
lv_object  TYPE THEAD-TDOBJECT, "   TEXTOB
lv_tdid  TYPE THEAD-TDID. "   TEXTID

  CALL FUNCTION 'CN_TX_TEXT_PRINT'  "NOTRANSL: PS: Text lesen und Drucken
    EXPORTING
         ASK_PRINT_OPTIONS = lv_ask_print_options
         HEADERTEXT = lv_headertext
         FORMAT = lv_format
         LANGUAGE = lv_language
         NAME = lv_name
         OBJECT = lv_object
         TDID = lv_tdid
    IMPORTING
         PAGES = lv_pages
         SPOOLID = lv_spoolid
. " CN_TX_TEXT_PRINT




ABAP code using 7.40 inline data declarations to call FM CN_TX_TEXT_PRINT

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 TDPAGES FROM ITCPP INTO @DATA(ld_pages).
 
DATA(ld_ask_print_options) = FLGX.
 
"SELECT single TDSPOOLID FROM ITCPP INTO @DATA(ld_spoolid).
 
"SELECT single TDTITLE FROM STXH INTO @DATA(ld_headertext).
DATA(ld_headertext) = ' '.
 
"SELECT single PSFORMAT FROM PSTX INTO @DATA(ld_format).
DATA(ld_format) = ' '.
 
"SELECT single TDSPRAS FROM THEAD INTO @DATA(ld_language).
DATA(ld_language) = SY-LANGU.
 
"SELECT single TDNAME FROM THEAD INTO @DATA(ld_name).
 
"SELECT single TDOBJECT FROM THEAD INTO @DATA(ld_object).
DATA(ld_object) = TEXTOB.
 
"SELECT single TDID FROM THEAD INTO @DATA(ld_tdid).
DATA(ld_tdid) = TEXTID.
 


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!