SAP Function Modules

CTCV_SYNTAX_CHECK SAP Function module - Syntax Check on Strings







CTCV_SYNTAX_CHECK 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 CTCV_SYNTAX_CHECK into the relevant SAP transaction such as SE37 or SE80.

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


Pattern for FM CTCV_SYNTAX_CHECK - CTCV SYNTAX CHECK





CALL FUNCTION 'CTCV_SYNTAX_CHECK' "Syntax Check on Strings
  EXPORTING
    attribut =                  "               Characteristic name
*   baseunit = SPACE            "               Base unit
*   decimals = 0                "               Number of decimal places
*   dec_presentation = ','      "
*   exponent = SPACE            "
*   exponent_art = '0'          "
*   format = 'CHAR'             "               Format (data type)
*   interval = SPACE            "               Intervals allowed
*   language = SY-LANGU         "               Language
*   length = 0                  "               Number of characters
*   lowercase = SPACE           "
*   mask = SPACE                "               Template
*   mask_allowed = ' '          "
*   negativ = SPACE             "
*   screen_name = SPACE         "               Name of the I/O field on the Scree
*   single_selection = SPACE    "               Only individual value allowed
    string =                    "               String to be checked (step by step)
*   value_seperator = ';'       "
*   classtype = SPACE           " tcla-klart
*   t_separator = ' '           "
*   err_name =                  " atbez         Characteristic description
  IMPORTING
    string_is_masked =          "
  TABLES
    tstrg =                     " strg
  EXCEPTIONS
    CURRENCY_CHECK = 1          "               Error in currency specification
    DATE_CHECK = 2              "               Error when entering the date
    FORMAT_CHECK = 3            "               Format error
    ILLEGAL_INTERNAL_BASEUNIT = 4  "            Invalid base unit of measure
    INTERVAL_CHECK = 5          "               Error in interval specification
    PATTERN_CHECK = 6           "               Inconsistency regarding defined template
    TIME_CHECK = 7              "               Error in line specification
    UNIT_CHECK = 8              "               Error in one of the unit specifications
    NO_VALID_DIMENSION = 9      "
    INTERVAL_NOT_ALLOWED = 10   "
    PRESENTATION_NOT_POSSIBLE = 11  "
    .  "  CTCV_SYNTAX_CHECK

ABAP code example for Function Module CTCV_SYNTAX_CHECK





The ABAP code below is a full code listing to execute function module CTCV_SYNTAX_CHECK 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:
ld_string_is_masked  TYPE STRING ,
it_tstrg  TYPE STANDARD TABLE OF STRG,"TABLES PARAM
wa_tstrg  LIKE LINE OF it_tstrg .

DATA(ld_attribut) = 'some text here'.
DATA(ld_baseunit) = 'some text here'.
DATA(ld_decimals) = 'some text here'.
DATA(ld_dec_presentation) = 'some text here'.
DATA(ld_exponent) = 'some text here'.
DATA(ld_exponent_art) = 'some text here'.
DATA(ld_format) = 'some text here'.
DATA(ld_interval) = 'some text here'.
DATA(ld_language) = 'some text here'.
DATA(ld_length) = 'some text here'.
DATA(ld_lowercase) = 'some text here'.
DATA(ld_mask) = 'some text here'.
DATA(ld_mask_allowed) = 'some text here'.
DATA(ld_negativ) = 'some text here'.
DATA(ld_screen_name) = 'some text here'.
DATA(ld_single_selection) = 'some text here'.
DATA(ld_string) = 'some text here'.
DATA(ld_value_seperator) = 'some text here'.

SELECT single KLART
FROM TCLA
INTO @DATA(ld_classtype).

DATA(ld_t_separator) = 'some text here'.
DATA(ld_err_name) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_tstrg to it_tstrg. . CALL FUNCTION 'CTCV_SYNTAX_CHECK' EXPORTING attribut = ld_attribut * baseunit = ld_baseunit * decimals = ld_decimals * dec_presentation = ld_dec_presentation * exponent = ld_exponent * exponent_art = ld_exponent_art * format = ld_format * interval = ld_interval * language = ld_language * length = ld_length * lowercase = ld_lowercase * mask = ld_mask * mask_allowed = ld_mask_allowed * negativ = ld_negativ * screen_name = ld_screen_name * single_selection = ld_single_selection string = ld_string * value_seperator = ld_value_seperator * classtype = ld_classtype * t_separator = ld_t_separator * err_name = ld_err_name IMPORTING string_is_masked = ld_string_is_masked TABLES tstrg = it_tstrg EXCEPTIONS CURRENCY_CHECK = 1 DATE_CHECK = 2 FORMAT_CHECK = 3 ILLEGAL_INTERNAL_BASEUNIT = 4 INTERVAL_CHECK = 5 PATTERN_CHECK = 6 TIME_CHECK = 7 UNIT_CHECK = 8 NO_VALID_DIMENSION = 9 INTERVAL_NOT_ALLOWED = 10 PRESENTATION_NOT_POSSIBLE = 11 . " CTCV_SYNTAX_CHECK
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 ELSEIF SY-SUBRC EQ 6. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 7. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 8. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 9. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 10. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 11. "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_string_is_masked  TYPE STRING ,
ld_attribut  TYPE STRING ,
it_tstrg  TYPE STANDARD TABLE OF STRG ,
wa_tstrg  LIKE LINE OF it_tstrg,
ld_baseunit  TYPE STRING ,
ld_decimals  TYPE STRING ,
ld_dec_presentation  TYPE STRING ,
ld_exponent  TYPE STRING ,
ld_exponent_art  TYPE STRING ,
ld_format  TYPE STRING ,
ld_interval  TYPE STRING ,
ld_language  TYPE STRING ,
ld_length  TYPE STRING ,
ld_lowercase  TYPE STRING ,
ld_mask  TYPE STRING ,
ld_mask_allowed  TYPE STRING ,
ld_negativ  TYPE STRING ,
ld_screen_name  TYPE STRING ,
ld_single_selection  TYPE STRING ,
ld_string  TYPE STRING ,
ld_value_seperator  TYPE STRING ,
ld_classtype  TYPE TCLA-KLART ,
ld_t_separator  TYPE STRING ,
ld_err_name  TYPE ATBEZ .

ld_attribut = 'some text here'.

"populate fields of struture and append to itab
append wa_tstrg to it_tstrg.
ld_baseunit = 'some text here'.
ld_decimals = 'some text here'.
ld_dec_presentation = 'some text here'.
ld_exponent = 'some text here'.
ld_exponent_art = 'some text here'.
ld_format = 'some text here'.
ld_interval = 'some text here'.
ld_language = 'some text here'.
ld_length = 'some text here'.
ld_lowercase = 'some text here'.
ld_mask = 'some text here'.
ld_mask_allowed = 'some text here'.
ld_negativ = 'some text here'.
ld_screen_name = 'some text here'.
ld_single_selection = 'some text here'.
ld_string = 'some text here'.
ld_value_seperator = 'some text here'.

SELECT single KLART
FROM TCLA
INTO ld_classtype.

ld_t_separator = 'some text here'.
ld_err_name = '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 CTCV_SYNTAX_CHECK or its description.