Get domain value range dynamically

Hi all,
I need to create a dynamic method that retrieves the value range (key-value) of a domain.
It is pretty simple to get fixed values using FM DD_DOMVALUES_GET, but how do I manage a value table?
For example:
Field XFELD has fixed values so use DD_DOMVALUES_GET
Fields BUKRS and SPRAS have value tables.
I can get the value table name using FM DDIF_FIELDINFO_GET and retrieve the data from that table. Unfortunately, I can be sure to get the right key field, but I can't be sure to get the right value field, it depends on the value table definition.
BUKRS has T001 that stores the text in field BUTXT of the same instead SPRAS has T002 that stores the text in text table T002T in field SPTXT.
Is there any standard function module that does the trick?
In this thread Gregor Wolf managed it manually using a case statement, but I would avoid it, too many case statements...
Thanks
Ivan

What I am doing is not quite the same but similar - I am dynamically getting the text description when I have a data element and the value of the variable that references that data element.
I was pointed to CL_TEXT_IDENTIFIER which when you pass in the domain and the value magicaly brings back the text description, despite the fact that, as far as I can see, SAP has set up almost every text table slightly differently - sometimes in the main table like T001W or lFA1, sometimes which just the language and the value as a key, sometimes with extra key fields (e.g. MAKT) and sometimes with added organisational key fields e.g. the same GL account have different text descriptions in different chart of accounts.
I think at some stage CASE statements or subclasses are going to have to come into the equation, due to the utter lack of consistency in SAP table defintions.
Cheersy Cheers
Paul

