Shortcut to fixed value domain output in ALV

I have a fixed value domain,  which has two values...A ='Major Project', B= 'Minor Project'.
I wish my alv report to show the long text for fields in this domain. i.e. if a field has a value of A I want the report to show 'Major Project'.
Am I going to have to this the long way (using function module Domain_get_value) or is there any automatic way within ALV to achieve this...similar to defining a screen-painter field as 'listbox'?
Edited by: Neil Woodruff on Dec 18, 2007 8:52 AM

Hi,
   Refer this code
*&      Form  sub_field_catalogmerge                                   *
This form builds the fieldcatalog using REUSE_ALV_FIELDCATALOG_MERGE*
function module                                                     *
FORM sub_field_catalogmerge.
  CONSTANTS : lc_long_text(1) TYPE c VALUE 'L'.
*--Pass the Report name
  v_repid = sy-repid.
*--Call funtion module to build the field catalog
  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
      i_program_name         = v_repid
      i_internal_tabname     = 'I_FINAL'
      i_client_never_display = c_chk
      i_inclname             = v_repid
    CHANGING
      ct_fieldcat            = i_fieldcat
    EXCEPTIONS
      inconsistent_interface = 1
      program_error          = 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.
  LOOP AT i_fieldcat INTO wa_fieldcat.
    CASE wa_fieldcat-fieldname.
      WHEN 'FELDV'.
        wa_fieldcat-ddictxt   = lc_long_text.
        wa_fieldcat-seltext_l = text-014.
        MODIFY i_fieldcat FROM wa_fieldcat INDEX sy-tabix
          TRANSPORTING ddictxt seltext_l.
*--Clear
        CLEAR wa_fieldcat.
      WHEN 'VERPR'.
        wa_fieldcat-ddictxt   = lc_long_text.
        wa_fieldcat-seltext_l = text-013.
        MODIFY i_fieldcat FROM wa_fieldcat INDEX sy-tabix
          TRANSPORTING ddictxt seltext_l.
*--Clear
        CLEAR wa_fieldcat.
      WHEN 'EINME'.
        wa_fieldcat-ddictxt   = lc_long_text.
        wa_fieldcat-seltext_l = text-015.
        MODIFY i_fieldcat FROM wa_fieldcat INDEX sy-tabix
          TRANSPORTING ddictxt seltext_l.
*--Clear
        CLEAR wa_fieldcat.
      WHEN 'TVAL'.
        wa_fieldcat-ddictxt   = lc_long_text.
        wa_fieldcat-seltext_l = text-016.
        wa_fieldcat-do_sum = 'X'.
        MODIFY i_fieldcat FROM wa_fieldcat INDEX sy-tabix
          TRANSPORTING ddictxt seltext_l do_sum.
*--Clear
        CLEAR wa_fieldcat.
    ENDCASE.                              " CASE lwa_catlog-fieldname
  ENDLOOP.                          "loop at i_fieldcat into wa_fieldcat
ENDFORM.                                  "sub_field_catalogmerge
Regards,
Prashant

