Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Function Module required for getting Value Range data

Former Member
0 Likes
1,757

I need a function module where in i can get the data from a value range in a domain.

Message was edited by:

Gurpreet Singh

3 REPLIES 3
Read only

Former Member
0 Likes
895

Hello,

Use the FM.

GET_DOMAIN_VALUES

regards,

rewards point.

Read only

Former Member
0 Likes
895

Write a select statement for the table DD07T and fetch the TEXT of the domain Values. if needed use DD07L table for Domain Values.

You can also use the fun module

GET_DOMAIN_VALUES

Reward points for useful Answers

Regards

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
895

Hi,

You can use this code to get the Doman's fixed values.


 DATA:  lt_fixed_values     TYPE ddfixvalues,

  CALL METHOD cl_abap_typedescr=>describe_by_name
    EXPORTING
      p_data      = 'Domain_name' " Pass the domain name here
    RECEIVING
      p_descr_ref = lcl_abap_typedescr.

  TRY.
      lcl_abap_elemdescr ?= lcl_abap_typedescr.
    CATCH cx_sy_move_cast_error.
  ENDTRY.

  IF lcl_abap_elemdescr IS BOUND.
    CALL METHOD lcl_abap_elemdescr->get_ddic_fixed_values
      EXPORTING
        p_langu        = sy-langu " Give the language
      RECEIVING
        p_fixed_values = lt_fixed_values " This table will have the fixed values
      EXCEPTIONS
        not_found      = 1
        no_ddic_type   = 2
        OTHERS         = 3.
  ENDIF.

Regards,

Sesh