Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata

 

 

Applies to:

SAP ECC 6.0 (Should work in lower versions also)

Summary

Different Methods to fetch the Value Range texts from domain (Mantained at Domain level for single values).

Author(s):  

   
Company:     Enteg Infotech Private Limited
Created on:    12.09.2010
Author(s) Bio
Ravi Andela is a Senior Developer in Enteg Infotech Private Limited, Bangalore.

Using Function Modules

Program

report zravi_0001.
data: lt_diff_values type ddfixvalues,
      ls_diff_val    type ddfixvalue.
start-of-selection.
  call function 'DDIF_FIELDINFO_GET'
       exporting
            tabname      = 'ZSPM_DISP'  " Table Name
            fieldname    = 'STATUS'
            lfieldname   = 'STATUS'
       tables
            fixed_values = lt_diff_values.
  loop at lt_diff_values into  ls_diff_val.
    write:/ ls_diff_val-low, ls_diff_val-ddtext.
  endloop.






Output:

Domain

Other Useful Function Modules

RV_DOMAIN_VALUE_TEXTS - Will return single text for a given value
ISH_DOMAIN_VALUE_TEXTS-- Will return single text for a given value
SXMS_GET_DOMAIN_TEXT-- Will return single text for a given value
BKK_DOMAIN_TEXTS_READ - will return all the texts in a given language
HR_BEN_GET_F4_DOMVAL_AND_TEXT - Gives a pop up to select the value and returns the selected value.

Useful Class / Methods

Class : CL_RECA_DDIC_DOMA

   Methods : GET_COMPLETE, GET_VALUES -  Complete information of Domain.

Using Direct Database SELECT

Tables:  

 The tables are DD07L and DD07T.

 Program:

 REPORT zravi_0002.
TYPES: BEGIN OF ty_values,
          ddtext     TYPE val_text,
          domvalue_l TYPE domvalue_l,
       END OF ty_values.
data: lt_values type STANDARD TABLE OF ty_values,
      wa_values type ty_values.
parameters: domname type domname.
PARAMETERS: langu type sy-langu.
select ddtext
       domvalue_l from dd07t
                  into table lt_values
                  WHERE domname    = domname and
                        ddlanguage = langu   and
                        as4local   = 'A'.
  if sy-subrc = 0.
    loop at lt_values into wa_values.
      write: / wa_values.
    ENDLOOP.
  endif.

Selection Screen:

Output: