SAP CTCV_PREPARE_VALUES_TO_DISPLAY Function Module for Display Format for Values









CTCV_PREPARE_VALUES_TO_DISPLAY is a standard ctcv prepare values to display SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Display Format for Values 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 ctcv prepare values to display FM, simply by entering the name CTCV_PREPARE_VALUES_TO_DISPLAY into the relevant SAP transaction such as SE37 or SE38.

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



Function CTCV_PREPARE_VALUES_TO_DISPLAY 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 'CTCV_PREPARE_VALUES_TO_DISPLAY'"Display Format for Values
EXPORTING
* ALIGN = 'NO' "Value is aligned according to template
STRUCTURE_CAWN = "Value structure
* WITHOUT_EDIT_MASK = ' ' "without transferred format indicator
* LANGUAGE = SY-LANGU "Language
* CLASSTYPE = ' ' "Class Type
* T_SEPARATOR = ' ' "
* WITH_CHECK = ' ' "
* CONDENSE = 'NO' "Value is edited without blanks
* DECIMALPOINT = ' ' "Valency of decimal point
* SHIFT = 'LEFT' "Value is left-aligned and/or right-aligned
* SINGLE = 'NO' "Only one value is formatted
* STRING_WITHOUT_OPERAND = 'NO' "String format without operands
* STRING_WITHOUT_UNIT = 'NO' "String format without unit
* STRING_WITH_BASEUNIT = 'NO' "String format with base unit
STRUCTURE_CABN = "Characteristic overview

IMPORTING
OPERAND1 = "Operand 'from' value
OPERAND2 = "Operand 'to' value
STRING = "Field containing the formatted value
STRING1 = "'From' value without operand and unit
STRING2 = "'To' value without operand and unit
UNIT = "Unit
UNIT2 = "Unit of 'to' value
STRING_LONG = "
STRING_TOO_LONG = "

EXCEPTIONS
OVERFLOW = 1 EXP_OVERFLOW = 2 UNIT_NOT_FOUND = 3 REPRESENTATION_NOT_POSSIBLE = 4
.



IMPORTING Parameters details for CTCV_PREPARE_VALUES_TO_DISPLAY

ALIGN - Value is aligned according to template

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

STRUCTURE_CAWN - Value structure

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

WITHOUT_EDIT_MASK - without transferred format indicator

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

LANGUAGE - Language

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

CLASSTYPE - Class Type

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

T_SEPARATOR -

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

WITH_CHECK -

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

CONDENSE - Value is edited without blanks

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

DECIMALPOINT - Valency of decimal point

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

SHIFT - Value is left-aligned and/or right-aligned

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

SINGLE - Only one value is formatted

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

STRING_WITHOUT_OPERAND - String format without operands

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

STRING_WITHOUT_UNIT - String format without unit

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

STRING_WITH_BASEUNIT - String format with base unit

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

STRUCTURE_CABN - Characteristic overview

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

EXPORTING Parameters details for CTCV_PREPARE_VALUES_TO_DISPLAY

OPERAND1 - Operand 'from' value

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

OPERAND2 - Operand 'to' value

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

STRING - Field containing the formatted value

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

STRING1 - 'From' value without operand and unit

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

STRING2 - 'To' value without operand and unit

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

UNIT - Unit

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

UNIT2 - Unit of 'to' value

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

STRING_LONG -

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

STRING_TOO_LONG -

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

EXCEPTIONS details

OVERFLOW - A field overflow was found

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

EXP_OVERFLOW -

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

UNIT_NOT_FOUND -

Data type:
Optional: No
Call by Reference: Yes

REPRESENTATION_NOT_POSSIBLE -

Data type:
Optional: No
Call by Reference: Yes