Similar Messages

  • F4 help not reflecting in ALV Grid for fixed values specified in domain

    Hi experts,
       As per subject i have a field for which i have assigned 5 fixed values in the domain level (of that field) . The problem is when i am displaying my ALV grid output i need a F4 help and F4 Option for the same is not reflecting and i have assigned in the field catlog as shown bellow.
    wa_fcat-fieldname = 'ZDEPLOY'.
      wa_fcat-tabname = 'IT_FINAL'.
    wa_fcat-f4availabl = 'X'.
    wa_fcat-key     =  'X'.
      WA_FCAT-SELTEXT_L = 'Deployment Planned'.
      wa_fcat-outputlen = '25'.
       WA_FCAT-EDIT = 'X'.
       WA_FCAT-REF_FIELDNAME = 'ZDEPLOY'.
       WA_FCAT-REF_TABNAME = 'ZETMDEPL'.
      APPEND WA_FCAT TO IT_FIELDCAT.
      CLEAR WA_FCAT.
    for the above field the f4 help is not reflecting.
    Intrestingly i have another field which i have declared using the same procedure for which my F4 help (with fixed values ) is reflecting in the same program .with the values as shown below
        wa_fcat-fieldname = 'ZFINAL'.
      wa_fcat-tabname = 'IT_FINAL'.
      WA_FCAT-SELTEXT_L = 'Final Status'.
      wa_fcat-outputlen = '10'.
       WA_FCAT-EDIT = 'X'.
       wa_fcat-ref_fieldname = 'ZFINAL'.
       wa_fcat-ref_tabname = 'ZETMDEPL'.
      APPEND WA_FCAT TO IT_FIELDCAT.
      CLEAR WA_FCAT.
    can u plz suggest me with a solution .
    Regards,
    Edited by: abhilash aswath on Oct 20, 2010 3:32 PM
    Moderator message: please do not use SMS speak.
    Edited by: Thomas Zloch on Oct 20, 2010 3:58 PM

    hi,
    There was a mismatch of characteristics. I resolved by matching the same.

  • DrillDown in ALV for fixed values of domains

    Hi,
    i want to create an ALV Grid with an structure that has data elements with domains containing fixed values.
    As far as i know, in Table Controls and other dynpro fields refering to such domains, the drilldown function is automatically available.
    In an ALV-Grid the values are available with the F4-Button.
    Ok, you can select a value, but the value is shown in the grid is the fixed value not the short text of the value like it is in Table Controls. What I did is to implement an conversion exit to show the short text in the grid, but I am not really satisfied.
    What I ask you: Is there a possability to show a field of the ALV-Structure with drilldown functionality automatically, when the domain has fixed values?
    Thanks in Advance
    Michael

    Hi Michael,
    I think I have found the solution to your problem. When you call the method SET_DROP_DOWN_TABLE of the ALV Grid, you can see that there are two tables parameters (both of which are optional).
    You can use the second tables parameter to give the short text of your field-value.
    Consider the following code snippet.
    ==========================
    data : lt_dropdown_with_alias type LVC_T_DRAL,
           ls_dropdown_with_alias type LVC_S_DRAL.
    ls_dropdown_with_alias-handle = '1'.
    ls_dropdown_with_alias-int_value = 'T'.
    ls_dropdown_with_alias-value = 'True'.
    append ls_dropdown_with_alias to lt_dropdown_with_alias.
    ls_dropdown_with_alias-handle = '1'.
    ls_dropdown_with_alias-int_value = 'F'.
    ls_dropdown_with_alias-value = 'False'.      
    append ls_dropdown_with_alias to lt_dropdown_with_alias.
    call method ALV_GRID->set_drop_down_table
                exporting IT_DROP_DOWN_ALIAS = lt_dropdown_with_alias.
    ==========================
    Obviously, <b>int_value</b> is the internal value and <b>value</b> is the text that you want to be displayed.
    Hope this helps.
    Regards,
    Anand Mandalika.
    P.S. I'm almost certain that this code will work. If it does, please do reward the points.

  • ALV + fixed values

    Hi All,
    In my ALV GRID report I have a field which uses a domain.
    This domain has some fixed values like: 1 - Male, 2 - Female.
    In the output only 1 or 2 is appearing.
    Is there a way by which instead of the value, we can display the
    description of the fixed value?
    Any value to be passed in the field catalog to do so?
    I wanted to avoid an extra select query to get the description.
    Regds
    Anuj

    Hi,
      While updating the final internal table (used for display) in the ALV,move the corresponding descriptions in the column.I think this may help you.
    Reward if found useful.

  • FTXP-error-Domain MWART fixed value  does not exist- Message no. F4341

    Hi,
    I am trying to created a new record for a tax code, and i get this error
    Domain MWART fixed value  does not exist
    Message no. F4341
    I looked up OB40, and not sure how to fix this. Do you know how to check the tax codes? How to validate OB40?
    Thanks.

    Hello,
    Please follow this procedure for the input tax codes which experience
    the error F4341:
    1) Go to SE16 and enter table T007A
    2) Hit enter and in the next screen choose the following parameters
       and enter values that represent the tax code for input tax which are
       encountering the problem.
       KALSM (tax procedure)
       MWSKZ (tax code)
    3) Click on the "execute" button.
    4) Take special attention to column MWART which represents tax type.
       This should only have a value "V" to represent input tax (or "A" if
       output tax).
    5) The cause of the error F4 341 is when this column does not contain
       any value or is blank.  Which means that there is no defined tax type
       "A" or "V" maintained in customizing.
    6) To correct this you should maintain the value again via FTXP for the
       corresponding tax codes and complete all the customizing settings
       relating to tax on sales and purchases thereunder. Afterwhich you
       should no longer experience the error message.
    Regards,
    REnan

  • EEWB - Display Domain Fixed values

    Hi Guys,
    We have a field added to CRMD_ORDER using EEWB. A data element with a domain having fixed values was used while creating this field. This custom field is displayed with no issues. But now the user wants the fixed value to be displayed next to the selected value. Anyone have any idea how this can be achieved? We are thinking of a adding an output only field on the screen and then filling the value to it. But this need some custom coding to be done. Not sure if we can do this custom coding anywhere in the generated code of EEWB.
    Please let me know if anyone has any suggestions.
    thanks and regds,
    M...

    Hi,
    For the EEWB fields for the CRMD_ORDER.....you need to implement BADI's for filling up the values....and also to meet your requirement.
    you need to tell the in which set you created the field like customer_h, customer_i......or whatever. according to that there are BADI's to fill up the values and display them.
    Hope it helps.
    Regards
    Sidd

  • How to show fixed values instead of field values in ALV cell.

    Hi colleagues,
    I have a ALV object of type CL_GUI_ALV_GRID.
    I have associted a table with it which has a field called refresh type which is of type char1.
    My program works fine.
    But the problem is,
    The refresh_type field has fixed values in its value range.
    On display of ALV i want to show the associated fixed value instead of actual value in table content.
    I donno the way to do it.
    Please help me.
    -Trupti

    Another way to do this would be to define a conversion exit function for use in the report.
    You can copy a SAP-provided function group like ALFA as a template, but you may need untyped importing/exporting parameters. Name the new functions as CONVERSION_EXIT_Zxxx_OUTPUT and CONVERSION_EXIT_Zxxx_INPUT where Zxxx is some string you choose.
    In this case the input to the ...OUTPUT function will be the code value from the database and the output value will be the corresponding text. So the code of the function CONVERSION_EXIT_Zxxx_OUTPUT will do the conversion suggested in steps 2 & 3 of Marcin's response above.
    Here is an example based on the SFLIGHT model to enhance example report BCALV_GRID_DEMO.
    First the conversion function:  (I used 'zalv' as my identifying string for the conversion.)
    function conversion_exit_zalv_output.
    *"*"Local Interface:
    *"  IMPORTING
    *"     VALUE(INPUT)
    *"  EXPORTING
    *"     VALUE(OUTPUT)
      field-symbols:
        <output> type c,
        <carrid> type c.
      assign input  to <carrid> casting.
      assign output to <output> casting.
      select single carrname from  scarr into <output>  " convert code to text
             where  carrid  = <carrid>.
    endfunction.
    In a copy of program BCALV_GRID_DEMO, make changes in the module pbo.
    module pbo output.
      set pf-status 'MAIN100'.
      if g_custom_container is initial.
        create object g_custom_container
          exporting
            container_name = g_container.
        create object grid1
          exporting
            i_parent = g_custom_container.
    * " changes start here
        data: gs_fcat type lvc_s_fcat,
              gt_fcat type lvc_t_fcat.
        tables: dd03l.
        select * from dd03l where tabname = 'SFLIGHT'. " fill field catalog
          if dd03l-fieldname = 'CARRID'.
            gs_fcat-inttype = dd03l-inttype.
            gs_fcat-outputlen = 20.
            gs_fcat-coltext = 'Carrier'.
            gs_fcat-seltext = 'Carrier'.
            gs_fcat-edit_mask = '==ZALV'. " == with the string you used to name the functions
          else.
            clear gs_fcat.
            gs_fcat-ref_table = dd03l-tabname.
          endif.
          gs_fcat-fieldname = dd03l-fieldname.
          append gs_fcat to gt_fcat.
        endselect.
    * " changes end here
        call method grid1->set_table_for_first_display
          exporting
            i_structure_name = 'SFLIGHT'
          changing
            it_fieldcatalog  = gt_fcat
            it_outtab        = gt_sflight.
      endif.
    endmodule.                    "PBO OUTPUT
    If you run this amended program, you see appropriate carrier texts in the ALV grid, where the original program had the IATA codes.
    This approach makes sense if, for example, the same translation is also required elsewhere, as the function can easily be reused.
    best wishes
    Ed

  • Function Module to validate a value against domain fixed values

    Hi,
    Could anybody please let me know if there is a standard Function Module that takes a Value and Domain name as an input and checks if the input value exists in the Fixed Values of the domain.
    Thanks,
    Shalabh

    Hi,
    you can use fm FM_DOMAINVALUE_CHECK. Pass parameter values for I_DOMNAME and I_DOMVALUE.
    If the value is invalid, exception VALUE_NOT_ALLOWED will occur.
    Regards,
    Klaus

  • Domain Value Shot Description instead of Fixed Value

    Hi Everyone,
    I am having a peculiar issue in Passing domain values from ABAP webdynpro to Interactive forms.
    The scenario is as given below.
    1> Interactive form is only for display purpose.
    2> Passing fields from a Z structure in interactive forms interface.
    3> Certain fields in the Z structure are having data elements which are linked to domains.
    4> The domains mentioned in point number 3 are having fixed values as well as short descriptions.
    5> Fixed values are stored in the tables in R/3 and not short descriptions.
    6> I want to display the Short Description in Interactive forms as a text box and not a dropdown value. Since it is just for display purpose, i dont want to display a dropdown value. Currently The fixed values are getting displayed.
    I wanted to know if there is some way to do this without using Code.
    I have quite a lot of fields and for all of these fields if we select values from dd07t table, Performance would be severely affected.
    Please let me know if someone has any suggestions. If you need any more clarifications don't hesitate to ask.
    Thanks in advance and Warmest Regards
    Mz

    Hello Robert,
    Thanks for your prompt reply.
    Let me try to clarify a bit more.
    As mentioned by you, let us suppose that i have a field ZBUKRS with the domain ZZBUKRS having the same fixed values.
    In case of Webdynpro ABAP, if i create a dropdown and bind this domain (ZZBUKRS) to the dropdown, when i run the report, i see the short descriptions in the dropdown. When selecting a value, the Fixed value is automatically selected for the selected short description. There is no need to go in for seperate coding to acheive this.
    I was wondering, is there any way that a similar thing can be acheived in interactive forms without doing the coding. I know that we can use the FM 'STF4_GET_DOMAIN_VALUE_TEXT'. But since i have a large number of domains, i will have to use this repeatedly.
    Hope i have not confused you
    Please let me know if any further clarifications are required.
    Thanks & with warmest regards,
    Mz

  • How to read the 'Input help with fixed values' of domain .

    How to read the 'Input help with fixed values' of domain .
    The domain has a Value range i want to read those values .
    Are these values stored in any table ?
    Plz help me i need it ver badly...
    Thanks in Advance...

    Hi Chandra Shekhar,
    To read the 'Input help with fixed values' of domain , you can use the function module : HR_P_GET_FIXED_VALUE_TEXT.
    iIf you enter the domain name, you will find the fixed values entered in the domain.
    These values are stored in a table DD07L(DD zero 7 L). Here the values are stored based on domain name.
    See if it works for you.
    Award points if its helpful.
    Regards,
    Bhanu

  • Hide domain fixed values for future use

    We have  a custom domain with 7 fixed values.These Fix values will display if we click on f4 help in the screen.I dont want 4th value and 5th value in the f4 search help button.whether it is possible to hide those values for future use. if we delete the fix values from the domain fixed value list..then it is effecting the past data.Please help me on this.

    Hi Prashanth,
    Use FM : DDIF_DOMA_GET  to get the fixed values for that domain in an internal table, then you can process that internal table according to your requirement and display only those values, in AT SELECTION_SCREEN ON VALUE_REQUEST event in the report.
    I hope it resolves your problem.
    Thanks,
    Avinash

  • Checking domain fixed values

    I have a screen field in a dynpro where the domain has a fixed value range. The values shows up in the F4 help, but I can't figure out the best way to validate it in the PAI short of hardcoding, which I'd like to avoid.
    Take for example a domain with possible values 'A', 'B', 'C', '1', '2' or '3'. These values pull through to the search help but I also need to validate manual user input against this list.
    I understand the DDIC attribute for a screen element can do this, but that's not an option in this case as the name of the field does not match the name of a dictionary field. Any other suggestions?
    Thanks

    >
    Chris wrote:
    > I have a screen field in a dynpro where the domain has a fixed value range. The values shows up in the F4 help, but I can't figure out the best way to validate it in the PAI short of hardcoding, which I'd like to avoid.
    >
    > Take for example a domain with possible values 'A', 'B', 'C', '1', '2' or '3'. These values pull through to the search help but I also need to validate manual user input against this list.
    >
    > I understand the DDIC attribute for a screen element can do this, but that's not an option in this case as the name of the field does not match the name of a dictionary field. Any other suggestions?
    >
    > Thanks
    If this field should only contain values from the domain fixed value range, why don't you make it into a drop down listbox field?  This would make manual input impossible and all they can do is select values from the drop down list.

  • Domain fixed values columns

    Hello all,
    a liitle bit strange while maintaining fixed values to the domains in 2 diff SAP systems.
    in one SAP system, i am getting 3 columns for maintaining fixed values namely:
    I (Initial value)
    Fix.Val.
    Short Descrip.
    but in another SAP system, i am NOT getting the column I (Initial value).
    Should i need to do some settings, in order to get coumn I (Initial value).
    <removed by moderator>
    Regards,
    Venkat
    Edited by: Thomas Zloch on Mar 5, 2012

    Hi Venkata,
    For value range in the domain - when the 'Configuration' icon that is table settings icon in the top right corner is  opened and
    'Current settings' and 'Standard settings' are maintained as 'Basic setting' and 'Use as standard setting' check box is selected and saved then all the columns in that table(I , Fix Val , Short Description , Fixed Value Append , Switch ) are displayed.
    Please check it for your domain.
    Regards,
    Sai

  • Is there any RFC function module to read domain fixed value

    Hi,
    Is there any RFC function module to read domain fixed value from remote system in basis layer?
    As we cannot simply wrap DD_DOMVALUES_GET with a new RFC module,because remote system will not install our component, our wrap function module is not there.
    We may need a RFC fm from basis layer.

    HI,
    Try using Function Module:
    DD_DOMA_GET , If it is RFC enabled it can be used for reading the domain,
    Kindlly go through this link below:
    How to get "Fixed Domain Values" from other system by RFC-Call?
    Hope it helps,
    Regards
    Mansi

  • Finding short text description of Fixed values for value range for domain

    Hi,
    When I got to Dictionary: Dispaly Domain and click on tab value range; I get the template showing Fix. Val and its associated short text.
    I want to fetch the short text for a particular fix. val for a domain.
    How can I do that ? What table can I use it ? Or do I need to use some function module ?
    Lets say I want to fetch the short text for a given Fix val. for domain VBELN.
    Please help me out.

    Hi,
    You can use Function Module 'FM_DOMAINVALUE_CHECK' to get the fixed values of any domain.
    Regards,
    Atanu

Maybe you are looking for