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: 

Way to make a list (report) with buttons in body of list ?

former_member425121
Participant
0 Kudos

Hi

I need to make a list (a Log) with icons (buttons) in the body of the list (Not in the GUI status). The requirement is when user press double-click in each icon the program perform some routine. (Example the List is a Log wich says the numbre of documents created, not created, with warning, etc; and when the user press two times the apropiated icon , the program will display the corresponding documents).

I have never made this, if this Log is a Dialog Screen, i could put buttons in the screen and execute an action; but i do not know how to set buttons (icons) in a Report List body and execute an action when the user press that icons (one click or two clicks, whatever).

Does some body can help me, how can i achieve this ?

Regards

Frank

1 ACCEPTED SOLUTION

Former Member
0 Kudos

You can make use of something called as HOT SPOT in ALV reporting.

The steps you follow is

1. in the field catalog you mark that field as hot spot. i,e, ls_fieldcatalog-hotspot = 'X'.

2. You capture the handle. i.e the field the double click was made.

3. Based on that you do a call transaction to open the document.

Below is and example.

IF ls_fieldcatalog-fieldname = 'LABST'.

ls_fieldcatalog-hotspot = 'X'.

ENDIF.

by using this i can have the hotspot ..but with undeline, But the problem

is when i double click on new object is not creating even its not going into debug mode.

can any one help me in this.

here is my double clicking code, what i have to do after defining hotspot click event.

CLASS lcl_event_receiver DEFINITION.

PUBLIC SECTION.

METHODS:

**Hot spot Handler

  • HANDLE_HOTSPOT_CLICK FOR EVENT HOTSPOT_CLICK OF CL_GUI_ALV_GRID

  • IMPORTING E_ROW_ID E_COLUMN_ID ES_ROW_NO,

*

handle_double_click

FOR EVENT double_click OF cl_gui_alv_grid

IMPORTING e_row e_column,

.

ENDCLASS.

METHOD handle_double_click.

READ TABLE imain INTO wa_imain INDEX e_row-index.

IF e_column = 'LABST' AND NOT wa_imain-labst IS INITIAL.

CLEAR w_matnr.

CLEAR wa_matnr.

w_matnr = wa_imain-matnr.

CONCATENATE 'Unrestricted Stock For Material ' w_matnr INTO

wa_matnr.

SELECT mard~matnr

mard~werks

SUM( mard~labst ) AS labst

INTO TABLE itab FROM mard WHERE matnr = wa_imain-matnr

GROUP by mardmatnr mardwerks.

                      • ENDIF.

DELETE itab WHERE labst = '0'.

IF dialogbox_status IS INITIAL.

dialogbox_status = 'X'.

w_flag = 'X'.

PERFORM create_summary_detail.

ELSE.

PERFORM create_summary_detail1.

CALL METHOD dialogbox_container->set_visible

EXPORTING visible = 'X'.

  • CALL METHOD grid2->refresh_table_display.

ENDIF.

ENDIF.

ENDMETHOD.

METHOD handle_close.

CALL METHOD sender->set_visible

EXPORTING visible = space.

ENDMETHOD.

- Guru

Reward points for helpful answers

5 REPLIES 5

rahulkavuri
Active Contributor
0 Kudos

https://forums.sdn.sap.com/click.jspa?searchID=686222&messageID=1467690

https://forums.sdn.sap.com/click.jspa?searchID=686222&messageID=825026

hi check the above links they will guide you, if u want this report to act as a interactive then u can do regular programming for making the icons acting to Double Click

Former Member
0 Kudos

You can make use of something called as HOT SPOT in ALV reporting.

The steps you follow is

1. in the field catalog you mark that field as hot spot. i,e, ls_fieldcatalog-hotspot = 'X'.

2. You capture the handle. i.e the field the double click was made.

3. Based on that you do a call transaction to open the document.

Below is and example.

IF ls_fieldcatalog-fieldname = 'LABST'.

ls_fieldcatalog-hotspot = 'X'.

ENDIF.

by using this i can have the hotspot ..but with undeline, But the problem

is when i double click on new object is not creating even its not going into debug mode.

can any one help me in this.

here is my double clicking code, what i have to do after defining hotspot click event.

CLASS lcl_event_receiver DEFINITION.

PUBLIC SECTION.

METHODS:

**Hot spot Handler

  • HANDLE_HOTSPOT_CLICK FOR EVENT HOTSPOT_CLICK OF CL_GUI_ALV_GRID

  • IMPORTING E_ROW_ID E_COLUMN_ID ES_ROW_NO,

*

handle_double_click

FOR EVENT double_click OF cl_gui_alv_grid

IMPORTING e_row e_column,

.

ENDCLASS.

METHOD handle_double_click.

READ TABLE imain INTO wa_imain INDEX e_row-index.

IF e_column = 'LABST' AND NOT wa_imain-labst IS INITIAL.

CLEAR w_matnr.

CLEAR wa_matnr.

w_matnr = wa_imain-matnr.

CONCATENATE 'Unrestricted Stock For Material ' w_matnr INTO

wa_matnr.

SELECT mard~matnr

mard~werks

SUM( mard~labst ) AS labst

INTO TABLE itab FROM mard WHERE matnr = wa_imain-matnr

GROUP by mardmatnr mardwerks.

                      • ENDIF.

DELETE itab WHERE labst = '0'.

IF dialogbox_status IS INITIAL.

dialogbox_status = 'X'.

w_flag = 'X'.

PERFORM create_summary_detail.

ELSE.

PERFORM create_summary_detail1.

CALL METHOD dialogbox_container->set_visible

EXPORTING visible = 'X'.

  • CALL METHOD grid2->refresh_table_display.

ENDIF.

ENDIF.

ENDMETHOD.

METHOD handle_close.

CALL METHOD sender->set_visible

EXPORTING visible = space.

ENDMETHOD.

- Guru

Reward points for helpful answers

Former Member
0 Kudos

hi,

lok at the report DEMO_DYNPRO_STATUS_ICONS

0 Kudos

Hi

I'm going to explore the solutions, pleas let me see the choices and i will retrieve points.

Thanks a lot

Frank

0 Kudos

Hi Rahul

What do you refer when says i can do regular programming to do the icons response to double click ? (that's what i need to do).

Regards

Frank