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

Issue with interactive OOALV

Former Member
0 Likes
471

Hello Friends,

I am working with OOALV methods and displaying the Material no's Batch etc...

If I click on Material number I need to navigate to MM03 and if I click back button in MM03 control should come to output list some times this is not happening in my case what will be issue.

*class definition

CLASS lcl_evthndlr DEFINITION.

PUBLIC SECTION.

METHODS handle_dblclk

  • FOR EVENT hotspot_click OF cl_gui_alv_grid "double_click

FOR EVENT double_click OF cl_gui_alv_grid

IMPORTING

  • e_row_id e_column_id .

e_row e_column es_row_no .

ENDCLASS. "lcl_evthndlr DEFINITION

*class implementation

CLASS lcl_evthndlr IMPLEMENTATION.

METHOD handle_dblclk.

READ TABLE t_outtab INTO wa_outtab INDEX e_row.

PERFORM get_current_cell_info.

CALL METHOD grid1->get_scroll_info_via_id

IMPORTING

es_row_no = w_scroll

es_col_info = w_col_inf.

IF sy-subrc = 0.

IF e_column = c_matnr.

  • Authorization check

AUTHORITY-CHECK OBJECT 'Q_TCODE'

ID 'TCD' FIELD 'MM03'.

IF sy-subrc > 0.

MESSAGE e398(00) WITH text-026 space space space.

ELSE.

SET PARAMETER : ID 'MAT' FIELD wa_outtab-matnr.

CALL TRANSACTION c_mm03.

PERFORM set_scroll_info.

ENDIF.

ENDMETHOD. "handle_dblclk

Sometimes again the control is coming to method handle_dblclk.

again calling MM03...I am unable to come back to display, it is happening like infinite loop.

This is occuring in very rare cases not always.

Thanks,

Ravi.

Hello Friends,

I am working with OOALV methods and displaying the Material no's Batch etc...

If I click on Material number I need to navigate to MM03 and if I click back button in MM03 control should come to output list some times this is not happening in my case what will be issue.

*class definition

CLASS lcl_evthndlr DEFINITION.

PUBLIC SECTION.

METHODS handle_dblclk

  • FOR EVENT hotspot_click OF cl_gui_alv_grid "double_click

FOR EVENT double_click OF cl_gui_alv_grid

IMPORTING

  • e_row_id e_column_id .

e_row e_column es_row_no .

ENDCLASS. "lcl_evthndlr DEFINITION

*class implementation

CLASS lcl_evthndlr IMPLEMENTATION.

METHOD handle_dblclk.

READ TABLE t_outtab INTO wa_outtab INDEX e_row.

PERFORM get_current_cell_info.

CALL METHOD grid1->get_scroll_info_via_id

IMPORTING

es_row_no = w_scroll

es_col_info = w_col_inf.

IF sy-subrc = 0.

IF e_column = c_matnr.

  • Authorization check

AUTHORITY-CHECK OBJECT 'Q_TCODE'

ID 'TCD' FIELD 'MM03'.

IF sy-subrc > 0.

MESSAGE e398(00) WITH text-026 space space space.

ELSE.

SET PARAMETER : ID 'MAT' FIELD wa_outtab-matnr.

CALL TRANSACTION c_mm03.

PERFORM set_scroll_info.

ENDIF.

ENDMETHOD. "handle_dblclk

Sometimes again the control is coming to method handle_dblclk.

again calling MM03...I am unable to come back to display, it is happening like infinite loop.

This is occuring in very rare cases not always.

Thanks,

Ravi.

2 REPLIES 2
Read only

Former Member
0 Likes
436

put it in simple way.


  method double_click.
    data: ls_stat like line of gt_stat.
*read selected row info.
    clear: ls_stat.
    read table gt_stat into ls_stat index e_row-index.
    if sy-subrc eq 0.
      perform authorization_check.
      set parameter id 'BLN' field ls_stat-belnr_c.
      set parameter id 'BUK' field ls_stat-bukrs.
      set parameter id 'GJR' field ls_stat-gjahr.
      call transaction 'FB03' and skip first screen.
    endif.
  endmethod.   

.

regards

Prabhu

Read only

Former Member
0 Likes
436

Hi Ravi,

Check the below code.


DATA : BEGIN OF GT_MARA OCCURS 0.
        INCLUDE STRUCTURE MARA.
*DATA : CHK(1).
DATA : END OF GT_MARA.

DATA : WA_MARA       LIKE LINE OF GT_MARA.
DATA : GT_FCAT       TYPE TABLE OF LVC_S_FCAT WITH HEADER LINE.
DATA : MY_CONTAINER  TYPE REF TO CL_GUI_CUSTOM_CONTAINER.
DATA : GRID          TYPE REF TO CL_GUI_ALV_GRID.
DATA : LS_LAYOUT     TYPE LVC_S_LAYO .
DATA : T_ROWS        TYPE LVC_T_ROW,
       T_ROWID       TYPE LVC_T_ROID.
*****************************************************************************************
* FOR HANDELING EVENTS WE HAVE TO RAISE THE EVENTS WITH LOCAL CLASS AND SET HANDELERS
*****************************************************************************************
CLASS EVENT_HANDEL DEFINITION.
  PUBLIC SECTION.
    METHODS : DB_CLICK FOR EVENT DOUBLE_CLICK  OF CL_GUI_ALV_GRID
                           IMPORTING E_ROW
                                     E_COLUMN.
ENDCLASS.                    "EVENT_HANDEL DEFINITION

*----------------------------------------------------------------------*
*       CLASS EVENT_HANDEL IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS EVENT_HANDEL IMPLEMENTATION.
  METHOD DB_CLICK.
    READ TABLE GT_MARA INTO WA_MARA INDEX E_ROW-INDEX.
    IF SY-SUBRC EQ 0.
      SET PARAMETER ID 'MAT' FIELD WA_MARA-MATNR.
      CALL TRANSACTION 'MM03' .
    ENDIF.
  ENDMETHOD.                    "DB_CLICK
ENDCLASS.                    "EVENT_HANDEL IMPLEMENTATION
DATA : EVENTS        TYPE REF TO EVENT_HANDEL.

Regards

Kumar M

Edited by: Kumar M on Jun 17, 2009 11:22 AM