Get Domain Fixed Values programmatically using SAP ABAP

Author | Last Updated| | 0 Comments Facebook Share Twitter Share Google Plus Share A+ A-


Get Fixed values of a domain programmatically using function module GET_DOMAIN_VALUES

We get fixed values of a domain using function module GET_DOMAIN_VALUES, the function module will raise no_values_found exception if there are no fixed values for that domain.

Example Program to get Domain fixed values using SAP ABAP

REPORT zdomain_fixed.
DATA: it_tab TYPE TABLE OF dd07v,
      wa_tab TYPE dd07v.
PARAMETERS: p_domain TYPE dd07l-domname.  "Enter Domain Name
START-OF-SELECTION.
  CALL FUNCTION 'GET_DOMAIN_VALUES'
    EXPORTING
      domname         = p_domain
    TABLES
      values_tab      = it_tab
    EXCEPTIONS
      no_values_found = 1
      OTHERS          = 2.
  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:/ 'Domain',20 'Fixed Value',33 'Short Text'.
  WRITE:/ sy-uline.
  LOOP AT it_tab INTO wa_tab.
    WRITE:/ wa_tab-domname,20 wa_tab-domvalue_l,33 wa_tab-ddtext.
    CLEAR: wa_tab.
  ENDLOOP.

Get Domain Fixed values Program

Tutorial Comments

Total Comments: Add your Comment

Leave a Comment

Enter Comment Text