SAP Function Modules

CP_CL_S_TSK_LTEXT_CREATE SAP Function module







CP_CL_S_TSK_LTEXT_CREATE is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name CP_CL_S_TSK_LTEXT_CREATE into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: CPCL_TSK
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM CP_CL_S_TSK_LTEXT_CREATE - CP CL S TSK LTEXT CREATE





CALL FUNCTION 'CP_CL_S_TSK_LTEXT_CREATE' "
  EXPORTING
    i_key_date =                " tsk_class_data-datuv  Valid-From Date
    i_ecn_s =                   " tsk_class_data-aennr  Change Number
    i_plnty =                   " tsk_class_data-plnty
    i_plnnr =                   " tsk_class_data-plnnr  Key for Task List Group
    i_plnal =                   " tsk_class_data-plnal  Group Counter
*   i_language = SY-LANGU       " sy-langu      Current Language
  TABLES
    i_text =                    " tline         SAPscript: Text Lines
  EXCEPTIONS
    NO_VALID_TASK = 1           "
    WRONG_KEY = 2               "
    TEXT_PROCESSING_ABORTED = 3  "
    TASK_NOT_CHANGED = 4        "
    TEXT_ALREADY_EXISTS = 5     "
    .  "  CP_CL_S_TSK_LTEXT_CREATE

ABAP code example for Function Module CP_CL_S_TSK_LTEXT_CREATE





The ABAP code below is a full code listing to execute function module CP_CL_S_TSK_LTEXT_CREATE including all data declarations. The code uses 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 original method of declaring data variables up front. 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).

DATA:
it_i_text  TYPE STANDARD TABLE OF TLINE,"TABLES PARAM
wa_i_text  LIKE LINE OF it_i_text .


DATA(ld_i_key_date) = 20210129

DATA(ld_i_ecn_s) = some text here

DATA(ld_i_plnty) = some text here

DATA(ld_i_plnnr) = some text here

DATA(ld_i_plnal) = some text here
DATA(ld_i_language) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_i_text to it_i_text. . CALL FUNCTION 'CP_CL_S_TSK_LTEXT_CREATE' EXPORTING i_key_date = ld_i_key_date i_ecn_s = ld_i_ecn_s i_plnty = ld_i_plnty i_plnnr = ld_i_plnnr i_plnal = ld_i_plnal * i_language = ld_i_language TABLES i_text = it_i_text EXCEPTIONS NO_VALID_TASK = 1 WRONG_KEY = 2 TEXT_PROCESSING_ABORTED = 3 TASK_NOT_CHANGED = 4 TEXT_ALREADY_EXISTS = 5 . " CP_CL_S_TSK_LTEXT_CREATE
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 5. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_i_key_date  TYPE TSK_CLASS_DATA-DATUV ,
it_i_text  TYPE STANDARD TABLE OF TLINE ,
wa_i_text  LIKE LINE OF it_i_text,
ld_i_ecn_s  TYPE TSK_CLASS_DATA-AENNR ,
ld_i_plnty  TYPE TSK_CLASS_DATA-PLNTY ,
ld_i_plnnr  TYPE TSK_CLASS_DATA-PLNNR ,
ld_i_plnal  TYPE TSK_CLASS_DATA-PLNAL ,
ld_i_language  TYPE SY-LANGU .


ld_i_key_date = 20210129

"populate fields of struture and append to itab
append wa_i_text to it_i_text.

ld_i_ecn_s = some text here

ld_i_plnty = some text here

ld_i_plnnr = some text here

ld_i_plnal = some text here
ld_i_language = 'Check type of data required'.

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name CP_CL_S_TSK_LTEXT_CREATE or its description.