SAP Function Modules

DDUT_TEXT_FOR_VALUE SAP Function module - DD: Define Text of a Value for an ABAP Dictionary Field







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

Associated Function Group: SDFC
Released Date: 17.05.1999
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM DDUT_TEXT_FOR_VALUE - DDUT TEXT FOR VALUE





CALL FUNCTION 'DDUT_TEXT_FOR_VALUE' "DD: Define Text of a Value for an ABAP Dictionary Field
  EXPORTING
*   tabname =                   " dfies-tabname  Name of Table (or Data Element)
*   fieldname =                 " dfies-lfieldname  Field Name
*   calling_program =           " sy-repid      Call Program Name
*   strucname =                 " c             Name of Suitable Structure in Calling Program
    value =                     "               Value for which Text should be Determined
*   value_is_external = ' '     " ddbool_d      Is Value in External Representation
*   langu = SY-LANGU            " sy-langu      Language Key of Current Text Environment
  IMPORTING
    text =                      " string        Text for VALUE
    not_unique =                " ddbool_d      Text is not Unique
    value_internal =            "               Internal Representation of VALUE
    text_fields =               " dcfielddats   Contents of Data Fields of Text Table
* CHANGING
*   additional_fields =         " dcfielddats   Contents of Further (Foreign) Key Fields
  EXCEPTIONS
    NO_DDIC_FIELD = 1           "               Specified Field has no DDIC Reference
    ILLEGAL_VALUE = 2           "               Value Passed is Illegal
    .  "  DDUT_TEXT_FOR_VALUE

ABAP code example for Function Module DDUT_TEXT_FOR_VALUE





The ABAP code below is a full code listing to execute function module DDUT_TEXT_FOR_VALUE 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_text  TYPE STRING ,
ld_not_unique  TYPE DDBOOL_D ,
ld_value_internal  TYPE STRING ,
ld_text_fields  TYPE DCFIELDDATS .

DATA(ld_additional_fields) = 'Check type of data required'.

DATA(ld_tabname) = some text here

DATA(ld_fieldname) = some text here
DATA(ld_calling_program) = 'Check type of data required'.
DATA(ld_strucname) = 'some text here'.
DATA(ld_value) = 'some text here'.
DATA(ld_value_is_external) = 'some text here'.
DATA(ld_langu) = 'Check type of data required'. . CALL FUNCTION 'DDUT_TEXT_FOR_VALUE' EXPORTING * tabname = ld_tabname * fieldname = ld_fieldname * calling_program = ld_calling_program * strucname = ld_strucname value = ld_value * value_is_external = ld_value_is_external * langu = ld_langu IMPORTING text = ld_text not_unique = ld_not_unique value_internal = ld_value_internal text_fields = ld_text_fields * CHANGING * additional_fields = ld_additional_fields EXCEPTIONS NO_DDIC_FIELD = 1 ILLEGAL_VALUE = 2 . " DDUT_TEXT_FOR_VALUE
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 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_additional_fields  TYPE DCFIELDDATS ,
ld_text  TYPE STRING ,
ld_tabname  TYPE DFIES-TABNAME ,
ld_not_unique  TYPE DDBOOL_D ,
ld_fieldname  TYPE DFIES-LFIELDNAME ,
ld_value_internal  TYPE STRING ,
ld_calling_program  TYPE SY-REPID ,
ld_text_fields  TYPE DCFIELDDATS ,
ld_strucname  TYPE C ,
ld_value  TYPE STRING ,
ld_value_is_external  TYPE DDBOOL_D ,
ld_langu  TYPE SY-LANGU .

ld_additional_fields = 'Check type of data required'.

ld_tabname = some text here

ld_fieldname = some text here
ld_calling_program = 'Check type of data required'.
ld_strucname = 'some text here'.
ld_value = 'some text here'.
ld_value_is_external = 'some text here'.
ld_langu = 'Check type of data required'.

SAP Documentation for FM DDUT_TEXT_FOR_VALUE


This module can be used to define the corresponding text for a value for a field defined in the ABAP Dictionary. The value for which the text ...See here for full SAP fm documentation

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 DDUT_TEXT_FOR_VALUE or its description.