2007 Apr 02 9:17 PM
Hi experts,
Is it possible to put a button is an alv cell, just like we put a icon?
Thanks.
Alexandre
2007 Apr 02 9:52 PM
Hi,
Please check program BCALV_TEST_GRID
and also check for cl_gui_alv_grid=>mc_style_button
aRs
Hi,
Please check program BCALV_TEST_GRID
and also check for cl_gui_alv_grid=>mc_style_button
aRs
2007 Apr 02 9:52 PM
Hi,
Please check program BCALV_TEST_GRID
and also check for cl_gui_alv_grid=>mc_style_button
aRs
2007 Apr 02 10:40 PM
also you can copy the status gui using trx SE80
regards, Sebastiá
2007 Apr 03 4:15 AM
Hi,
Try,
set icon fields for all fields that contains the ICON in their name!
CLEAR ls_fcat.
ls_fcat-icon = c_checked.
ls_fcat-edit = 'X'.
ls_fcat-style = ls_fcat-style bit-xor
cl_gui_alv_grid=>MC_STYLE_BUTTON bit-xor
cl_gui_alv_grid=>MC_STYLE_ENABLEd.
MODIFY exi_fieldcat FROM ls_fcat TRANSPORTING icon
WHERE fieldname CS 'ICON'.
Pls. reward if useful...
2007 Apr 03 3:17 PM
Hi, I've used this and it worked well cl_gui_alv_grid=>MC_STYLE_BUTTON.
But I'm finding some dificult to handle the click event... it does not do anything...
Thanks.
Alexandre
2007 Apr 03 3:25 PM
I found it, the event BUTTON_CLICK.
Thanks for all the answers.
Alexandre
2007 Apr 17 5:06 PM
Hi,
how did you put an Icon on the button. I have Buttons but there is only the ID on them and not the Picture of the Icon.
Sinan
2007 Apr 17 6:15 PM
my field is a char(4), I just move the icon to this, and in the fieldcatalog I put the -datatype = 'ICON'.
Alexandre
2007 Apr 03 5:21 AM
Hi,
To add a push button and handle it,you have to define a local class and use the methods <b>handle_toolbar</b> and <b>handle_user_command</b>.Here is a sample code:
----
CLASS lcl_eh DEFINITION
----
*
----
CLASS lcl_eh DEFINITION.
PUBLIC SECTION.
DATA:
<b>ls_toolbar TYPE stb_button.</b>
METHODS:
<b>handle_toolbar</b>
FOR EVENT toolbar OF cl_gui_alv_grid
IMPORTING e_object e_interactive,
<b>handle_user_command</b>
FOR EVENT user_command OF cl_gui_alv_grid
IMPORTING e_ucomm.
ENDCLASS. "lcl_eh DEFINITION
***********************************************************************
*Type referencing an object of the class
***********************************************************************
<b>DATA: lo_obj TYPE REF TO lcl_eh.</b>
----
CLASS lcl_eh IMPLEMENTATION
----
*
----
CLASS lcl_eh IMPLEMENTATION.
***********************************************************************
*METHOD: HANDLE_TOOLBAR
*DESCRIPTION: This method provides the necessary detail required to
create an extra button in the toolbar.
***********************************************************************
METHOD handle_toolbar.
CLEAR ls_toolbar.
MOVE 'CREATE' TO ls_toolbar-function.
<b>MOVE 0 TO ls_toolbar-butn_type.</b>
MOVE 'CREATE' TO ls_toolbar-text.
MOVE 'ICON_DETAIL' TO ls_toolbar-icon.
MOVE 'CREATE' TO ls_toolbar-quickinfo.
APPEND ls_toolbar TO e_object->mt_toolbar.
ENDMETHOD. "handle_toolbar
***********************************************************************
*METHOD: HANDLE_USER_COMMAND
*DESCRIPTION: This method is used to handle the push button
***********************************************************************
METHOD handle_user_command.
CASE e_ucomm.
WHEN 'CREATE'.
**logic
...
ENDCASE.
ENDMETHOD.
ENDCLASS.
Regards,
Beejal
**reward if this helps
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |