Application Development and Automation 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: 
Read only

Alv Double click ---

Former Member
0 Likes
450

Hi

friends stuck in alv double clicking as its first time for me

Iam using clases and my requirement is

1) i want the popup only when user clikcs on particular column (labst)

if he clicks on other column its hould not appear

2) when popup comes i want matnr on the heading if he clicks on first row matnr of

that row chould come if second then matnr of second should come

3) when popu comes i want default total of labst in popup as we do in normal alv using field catlog ..iam unable to find how to do in popup.

here is my code pls do correct me where iam worng and pls advice me for 1) ,2) and 3)

requirement

CLASS lcl_event_receiver DEFINITION DEFERRED.

DATA: custom_container TYPE REF TO cl_gui_custom_container,

grid2 TYPE REF TO cl_gui_alv_grid,

dialogbox_container TYPE REF TO cl_gui_dialogbox_container,

event_receiver TYPE REF TO lcl_event_receiver.

data: w_matnr like mard-matnr,

wa_matnr(40) type c.

----


  • CLASS lcl_event_receiver DEFINITION

----


  • ........ *

----


CLASS lcl_event_receiver DEFINITION.

PUBLIC SECTION.

METHODS:

handle_double_click

FOR EVENT double_click OF cl_gui_alv_grid

IMPORTING e_row e_column,

  • handle_toolbar

  • FOR EVENT toolbar OF cl_gui_alv_grid

  • IMPORTING e_object e_interactive,

*

  • handle_toolbar1

  • FOR EVENT toolbar OF cl_gui_alv_grid

  • IMPORTING e_object e_interactive,

*

handle_close

FOR EVENT close OF cl_gui_dialogbox_container

IMPORTING sender.

PRIVATE SECTION.

DATA: dialogbox_status TYPE c. "'X': does exist, SPACE: does notex.

ENDCLASS.

----


  • CLASS lcl_event_receiver IMPLEMENTATION

----


  • ........ *

----


CLASS lcl_event_receiver IMPLEMENTATION.

METHOD handle_double_click.

READ TABLE imain INTO wa_imain INDEX e_row-index.

  • PERFORM select_module_data .

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

clear w_matnr.

  • w_matnr = wa_imain-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 wa_imain-labst <> '0'.

IF dialogbox_status IS INITIAL.

dialogbox_status = 'X'.

PERFORM create_summary_detail.

ELSE.

CALL METHOD dialogbox_container->set_visible

EXPORTING visible = 'X'.

CALL METHOD grid2->refresh_table_display.

ENDIF.

ENDIF.

ENDMETHOD.

Hi

friends stuck in alv double clicking as its first time for me

Iam using clases and my requirement is

1) i want the popup only when user clikcs on particular column (labst)

if he clicks on other column its hould not appear

2) when popup comes i want matnr on the heading if he clicks on first row matnr of

that row chould come if second then matnr of second should come

3) when popu comes i want default total of labst in popup as we do in normal alv using field catlog ..iam unable to find how to do in popup.

here is my code pls do correct me where iam worng and pls advice me for 1) ,2) and 3)

requirement

CLASS lcl_event_receiver DEFINITION DEFERRED.

DATA: custom_container TYPE REF TO cl_gui_custom_container,

grid2 TYPE REF TO cl_gui_alv_grid,

dialogbox_container TYPE REF TO cl_gui_dialogbox_container,

event_receiver TYPE REF TO lcl_event_receiver.

data: w_matnr like mard-matnr,

wa_matnr(40) type c.

----


  • CLASS lcl_event_receiver DEFINITION

----


  • ........ *

----


CLASS lcl_event_receiver DEFINITION.

PUBLIC SECTION.

METHODS:

handle_double_click

FOR EVENT double_click OF cl_gui_alv_grid

IMPORTING e_row e_column,

  • handle_toolbar

  • FOR EVENT toolbar OF cl_gui_alv_grid

  • IMPORTING e_object e_interactive,

*

  • handle_toolbar1

  • FOR EVENT toolbar OF cl_gui_alv_grid

  • IMPORTING e_object e_interactive,

*

handle_close

FOR EVENT close OF cl_gui_dialogbox_container

IMPORTING sender.

PRIVATE SECTION.

DATA: dialogbox_status TYPE c. "'X': does exist, SPACE: does notex.

ENDCLASS.

----


  • CLASS lcl_event_receiver IMPLEMENTATION

----


  • ........ *

----


CLASS lcl_event_receiver IMPLEMENTATION.

METHOD handle_double_click.

READ TABLE imain INTO wa_imain INDEX e_row-index.

  • PERFORM select_module_data .

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

clear w_matnr.

  • w_matnr = wa_imain-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 wa_imain-labst <> '0'.

IF dialogbox_status IS INITIAL.

dialogbox_status = 'X'.

PERFORM create_summary_detail.

ELSE.

CALL METHOD dialogbox_container->set_visible

EXPORTING visible = 'X'.

CALL METHOD grid2->refresh_table_display.

ENDIF.

ENDIF.

ENDMETHOD.

2 REPLIES 2
Read only

Former Member
0 Likes
416

i hav not quite understood ur problem but ur r saying dat u can do it in normal ALV grid .

then wat u can do is instead of having pop-up screen u can use dialog box container and inside dat container u can have ALV grid .

now u can process everything as u do in normal grid ...

if helpful then plz reward points

Read only

Former Member
0 Likes
416

I think the problem is placing If condition.

----


  • CLASS lcl_event_receiver IMPLEMENTATION

----


  • ........ *

----


CLASS lcl_event_receiver IMPLEMENTATION.

METHOD handle_double_click.

READ TABLE imain INTO wa_imain INDEX e_row-index.

  • PERFORM select_module_data .

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

clear w_matnr.

  • w_matnr = wa_imain-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. -> Remove endif here, and place it end of the code..

DELETE itab WHERE labst ='0'.

IF wa_imain-labst <> '0'.

IF dialogbox_status IS INITIAL.

dialogbox_status = 'X'.

PERFORM create_summary_detail.

ELSE.

CALL METHOD dialogbox_container->set_visible

EXPORTING visible = 'X'.

CALL METHOD grid2->refresh_table_display.

ENDIF.

ENDIF.

ENDIF. -


> Place end if here

ENDMETHOD.