cancel
Showing results for 
Search instead for 
Did you mean: 

DrillDown in ALV for fixed values of domains

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

ssimsekler
Active Contributor
0 Kudos

Hi Michael

You can make fields displayed as drilldown. However, the values should explicitly be filled for which you can utilize standard FMs retrieving domain values.

For the procedure you can inspect the tutorial <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/an%20easy%20reference%20for%20alv%20grid%20control.pdf">"An Easy Reference for ALV Grid Control"</a>.

*--Serdar

Former Member
0 Kudos

Hi Serdar,

thanks for your answer.

Setting the field as drilldown and filling it explicitly was not the problem.

But I can fill the table (structure lvc_t_drop) either with fixed values or short text of the domain.

OK, I want that in the drilldown the short texts are shown, but the fixed values get selected. In the grid structure should be the selected fixed value, but the short text should be shown.

I am looking for the same handling as it is in Table Controls.

I don't know if this is possible, but up to now i thought Grids could do the same as TC's, just somewhat more.

Thanks in advance

Michael

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi Anand,

thanks for your help. I think your proposed solution is the one I was looking for. But when I tried to implement the solution I noticed that the table type LVC_T_DRAL and the export-parameter IT_DROP_DOWN_ALIAS do not exist in the system (Release 4.6C). Having a look in 4.7 they exist.

So bad luck for me. :-(((

But anyway, thanks a lot for your help. )))

Michael

Former Member
0 Kudos

Hi Michael,

I'm sorry that you are not on 4.7. But may be you could thank me better by rewarding me some points, if you please...:-)

Regards,

Anand Mandalika.

Former Member
0 Kudos

Hi to all,

now I try to solve the problem in another way with normal drilldown function. But for it I need an event when a value from the drilldown is selected. The event DATA_CHANGED is not triggered. Does anyone know if it all there is an event for drilldown?

Thanks in advance

Michael

Answers (1)

Answers (1)

Peter_Inotai
Active Contributor
0 Kudos

You can define the short/medium/long text via fieldcatalog.

Peter

...
*-->  Customer / Vendor Name
    CLEAR lwa_fieldcat.
    lwa_fieldcat-fieldname = 'NAME1'.
*    lwa_fieldcat-ref_table = 'KNA1'.
*    lwa_fieldcat-ref_field = 'NAME1'.
    lwa_fieldcat-scrtext_s  = 'C/V Name'(f11).             "10
    lwa_fieldcat-scrtext_m  = 'Customer/Vendor Name'(f12). "20
    lwa_fieldcat-scrtext_l  = 'Customer/Vendor Name'(f13). "40
    APPEND lwa_fieldcat TO r_it_fieldcat.
...