Skip to Content

how to display listbox in ALV with domain values

Hi Experts,

I have a requirement to display domain values in list box in ALV. For example, Domain S_CLASS have  both values and description. I want to have short description in the list box for selection and display. Only in the back end , the table need to have the fixed values.

Suppose if business class is selected in list box , ALV grid should display only the short description i.e. Business Class which i have selected and not the corresponding fixed values .

I have tried Drop down alias in the method SET_DROP_DOWN_TABLE in CL_GUI_ALV_GRID but that didnt fulfill my requirement.Also i have gone through standard program BCALV_EDIT_06 & BCALV_EDIT_07.

Please help me to resolve the issue.

Thanks,

Arun.

Untitled.jpg (35.9 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Jan 07, 2015 at 02:40 PM

    Create conversion exit function/s 😊

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 07, 2015 at 03:15 PM

    Hi Arunkumar,

    Perhaps you could use standard class CL_RECA_DDIC_DOMA to get the domain values? Method GET_VALUES supplies the values defined within a domain.

    CONSTANTS: lc_bstat TYPE string VALUE 'BSTAT'.
    
     DATA: lt_values TYPE re_t_rsdomaval .
    
     * Get domain values for document status
     cl_reca_ddic_doma=>get_values( EXPORTING  id_name   = lc_bstat
                                                    IMPORTING  et_values = lt_values
                                                       EXCEPTIONS not_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.
    

    Now you can fill your listbox from the internal table LT_VALUES.

    Add comment
    10|10000 characters needed characters exceeded