Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How can i create a button in OO ALV's?

Former Member
0 Kudos

Hi All,

I have genereated a OO ALV grid control. In one of the column i need to populate button with an icon.

Help required on this.

9 REPLIES 9

shishupalreddy
Active Contributor
0 Kudos

Hello,

Use FCAT-ICON ='X' option for the column to which u need Icons to be displayed and populae the required icon into that field.

regards,

0 Kudos

Hi,

In the field catalog modify the following contents of button field after looping at the field catalog.

When 'Field_button'.

ls_fieldcat-style = cl_gui_alv_grid=>mc_style_button.

ls_fieldcat-reptext = 'Button Icon display'.

Modify fieldcatalog for the button mentioned above.

This is how you can add the button in OO ALV. Hope this helps

Regards,

Kanchan

0 Kudos

Hi,

How to get F4 help on ALV grid?

How can I get Operator symbols popup box?

And how can I get operators(EQ,NE,GT,LS,LE,GE) operator symbols and get changed when selected on ALV grid control?

0 Kudos

Hi,

Try this method REGISTER_F4_FOR_FIELDS in cl_gui_alv_grid.

0 Kudos

where to register it.

how can i achive this

0 Kudos

Hi,

DATA : lt_f4 TYPE lvc_t_f4 WITH HEADER LINE.

CLASS lcl_event_handler DEFINITION.

PUBLIC SECTION.

METHODS :

handle_on_f4 for event onf4 of cl_gui_alv_grid

importing e_fieldname es_row_no er_event_data.

ENDCLASS.

CLASS lcl_event_handler IMPLEMENTATION.

Method handle_on_f4.

......

endmethod.

ENDCLASS.

In PBO of the screen,

lt_f4-fieldname = <Fieldname>.

lt_f4-register = 'X'.

lt_f4-getbefore = 'X'.

lt_f4-chngeafter = 'X'.

CALL METHOD alvgrid->register_f4_for_fields

EXPORTING

it_f4 = lt_f4[].

creating instance for event handler..................................

DATA : event_handler TYPE REF TO lcl_event_handler.

CREATE OBJECT event_handler.

SET HANDLER event_handler->handle_on_f4 FOR alvgrid.

0 Kudos

Hi All,

I have added a button in a column.

I need to get popup with EQ, NE, GT(>),LT(<) symbols as modal dialog. How can i achive this.

0 Kudos

Hi,

Create a screen with all the values you require and then call the screen inside the method.

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Try this.

Step 1: Include a field called cellstyles in output table as below. Create a work area for the styles.

TYPES : BEGIN OF ty.

INCLUDE STRUCTURE mara.

  • For displaying push button

TYPES : cellstyles TYPE lvc_t_styl,

END OF ty.

Data w_style TYPE lvc_s_styl.

Step 2: Set the layout stylefname as CELLSTYLES.

  • Setting layout

w_layout-stylefname = 'CELLSTYLES' ."cell-push button

Step 3: Assign mc_style_button to style to display the field as button. You can find those details in cl_gui_alv_grid classu2019s attribute.

  • Displaying cell as Push button

CLEAR w_style.

w_style-fieldname = 'ERNAM' .

w_style-style = cl_gui_alv_grid=>mc_style_button .

APPEND w_style TO wa-cellstyles.

MODIFY itab FROM wa TRANSPORTING cellstyles.