Copy and paste ABAP code example for CTCV_PREPARE_VALUES_TO_DISPLAY 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_align  TYPE STRING, "   'NO'
lv_operand1  TYPE STRING, "   
lv_overflow  TYPE STRING, "   
lv_structure_cawn  TYPE CAWN, "   
lv_without_edit_mask  TYPE CAWN, "   SPACE
lv_language  TYPE CABNT-SPRAS, "   SY-LANGU
lv_classtype  TYPE TCLA-KLART, "   SPACE
lv_t_separator  TYPE TCLA, "   ' '
lv_with_check  TYPE TCLA, "   ' '
lv_condense  TYPE TCLA, "   'NO'
lv_operand2  TYPE TCLA, "   
lv_exp_overflow  TYPE TCLA, "   
lv_string  TYPE CAWN-ATWRT, "   
lv_decimalpoint  TYPE CAWN, "   ' '
lv_unit_not_found  TYPE CAWN, "   
lv_shift  TYPE CAWN, "   'LEFT'
lv_string1  TYPE CAWN, "   
lv_representation_not_possible  TYPE CAWN, "   
lv_single  TYPE CAWN, "   'NO'
lv_string2  TYPE CAWN, "   
lv_unit  TYPE CAWN, "   
lv_string_without_operand  TYPE CAWN, "   'NO'
lv_unit2  TYPE CAWN, "   
lv_string_without_unit  TYPE CAWN, "   'NO'
lv_string_long  TYPE CAWN, "   
lv_string_with_baseunit  TYPE CAWN, "   'NO'
lv_structure_cabn  TYPE CABN, "   
lv_string_too_long  TYPE CABN. "   

  CALL FUNCTION 'CTCV_PREPARE_VALUES_TO_DISPLAY'  "Display Format for Values
    EXPORTING
         ALIGN = lv_align
         STRUCTURE_CAWN = lv_structure_cawn
         WITHOUT_EDIT_MASK = lv_without_edit_mask
         LANGUAGE = lv_language
         CLASSTYPE = lv_classtype
         T_SEPARATOR = lv_t_separator
         WITH_CHECK = lv_with_check
         CONDENSE = lv_condense
         DECIMALPOINT = lv_decimalpoint
         SHIFT = lv_shift
         SINGLE = lv_single
         STRING_WITHOUT_OPERAND = lv_string_without_operand
         STRING_WITHOUT_UNIT = lv_string_without_unit
         STRING_WITH_BASEUNIT = lv_string_with_baseunit
         STRUCTURE_CABN = lv_structure_cabn
    IMPORTING
         OPERAND1 = lv_operand1
         OPERAND2 = lv_operand2
         STRING = lv_string
         STRING1 = lv_string1
         STRING2 = lv_string2
         UNIT = lv_unit
         UNIT2 = lv_unit2
         STRING_LONG = lv_string_long
         STRING_TOO_LONG = lv_string_too_long
    EXCEPTIONS
        OVERFLOW = 1
        EXP_OVERFLOW = 2
        UNIT_NOT_FOUND = 3
        REPRESENTATION_NOT_POSSIBLE = 4
. " CTCV_PREPARE_VALUES_TO_DISPLAY




ABAP code using 7.40 inline data declarations to call FM CTCV_PREPARE_VALUES_TO_DISPLAY

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.

DATA(ld_align) = 'NO'.
 
 
 
 
DATA(ld_without_edit_mask) = ' '.
 
"SELECT single SPRAS FROM CABNT INTO @DATA(ld_language).
DATA(ld_language) = SY-LANGU.
 
"SELECT single KLART FROM TCLA INTO @DATA(ld_classtype).
DATA(ld_classtype) = ' '.
 
DATA(ld_t_separator) = ' '.
 
DATA(ld_with_check) = ' '.
 
DATA(ld_condense) = 'NO'.
 
 
 
"SELECT single ATWRT FROM CAWN INTO @DATA(ld_string).
 
DATA(ld_decimalpoint) = ' '.
 
 
DATA(ld_shift) = 'LEFT'.
 
 
 
DATA(ld_single) = 'NO'.
 
 
 
DATA(ld_string_without_operand) = 'NO'.
 
 
DATA(ld_string_without_unit) = 'NO'.
 
 
DATA(ld_string_with_baseunit) = 'NO'.
 
 
 


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!