2008 Jul 12 4:38 PM
I'm using the class CL_GUI_ALV_GRID.
I want to create a drop-down field on a column of the grid so to show in the ALV a text but the real value saved in the internal table is a code.
I'm using the method SET_DROP_DOWN_TABLE using the table parameter IT_DROP_DOWN_ALIAS: the structure of this table contains two fields, VALUE and INT_VALUE, used to contain, respectively, the value to be saved in the internal table and the text to be showed in the ALV.
When the drop-down is select the text is showed but after a refresh of the ALV the text is substituted by the internal value.
Is there a way to always show the text value and not the internal value of the drop-down ?
Thanks,
Antonino Musciumarra
I'm using the class CL_GUI_ALV_GRID.
I want to create a drop-down field on a column of the grid so to show in the ALV a text but the real value saved in the internal table is a code.
I'm using the method SET_DROP_DOWN_TABLE using the table parameter IT_DROP_DOWN_ALIAS: the structure of this table contains two fields, VALUE and INT_VALUE, used to contain, respectively, the value to be saved in the internal table and the text to be showed in the ALV.
When the drop-down is select the text is showed but after a refresh of the ALV the text is substituted by the internal value.
Is there a way to always show the text value and not the internal value of the drop-down ?
Thanks,
Antonino Musciumarra
2008 Jul 21 7:00 AM
Hi,
Did you happen to find a solution to this problem? I am,too, facing this issue and seeking a solution.
Regards,
Suhas
2008 Jul 21 8:01 AM
Check the sample programs.
BCALV_EDIT_06
BCALV_EDIT_07They are very simple to understand.
2008 Aug 11 12:38 PM
Hi vijay,
The programs you mentioned use the "value" field directly. In my case, the value field will be the value that would be stored in DB but the value I want to display on the ALV screen is different. Hope you are understanding the problem.
Regards,
Suhas
2008 Aug 11 1:29 PM
You can have option to Display different values outside(Alias) and Internal values inside.
instead of populating the IT_DROP_DOWN table populate alias table IT_DROP_DOWN_ALIAS
LS_DRAL-HANDLE = '1'.
LS_DRAL-VALUE = 'ALIASVALUE'.
LS_DRAL-INT_VALUE = 'INTERNALVALUE'.
APPEND LS_DRAL TO LT_DRAL.
Ex:-
LS_DRAL-HANDLE = '1'.
LS_DRAL-VALUE = 'Kilogram'.
LS_DRAL-INT_VALUE = 'KG'.
APPEND LS_DRAL TO LT_DRAL.
CALL METHOD G_GRID->SET_DROP_DOWN_TABLE
EXPORTING
IT_DROP_DOWN_ALIAS = LT_DRAL.in the fieldcatalog for the Drop down field.
X_FIELDCAT-DRDN_HNDL = '1'.
X_FIELDCAT-DRDN_ALIAS = 'X'. "<---Important.
2009 Jul 29 9:35 AM
Hello everyone,
I have the same problem! I specified all required parameters, and the int_values are displayed in the drop-down list, but after a refresh the code values are displayed! Does anyone have a solution to this issue?
Thanks in advance and best regards!
2013 Mar 17 11:36 PM
Bit of a late reply I know, but I had the same issue and could not find the answer in SDN, so here is what I did to solve this :
In the ALV grid I used in the Field catalogue field CONVEXIT to set a conversion exit.
I created the conversion exit by copying CONVERSION_EXIT_ALV3_OUPUT and _INPUT to my own Z version (for example CONVERSION_EXIT_ZXXXX_OUPUT and _INPUT). Please note ZXXXX should be a maximum of 5 characters.
The Input function CONVERSION_EXIT_ZXXXX_INPUT I coded as OUTPUT = INPUT. No other code.
In the output function CONVERSION_EXIT_ZXXXX_OUPUT I get the description from the INPUT value from a text table and set this as the output. e.g.
OUTPUT = INPUT.
SELECT SINGLE BEZEI FROM ZTEXTTABLE INTO OUTPUT
WHERE SPRAS = SY-LANGU
AND ZZCODE = INPUT.
As mentioned, in the fieldcat (in your program) I then use field CONVEXIT to call the conversion exit.
ls_fieldcat-drdn_hndl = '1'.
ls_fieldcat-output_len = '35'.
ls_fieldcat-drdn_alias = 'X'.
ls_fieldcat-convexit = 'ZXXXX'.
This will result in the ALV grid displaying descriptions instead of internal values and when selecting from the drop downs in edit mode, the description remains after a refresh.
Hope this will help others.
Cheers.
2009 Jul 29 11:56 AM