on 12-08-2004 10:45 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
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
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.
...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.