Similar Messages

  • Filtering domain value ranges

    Is it possible to filter domain value ranges when displaying a dropdown listbox in a table control according to the value of another field?
    For instance,
    - I have an ITAB with the fields FIELD1 and FIELD2 and a table control TABCON connected to it.
    - FIELD1 is an instance of the domain ZDOMAIN1 and FIELD2 is an instance of the domain ZDOMAIN2.
    - ZDOMAIN1 has the value range X, Y.
    - ZDOMAIN2 has the value range A, B, C, D.
    The value of FIELD1 will be already set and not changeable at this point, as for the drop-down list for FIELD2, I want it to include
    - only A and B if the value of FIELD2 is X for that entry
    - only C and D if the value of FIELD2 is Y for that entry
    I hope I've been able to explain my problem here.

    yes it is possible
    in process before output, you should build the value list dynamically and call function module VRM_SET_VALUES to update it on screen

  • Domain value range

    hi
    i am changing the table field domain value range. after changing i am getting the warning msg like below. if i ignore it and transport odes it affect anyways.
    and also does anyone tell me when we transport only the structure get transported or even the values get transported?
    <b>The key length, i.e. the sum of the field lengths of all the key fields of the table,
    is more than 120 bytes.
    Note the following restricted fuctionality for this table:
    - Table contents cannot be transported by specifying key values, at
      best by specifying generic key values with a maximum length of 120
      bytes.
    - The table may not be used as the base table of a lock object.</b>

    Hi ,
    Instead of changing the domain value range ,
    create a Z Domain group say copy it from the existing one and increase the range .
    This will reflect on the field name in the Ztable . Do activate and adjust database from SE14 on the table .
    Remember that the new range of values will be overlapped to the existing version in the target system .
    for this what u have to do is for the existing domain field where used list see the tables in which it is to be used .
    and then if its not causing any inconsistencies u can transport or else the dependent tables which are referring to the domain group have to be modified .
    regards,
    Vijay

  • Extract data from domain-value range

    Hi,
    I have a requirement to extract data from Domain-Value range.
    I am using MDM generic extractor(mdmgx)
    in 'Maintain ports and check tables' i can create a port but i should mention a table name.
    I have a 'DOMAIN'
    with a specific value range:
    01    text1
    02   text2
    03   text3
    so on...
    i need to get these entries as a part of extracted data.
    Could you please tell me how to do this?
    Thanks a lot in advance.
    Regards,
    Rashmi

    Hey guys,
    you're making things much to complicated. For extracting Domains with MDMGX, the TABLE NAME equals the DOMAIN NAME. Example for domain XFELD that is a common Yes/No Flag:
    CLIENT            000
    SYSTEM TYPE       R3
    OBJECT TYPE       Vendor
    MDM PORTCODE      LT_YesNoIndicator
    TABLE NAME        XFELD
    NONLANG FIELDS    KEY=Key
    LANG FIELDS       LANGKEY=LANGKEY,VALUE=Name
    WHERE CLAUSE
    LINK INFO
    FUNC XML
    FUNC XSD
    PROCESS LEVEL     0
    TABLE NAME equals the domain name.
    NONLANG FIELDS and LANG FIELDS use default entries as defined above.
    If you check your system for "table" XFELD, you'll clearly see that it's a domain.
    Cheers
    Michael

  • Can I create "Dimension value range" dynamically  from data?

    Hi,
    Can I create "Dimension value range" dynamically  from data?
    Regards

    You need to have a Database Link between two servers. Then you could do execute that statement without any problem. Try to create a database link with the help of
    CREATE DATABASE LINK command. Refer Document for further details

  • How to retrieve data from domain(Value Range)  of the table

    hi
    how to retrieve data from domain(Value Range)  of the table
    thanks

    Hello,
    You can try using the FM: DOMAIN_VALUE_GET TB_DOMAINVALUES_GET.
    BR,
    Suhas
    Edited by: Suhas Saha on Mar 24, 2009 10:08 AM

  • Any FM avaliable for reading domain value range

    Hi experts,
    Is there any FM avaliable to read values from value range of a domain.
    I need to fetch short  descriptions for corresponding fixed values in value range.
    Please help.
    Thanks in advance,
    Neelima

    Hi,
    Is there any FM avaliable to read values from value range of a domain?
    Yes. Of course, you can try using the following.
    Let me assume that there is a domain called ZGENDER and it has the following fixed values:
    Value  Description
    M        Male
    F         Female
    U         Unknown.
    Then do the following code:
    DATA: l_t_gender TYPE TABLE OF dd07v.
    To get the possible list of Genders
      CALL FUNCTION 'GET_DOMAIN_VALUES'
        EXPORTING
          domname         = 'ZGENDER'
        TABLES
          values_tab      = l_t_gender
        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.
    I need to fetch short descriptions for corresponding fixed values in value range.
    Yes. After calling the function module, l_t_gender-ddtext will have the short descriptions.
    Please revert back for any clarifications.
    Best Regards,
    Suresh

  • Diplay Domain Value Range.

    Hi,
    I wish to display Value Range as define in Domain for certain field in R/3.
    Eg, ZSEX domain 's Value Range in R/3 as below
    01 Male
    02 Female
    Assume ZZSEX field is using ZSEX domain;and
    Expected "Male" to be display when field value ZZSEX = 01.
    How to achieve this in Java Web Dynpro?
    Thanks.
    Best regards,
    Xiang Li Heah

    Hi,
    Why dont you send both ZSEX domain 's value range and text to WebDynpro from R/3 in bapi output as below?
    ZZSEX     ZZSEXTXT
    01           Male
    02           Female
    (Or)
    What you need to do is , You have to store these texts (key , value) in WebDynpro side.
    You can use simple type for this purpose.
    Create one simple type "SEXSimpleType" in webdynpro local dictionary and enter the enumeration values as below.
    01           Male
    02           Female
    Create one context attribute called "SEXAttr" and change the type of this context attribute to "SEXSimpleType".
    Now in the code when the value of ZZSEX = 01 then get the corresponding text by using the below code.
    ISimpleTypeModifiable simpleType = wdContext.nodeTest().getNodeInfo().getAttribute( "SEXAttr").getModifiableSimpleType();
    ISimpleValueServices services = simpleType.getSVServices();
    IModifiableSimpleValueSet valSet = services.getModifiableSimpleValueSet();
    wdComponentAPI.getMessageManager().reportSuccess( "SexText: " + valSet.getText(ZZSEX));
    Regards,
    Charan

  • How to Get the values from Dynamic jasp page

    Hi,
    I have a jsp form page wherein i input the data form the user and get these values on the action servlet.
    But now i have added a feature to Add and Delete the Elements using javascript and this creates a dynamic form on the jsp page. I want to Get the values of these all elements at the Action servet.
    Please suggest the solution.
    Thanks,
    JavaQueue

    getParameterMap() returns a Map[1] with all parameters; the parameter name is the key and the value is the value of the parameter in the form of String arrays.
    You have to iterate over the Map and get values as you see fit. Search for a tutorial/ example/ sample for using Maps. I'm sure you'll find loads that will do a better job at explaining.
    [1] http://java.sun.com/j2se/1.4.2/docs/api/java/util/Map.html
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
    ----------------------------------------------------------------

  • To get the value of Dynamically generated Items

    Hi , i am Writting an applications using HTMLDB, i have a page which is an input page for inputting number of hours you worked on different projects i am createing the Input text filed items dynamically through web PL/SQL , what i want to do is when the user click on the sumbit button i want to read the values of the ITem and insert into a table , since they are dynamically created Items how does HTML DB handle them is there a way to get the Value for the items i tried displaying &P9_1. which is one of the items created dynamicaly but empty value is displayed.
    Any assiatnce is of great help.
    Thanks in advance
    Bharath

    This is done once the page is submitted, and the values are available in the arrays e.g. htmldb_application.g_f01 etc.
    This is covered in the manual

  • Domain Value Range: long value

    Hi,
    how can i get the "long value" (Short Description of the Fix. Value) of a Domain?
    -> for example
    A    ABAP
    J    JAVA
    In the db, i get the value 'A' or 'J' , on screen i want to give out ABAP or JAVA..
    Thx

    This will work
      REFRESH vrm_table.
      SELECT domvalue_l ddtext INTO TABLE vrm_table
        FROM dd07t
        WHERE domname = 'ZLMFUCONTTYPE'
          AND ddlanguage = sy-langu
          AND domvalue_l IN type_range.

  • How to fetch domain value range short descriptions?

    hi all,
    how can i fetch the short descriptions given in domain level, as single values- descriptions for report generation
    Regards,
    Naveen Natarajan

    Hi naveen,
    1. This if the FM.
    2. eg
      DATA : DD07V LIKE DD07V OCCURS 0 WITH HEADER LINE.
    *-----  Get all Master Document Types
      CALL FUNCTION 'GET_DOMAIN_VALUES'
        EXPORTING
          DOMNAME         = 'VBTYP'
        TABLES
          VALUES_TAB      = DD07V
        EXCEPTIONS
          NO_VALUES_FOUND = 1
          OTHERS          = 2.
    DD07V will contain all the domain values.
    regards,
    amit m.

  • HOW TO ACESS DOMAINS VALUE RANGE PROGRAMTICALLY

    DOMAIN IS WITHOUT VALUE TABLE, BUT WITH FIXED VALUES,
    HOW CAN WE ACCESS THESE VALUES PROGRAMTICALLY,
    WELL NOT FOR VALUE REQUEST TO SEE THE VALUES BUT TO DISLPAY ALL THE VALUES ENTRED IN THE VALUE RANGE OF DOMAIN , WITHIN THE PROGRAM
    REGARDS

    Using the FM is probably the best way to go.
    report zrich_0001.
    data: idd07v type table of  dd07v with header line.
    start-of-selection.
    call function 'DD_DOMVALUES_GET'
         exporting
              domname        = 'RFBSK'    "<<--- Supply domain name here
              text           = 'X'
              langu          = sy-langu
         tables
              dd07v_tab      = idd07v
         exceptions
              wrong_textflag = 1
              others         = 2.
    loop at idd07v.
      write:/ idd07v-domvalue_l, idd07v-ddtext.
    endloop.
    Regards,
    Rich Heilman

  • Possible to display domain value range descriptions rather than values?

    Hi All,
    We're using ECC6.
    I have a context input field on my view, which is  bound to a data type that is bound to a domain.  The values are brought back from the domain automatically but when the user selects a row, the fixed value is displayed rather than the description, i.e. the code for the value is displayed rather than the short description.
    This is not acceptable.  Before I go off and code something for this instead is there a parameter I can set to tell it to display the description rather than the code.
    Many thanks,
    Liz.

    HI Liz,
    You can read the domain name i guess, then you can use the Function Module DD_DOMVALUES_GET, make the call as
    CALL FUNCTION 'DD_DOMVALUES_GET'
           EXPORTING
                domname        = i_dom_name
                text           = 'X'
                langu          = sy-langu
           IMPORTING
                rc             = lv_rc
           TABLES
                dd07v_tab      = t_dd07v
           EXCEPTIONS
                wrong_textflag = 1
                OTHERS         = 2.
    you should get the short description in the field ddtext of result t_dd07v.
    Now instead of creating a domain you can provide these values to the valid values for your context dynamically.
    Hope this helps.
    Regards
    Vineet

  • How to fill Domain Value range Programatically?

    Hi Experts,
    I like to fill the domain range values from 'ZTABLE' ..
    so please help me how to fill the domain range values programatically .
    Thanks
    Banu.

    Hi Banu,
    You can update these values for Domain using Table *DD07L*.
    DOMNAME " Domain Name
    AS4LOCAL
    VALPOS
    AS4VERS
    DOMVALUE_L " Lower Limit
    DOMVALUE_H " Upeer Limit
    APPVAL
    So in program
    Fill your Work Area and update
    modify table DD07L where DOMNAME = 'YOUR_DOM_NAME'.
    Cheerz
    Ram

Maybe you are looking for