Skip to Content
author's profile photo Former Member
Former Member

list of values from domain

hi,

i had created a custom table with a field based on a domain that had like 5 values. in my dialog, when the user presses F4 for that field, i want those values to be displayed. how can i do that ?

i dont have those values anywere in any kind of master table and so i cannot select it from custom table and display using CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'.

thks

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    Posted on Jul 25, 2008 at 04:41 PM

    If the values are in Domain in any of the form like Fixed or value table then the F4 comes by Default. in this case no need to do call any function.

    REPORT  ZTEST_CONV4.
    
    parameters: vbtyp type vbak-vbtyp. "DOmain fixed Values
    
    parameters: tryp type t180-trtyp. "DOmain with value table

    if it is not you are looking for let me know.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 25, 2008 at 04:39 PM

    Hi,

    u have value table option in domain...u can give ur table in it .

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 25, 2008 at 04:47 PM

    Do you want to retreive fixed value for any domain? Use the FM DDIF_DOMA_GET.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 25, 2008 at 05:44 PM

    Hi,

    You can also get the domain values using the GET_DOMAIN_VALUES FM and call the F4 function module to display. If you don't have data element..

    Check this code..

    * Declarations.
    DATA: BEGIN OF s_data,
           domvalue_l TYPE domvalue_l,
           ddtext     TYPE val_text,
          END OF s_data,
          t_data LIKE TABLE OF s_data.
    DATA: t_dd07v TYPE STANDARD TABLE OF dd07v,
          s_dd07v TYPE dd07v.
    
    PARAMETERS: p_test TYPE char1.
    
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_test.
    
      REFRESH: t_data.
    
    * Get the domain values
      CALL FUNCTION 'GET_DOMAIN_VALUES'
        EXPORTING
          domname         = 'VBTYP'   " Give your domain here
        TABLES
          values_tab      = t_dd07v
        EXCEPTIONS
          no_values_found = 1
          OTHERS          = 2.
      IF sy-subrc NE 0.
        EXIT.
      ENDIF.
    
    * Prepare the data.
      LOOP AT t_dd07v INTO s_dd07v.
        MOVE-CORRESPONDING s_dd07v TO s_data.
        APPEND s_data TO t_data.
      ENDLOOP.
    
    
    * F4
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          pvalkey          = ' '
          retfield         = 'DOMVALUE_L'
          dynpprog         = sy-repid
          dynpnr           = sy-dynnr
          dynprofield      = 'P_TEST'
          callback_program = sy-repid
          value_org        = 'S'
        TABLES
          value_tab        = t_data
        EXCEPTIONS
          parameter_error  = 1
          no_values_found  = 2
          OTHERS           = 3.
    
      IF sy-subrc NE 0.
    
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.

    Thanks

    Naren

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.