Retrieving Domain fixed values

By Bhumika Mahawar, YASH Technologies

The F4 for screen field can be fetched either through value table, explicit F4 help or through fixed values associated with the domain. 

Sometimes there might be a requirement to fetch the fixed values associated with a domain. Database view “DD07V” contains this information along with the text maintained for these fixed value. To fetch these values we have a simple Function Module “DD_DOMA_GET”. There are other FM’s as well. However the advantage of using this FM is that unlike other FM’s you have the option to fetch the text as and when required. 

As the following fig shows, the fixed value for the domain XFELD are:-

 

The code is as follows:- 

*&-------------------------------------------------------
*& Report ZTEST_GETDOMVAL
*&------------------------------------------------------- *This report is used to fetch the fixed values associated with domain
*&--------------------------------------------------------

REPORT  ztest_yh1148.

DATA:
  fs_taba 
TYPE dd07v.
DATA:
it_taba 
TYPE STANDARD TABLE OF dd07v,
it_tabb 
TYPE STANDARD TABLE OF dd07v.

CALL FUNCTION 'DD_DOMA_GET'
  
EXPORTING
    domain_name   = 
'XFELD'
    langu         = sy-langu
    withtext      = 
'X'
  
TABLES
    dd07v_tab_a   = it_taba
    dd07v_tab_n   = it_tabb
  
EXCEPTIONS
    illegal_value = 
1
    op_failure    = 
2
    
OTHERS        = 3.
IF sy-subrc <> 0.
 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

WRITE'The fixed values for the domain','''XFELD''','are:-'.

LOOP AT  it_taba INTO fs_taba.
  
WRITE:
  / sy-tabix,fs_taba-domvalue_l 
CENTERED ,fs_taba-ddtext CENTERED.
ENDLOOP.
ULINE.
 

*----------------------END OF CODE----------------------* 

The output is shown below:  

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image