on 10-07-2008 12:54 PM
Dear collegues,
I want to display one column in an ALV table that either displays a button (with a text on it) or displays a text (without button). The decision what of these 2 possibilites is shown should be controlled by the runtime data (eg. the WD context).
PS: I know how to display one ALV column with only buttons or one ALV column with only text.
Hi Suman Kumar,
thanks again. It looks fine.
My last 2 question would be:
a) Is the command l_cv->set_key( 'TEXT_VIEW' ) still correct to display the icon ?
b) What I fill into the new context field 'CELL_VARIANT' while runtime ? Should it filled with u201CTEXT_VIEWu201D to display the icon
and with u201C u201C to display the button ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Christian,
a) Is the command l_cv->set_key( 'TEXT_VIEW' ) still correct to display the icon ?
yes there is a no show stopper to display icon.since TEXT_VIEW is a string value to populate text/check box conditionally.
b) What I fill into the new context field 'CELL_VARIANT' while runtime ? Should it filled with u201CTEXT_VIEWu201D to display the iconand with u201C u201C to display the button ?
you can give either button or icon to cell_variant.Follow my code as it is .you will get the output.
Hallo Saman Kumar,
I understand your document that describes how to have either a button or a text in the same column.
But my second problem is: I want to have either a button or an ICON in the same column.
Thanks in advance.
Regards,
Christian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Yes you can use my logic to achieve your requirement.
check this code below.
DATA button1 TYPE REF TO CL_SALV_WD_UIE_BUTTON.
DATA l_column TYPE REF TO cl_salv_wd_column.
l_column = l_table->if_salv_wd_column_settings~get_column( 'CARRID' ).
CREATE OBJECT button1
EXPORTING
value_fieldname = 'CARRID'.
l_column->set_cell_editor( input1 ).
DATA image1 TYPE REF TO CL_SALV_WD_UIE_IMAGE.
CREATE OBJECT image1
EXPORTING
value_fieldname = 'CARRID'.
image1->set_source("image").
DATA l_cv TYPE REF TO cl_salv_wd_cv_standard.
CREATE OBJECT l_cv.
l_cv->set_key( 'TEXT_VIEW' ).
l_cv->set_editor( image1 ).
l_column->add_cell_variant( l_cv ).
l_column->set_sel_cell_variant_fieldname( 'CELL_VARIANT' ).
Thank you for your answers:
I have another related problem: Display either a button or an icon in the same ALV column. Can I do this with the same logic (from Suman Kumar Chinnam) ?
If yes, how to tell the cell variant that it should display not a text but a icon ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi christain,
Please refer this article written by me.
In that i made one cell is with chebox and the other is with text.You can use same logic to place button instead of checkbox from my article.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Take a look on this: https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f0625002-596c-2b10-46af-91cb31b7... it's a good reference to your needs.
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
9 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.