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

Problem in Interactive ALV using OOPS

Former Member
0 Likes
2,535

Hello Gurus,

I have designed an interactive ALV using OOPS in which I use double-click event.

The problem is when I click on a record on first screen it gives the proper second screen.

But when I exit the second screen and double click another record on the first screen it still shows the first record I clicked on. I've used 'REFRESH_TABLE_DISPLAY' method even.

Please help.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,946

Hi,

I cannot import tis code as break lines are removed. When post code, use <> button, please.

I have seen a pair of things:

1) In both ALVs, the use of method REFRESH_TABLE_DISPLAY in forms DISPLAY_ALV and DISPLAY_ALV2 should match the following pattern:


* These forms are called from PBO
IF  grid_ref IS INITIAL.
"  First time PBO is called
"  Create ALV 
"  Set table for first display
...

ELSE.

" Call method refresh
CALL METHOD grid_ref->REFRESH_TABLE_DISPLAY.
ENDIF.

2) Have you tried to call 2nd screen without "STARTING AT" ??? I don't think this can cause the problem

By the way... Have you tried what Uwe suggested to manage double click??

Call method cl_gui_cfw=>set_function_code and catch command in PAI of 1st ALV to call the next screen.

It should work!!

Jorge

13 REPLIES 13
Read only

Former Member
0 Likes
1,946

Hi,

Are you using 2 ALV?? (One in first screen and one in second screen)

One Tip:

- Call method CL_GUI_CFW=>FLUSH in your PAI to tell framework to flush data and actions.

- This sentence solves most problems of this kind

Second Tip:

- If your second screen is also an ALV, free all objects when returning to the first screen

- Call method FREE for your object of class CL_GUI_ALV_GRID

- FREE variable that holds object reference for ALV

- Call method FREE for the container too

- FREE variable that holds object reference for container

Third tip:

- Pay attention to parameter LIFETIME in CREATE method of CL_GUI_ALV_GRID

Best regards,

Jorge Linares

Edited by: Jorge Linares Miranda on Apr 24, 2009 3:45 PM

Read only

Former Member
0 Likes
1,946

Did you clear/refresh the internal table before populating the second screens data. Just check it once.

are you doing this in DOUBLE_CLICK event or hotspot_click event..??

Read only

Former Member
0 Likes
1,946

Thanks a lot Jorge & Vijay.

I tried the first and second tips they didnt work for me.

The last tip I didnt get.

I'm using double_click event.

I tried using leave to screen instead of call screen for the exit button of the second screen.

Its working..but after that there are two first screens open.

I was not satisfied by that.

Moreover I tried using leave to screen for double_click event of first screen.

But its not allowing the syntax 'starting at'.

Thanks for your kind replies..but I still need your help.

Read only

0 Likes
1,946

Hello Cheetan

I assume your report layout is like this:

- first screen contains first ALV list
- second screen contains secondary ALV list

As I mentioned already a few times I have never ever come across a situation where I needed to free the grid instances (which happens automatically be leaving the report).

And again my recommendation is to use method call CL_GUI_CFW=>SET_NEW_OK_CODE (e.g. ok_code = 'DISPLAY_2ND_LIST') to trigger PAI with a specific ok-code.

In your event handler method HANDLE_DOUBLE_CLICK you simply store the required data (e.g. in static attributes of the event handler class), next trigger PAI (using the method call described above). In the USER_COMMAND module at PAI you prepare the data for the secondary ALV list and then do the CALL SCREEN.

Further reading: [A Christmas Collection of Useful Classes|https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/12377] [original link is broken] [original link is broken] [original link is broken];

Regards

Uwe

Read only

Former Member
0 Likes
1,946

Hi all,

Lifetime parameter in creation of ALV can be useful in this situation. By default, lifetime is inherited from container, but can be specified with other values.

See documentation: [http://help.sap.com/saphelp_nw04/helpdata/en/06/3fa1a59f2811d2bd68080009b4534c/frameset.htm|http://help.sap.com/saphelp_nw04/helpdata/en/06/3fa1a59f2811d2bd68080009b4534c/frameset.htm]

In these situations with 2 ALV, I use value cl_gui_alv_grid=>lifetime_dynpro in parameter I_LIFETIME when creating the ALV in the second screen.

In this way, framework automatically frees ALV when returning from the second to the first screen. The default behaviour is that ALV control remains active during the active session.

Best Regards,

Jorge

Read only

Former Member
0 Likes
1,946

Sorry to say but..No..it still didnt solve my problem.

Read only

Former Member
0 Likes
1,946

Ok, it's strange. It always works for me.

Have you included FREE statments (Tip 1) when returning to the first screen??

Example:

" Free ALV
  IF NOT gr_alv_detail IS INITIAL.
    CALL METHOD gr_alv_detail->free
      EXCEPTIONS
        cntl_error        = 1
        cntl_system_error = 2
        OTHERS            = 3
            .
    IF sy-subrc <> 0.
      l_err = sy-subrc.
    ENDIF.
    CLEAR gr_alv_detail.
    FREE gr_alv_detail.
  ENDIF.

  " Free container
  IF NOT gr_ccont_det IS INITIAL.
    CALL METHOD gr_ccont_det->free
      EXCEPTIONS
        cntl_error        = 1
        cntl_system_error = 2
        OTHERS            = 3
            .
    IF sy-subrc <> 0.
      l_err = sy-subrc.
    ENDIF.
    CLEAR gr_ccont_det.
    FREE gr_ccont_det.
  ENDIF.

* Sync Framework
  CALL METHOD cl_gui_cfw=>flush
    EXCEPTIONS
      cntl_system_error = 1
      cntl_error        = 2
      OTHERS            = 3
          .
  IF sy-subrc <> 0.
    l_err = sy-subrc.
  ENDIF.

One fool question... If you debug double-click event of first ALV, values of ROW and COLUMN are correct or are the same as when first double-click?

I hope this help,

Jorge

Read only

0 Likes
1,946

Yes I've tried this..its didnt help me..

No question is foolish for me now..

This ALV is fooling me.

Read only

0 Likes
1,946

Debugging always shows me the new values.

All the variables and tables have the proper values but screen is not.

Read only

Former Member
0 Likes
1,946

Well... I don't know what more to say.

Could you post relevant code parts??

- Dbl click event code

- ALV 2 creation in PBO

- ALV 2 destruction in PAI

Read only

0 Likes
1,946

I'm posting the whole code..It doesnt include all the solutions u said coz I tried al of dem and removed it if its not working.

It includes 3 screens in all..

1st is like a selection screen to tak the inputs i.e. matnr

2nd is the 1st alv screen.

3rd is the 2nd ALV screen.

Pls help.

&----


*& Module Pool ZCBOOPALV

*&

&----


*&

*&

&----


INCLUDE ZCBOOPALVTOP . " global Data

INCLUDE ZCBOOPALVO01 . " PBO-Modules

INCLUDE ZCBOOPALVI01 . " PAI-Modules

INCLUDE ZCBOOPALVF01 . " FORM-Routines

&----


*& Include ZCBOOPALVTOP Module Pool

ZCBOOPALV

*&

&----


PROGRAM ZCBOOPALV.

TABLES: marav, mara.

*GLOBAL DATA DEFINITIONS FOR ALV

----


  • ALV GRID INSTANCE REFERENCE*

DATA: ALV_GRID TYPE REF TO CL_GUI_ALV_GRID,

  • CUSTOM CONATINER INSTANCE REFERENCE

CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,

  • FIELD CATALOG TABLE

IT_FIELD_CAT TYPE LVC_T_FCAT,

  • FIELD CATALOG STRUCTURE

FIELD_CAT TYPE LVC_S_FCAT,

  • LAYOUT STRUCTURE

LAYOUT TYPE LVC_S_LAYO,

  • OK_CODE FOR USER COMMAND.

OK_CODE LIKE SY-UCOMM,

  • MATERIAL LOW

MATL LIKE MARAV-MATNR,

  • MATERIAL HIGH

MATH LIKE MARA-MATNR,

  • COLUMN NUMBER

COL TYPE I.

data: matnr type matnr.

DATA: ALV_GRID2 TYPE REF TO CL_GUI_ALV_GRID,

  • CUSTOM CONATINER INSTANCE REFERENCE

CUSTOM_CONTAINER2 TYPE REF TO CL_GUI_CUSTOM_CONTAINER.

----


----


INTERNAL TABLE HOLDING LIST DATA

----


*Data: begin of imat occurs 100,

*matnr like marav-matnr, "Material number

*maktx like marav-maktx, "Material short text

*matkl like marav-matkl, "Material group (so you can test

  • " to make intermediate sums)

*ntgew like marav-ntgew, "Net weight, numeric field (so you can

  • "test to make sums)

*gewei like marav-gewei, "weight unit (just to be complete)

*end of imat.

DATA: IMAT TYPE STANDARD TABLE OF MARAV,

wa like LINE OF imat.

DATA: IMAT2 TYPE STANDARD TABLE OF MARAV.

DATA: WA_IMAT LIKE LINE OF IMAT.

----


----


  • Other data needed field to store report name

data i_repid like sy-repid.

  • field to check table length

data i_lines like sy-tabix.

----


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.

ENDCLASS.

DATA: EVENT_RECEIVER TYPE REF TO LCL_EVENT_RECEIVER.

&----


*& Include ZCBOOPALVO01

&----


&----


*& Module ALV_DISPLAY OUTPUT

&----


  • text

----


MODULE ALV_DISPLAY OUTPUT.

PERFORM RETRIEVE_DATA USING MATL MATH CHANGING IMAT.

*PERFORM BUILD_FIELD_CATALOG.

PERFORM BUILD_LAYOUT.

PERFORM ALV_DISPLAY.

ENDMODULE. " ALV_DISPLAY OUTPUT

&----


*& Module STATUS_0599 OUTPUT

&----


  • text

----


MODULE STATUS_0599 OUTPUT.

SET PF-STATUS 'ZCBALV1'.

  • SET TITLEBAR 'xxx'.

ENDMODULE. " STATUS_0599 OUTPUT

&----


*& Module STATUS_0600 OUTPUT

&----


  • text

----


MODULE STATUS_0600 OUTPUT.

SET PF-STATUS 'ZPFALV'.

SET TITLEBAR 'ZTI'.

ENDMODULE. " STATUS_0600 OUTPUT

&----


*& Module ALV_DISPLAY2 OUTPUT

&----


  • text

----


MODULE ALV_DISPLAY2 OUTPUT.

*PERFORM RETRIEVE_DATA2.

*PERFORM BUILD_FIELD_CATALOG.

*PERFORM BUILD_LAYOUT.

PERFORM ALV_DISPLAY2.

ENDMODULE. " ALV_DISPLAY2 OUTPUT

&----


*& Module USER_COMMAND_0599 INPUT

&----


  • text

----


MODULE USER_COMMAND_0599 INPUT.

PERFORM MAT_SEL CHANGING MATL MATH.

ENDMODULE. " USER_COMMAND_0599 INPUT

&----


*& Include ZCBOOPALVI01

&----


&----


*& Module USER_COMMAND_0600 INPUT

&----


  • text

----


MODULE USER_COMMAND_0600 INPUT.

IF OK_CODE = 'EXIT'.

  • CALL TRANSACTION 'SESSION_MANAGER'.

LEAVE PROGRAM.

ELSEIF OK_CODE = 'BACK'.

CALL SCREEN 599.

ENDIF.

ENDMODULE. " USER_COMMAND_0600 INPUT

&----


*& Module USER_COMMAND_0601 INPUT

&----


  • text

----


MODULE USER_COMMAND_0601 INPUT.

IF ok_code = 'EXIT'.

  • CALL SCREEN 600.

" Free ALV

IF NOT alv_grid2 IS INITIAL.

CALL METHOD alv_grid2->free

EXCEPTIONS

cntl_error = 1

cntl_system_error = 2

OTHERS = 3

.

IF sy-subrc = 0.

  • l_err = sy-subrc.

ENDIF.

CLEAR alv_grid2.

FREE alv_grid2.

ENDIF.

" Free container

IF NOT custom_container2 IS INITIAL.

CALL METHOD custom_container2->free

EXCEPTIONS

cntl_error = 1

cntl_system_error = 2

OTHERS = 3

.

IF sy-subrc = 0.

  • l_err = sy-subrc.

ENDIF.

CLEAR custom_container2.

FREE custom_container2.

ENDIF.

  • Sync Framework

CALL METHOD cl_gui_cfw=>flush

EXCEPTIONS

cntl_system_error = 1

cntl_error = 2

OTHERS = 3

.

IF sy-subrc = 0.

  • l_err = sy-subrc.

ENDIF.

SET SCREEN 0.

LEAVE SCREEN.

ENDIF.

ENDMODULE. " USER_COMMAND_0601 INPUT

Read only

0 Likes
1,946

&----


*& Include ZCBOOPALVF01

&----


CLASS LCL_EVENT_RECEIVER IMPLEMENTATION.

METHOD HANDLE_DOUBLE_CLICK.

READ TABLE IMAT INDEX E_ROW-INDEX INTO WA_IMAT.

PERFORM SELECT_MATERIAL USING WA_IMAT CHANGING IMAT2.

CALL SCREEN 601 STARTING AT 10 5.

ENDMETHOD.

ENDCLASS.

&----


*& Form ALV_DISPLAY

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM ALV_DISPLAY .

CREATE OBJECT CUSTOM_CONTAINER

EXPORTING

  • PARENT =

CONTAINER_NAME = 'CCONT'

  • STYLE =

  • LIFETIME = lifetime_default

REPID = SY-REPID

DYNNR = SY-DYNNR

  • NO_AUTODEF_PROGID_DYNNR =

EXCEPTIONS

CNTL_ERROR = 1

CNTL_SYSTEM_ERROR = 2

CREATE_ERROR = 3

LIFETIME_ERROR = 4

LIFETIME_DYNPRO_DYNPRO_LINK = 5

others = 6

.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CREATE OBJECT ALV_GRID

EXPORTING

  • I_SHELLSTYLE = 0

  • I_LIFETIME = cntl_lifetime_imode

I_PARENT = CUSTOM_CONTAINER

  • I_APPL_EVENTS = space

  • I_PARENTDBG =

  • I_APPLOGPARENT =

  • I_GRAPHICSPARENT =

  • I_NAME =

  • I_FCAT_COMPLETE = SPACE

EXCEPTIONS

ERROR_CNTL_CREATE = 1

ERROR_CNTL_INIT = 2

ERROR_CNTL_LINK = 3

ERROR_DP_CREATE = 4

others = 5

.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CALL METHOD ALV_GRID->SET_TABLE_FOR_FIRST_DISPLAY

EXPORTING

  • I_BUFFER_ACTIVE =

  • I_BYPASSING_BUFFER =

  • I_CONSISTENCY_CHECK =

I_STRUCTURE_NAME = 'MARAV'

  • IS_VARIANT =

  • I_SAVE =

  • I_DEFAULT = 'X'

IS_LAYOUT = LAYOUT

  • IS_PRINT =

  • IT_SPECIAL_GROUPS =

  • IT_TOOLBAR_EXCLUDING =

  • IT_HYPERLINK =

  • IT_ALV_GRAPHICS =

  • IT_EXCEPT_QINFO =

  • IR_SALV_ADAPTER =

CHANGING

IT_OUTTAB = IMAT[]

  • IT_FIELDCATALOG = IT_FIELD_CAT

  • IT_SORT =

  • IT_FILTER =

EXCEPTIONS

INVALID_PARAMETER_COMBINATION = 1

PROGRAM_ERROR = 2

TOO_MANY_LINES = 3

others = 4

.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CREATE OBJECT EVENT_RECEIVER.

SET HANDLER EVENT_RECEIVER->HANDLE_DOUBLE_CLICK FOR ALV_GRID.

CALL METHOD ALV_GRID->REFRESH_TABLE_DISPLAY

EXPORTING

  • IS_STABLE = 'X'

I_SOFT_REFRESH = 'X'

EXCEPTIONS

FINISHED = 1

others = 2

.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDFORM. " ALV_DISPLAY

&----


*& Form MAT_SEL

&----


  • text

----


  • <--P_MATL text

  • <--P_MATH text

----


FORM MAT_SEL CHANGING P_MATL

P_MATH.

P_MATL = MARAV-MATNR.

P_MATH = MARA-MATNR.

IF P_MATL gt P_MATH.

MESSAGE 'Incorrect Entries: Lower option is greater than higher option' TYPE

'I'.

*SUBMIT SY-REPID.

SUBMIT ZCBOOPALV.

ENDIF.

IF ok_code = 'GALV'.

CALL SCREEN 600.

ELSEIF OK_CODE = 'BACK'.

SET SCREEN 0.

LEAVE PROGRAM.

ENDIF.

ENDFORM. " MAT_SEL

&----


*& Form RETRIEVE_DATA

&----


  • text

----


  • -->P_MATL text

  • -->P_MATH text

  • <--P_IMAT text

----


FORM RETRIEVE_DATA USING P_MATL

P_MATH

CHANGING P_IMAT.

select * from marav

into corresponding fields of table imat

where

matnr BETWEEN MATL and MATH.

ENDFORM. " RETRIEVE_DATA

&----


*& Form BUILD_LAYOUT

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM BUILD_LAYOUT .

LAYOUT-ZEBRA = 'X'.

LAYOUT-GRID_TITLE = 'MATERIAL INFO.'.

LAYOUT-CWIDTH_OPT = 'X'.

ENDFORM. " BUILD_LAYOUT

&----


*& Form SELECT_MATERIAL

&----


  • text

----


  • -->P_IMAT text

  • <--P_IMAT2 text

----


FORM SELECT_MATERIAL USING P_IMAT LIKE LINE OF IMAT

CHANGING P_IMAT2 LIKE IMAT.

REFRESH IMAT2.

SELECT * FROM MARAV INTO TABLE P_IMAT2

WHERE MATNR = P_IMAT-MATNR

AND MAKTX = P_IMAT-MAKTX.

ENDFORM. " SELECT_MATERIAL

&----


*& Form ALV_DISPLAY2

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM ALV_DISPLAY2 .

  • PERFORM SELECT_MATERIAL USING WA_IMAT CHANGING IMAT2.

CREATE OBJECT CUSTOM_CONTAINER2

EXPORTING

  • PARENT =

CONTAINER_NAME = 'CCONT2'

  • STYLE =

LIFETIME = CNTL_lifetime_default

REPID = SY-REPID

DYNNR = SY-DYNNR

  • NO_AUTODEF_PROGID_DYNNR =

EXCEPTIONS

CNTL_ERROR = 1

CNTL_SYSTEM_ERROR = 2

CREATE_ERROR = 3

LIFETIME_ERROR = 4

LIFETIME_DYNPRO_DYNPRO_LINK = 5

others = 6

.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CREATE OBJECT ALV_GRID2

EXPORTING

  • I_SHELLSTYLE = 0

I_LIFETIME = CNTL_lifetime_default

I_PARENT = CUSTOM_CONTAINER2

  • I_APPL_EVENTS = space

  • I_PARENTDBG =

  • I_APPLOGPARENT =

  • I_GRAPHICSPARENT =

  • I_NAME =

  • I_FCAT_COMPLETE = SPACE

EXCEPTIONS

ERROR_CNTL_CREATE = 1

ERROR_CNTL_INIT = 2

ERROR_CNTL_LINK = 3

ERROR_DP_CREATE = 4

others = 5

.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CALL METHOD ALV_GRID2->SET_TABLE_FOR_FIRST_DISPLAY

EXPORTING

  • I_BUFFER_ACTIVE =

  • I_BYPASSING_BUFFER =

  • I_CONSISTENCY_CHECK =

I_STRUCTURE_NAME = 'MARAV'

  • IS_VARIANT =

  • I_SAVE =

  • I_DEFAULT = 'X'

IS_LAYOUT = LAYOUT

  • IS_PRINT =

  • IT_SPECIAL_GROUPS =

  • IT_TOOLBAR_EXCLUDING =

  • IT_HYPERLINK =

  • IT_ALV_GRAPHICS =

  • IT_EXCEPT_QINFO =

  • IR_SALV_ADAPTER =

CHANGING

IT_OUTTAB = IMAT2[]

  • IT_FIELDCATALOG =

  • IT_SORT =

  • IT_FILTER =

EXCEPTIONS

INVALID_PARAMETER_COMBINATION = 1

PROGRAM_ERROR = 2

TOO_MANY_LINES = 3

others = 4

.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CALL METHOD ALV_GRID2->REFRESH_TABLE_DISPLAY

EXPORTING

  • IS_STABLE =

I_SOFT_REFRESH = 'X'

EXCEPTIONS

FINISHED = 1

others = 2

.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

*CALL METHOD ALV_GRID2->FINALIZE

  • .

*CALL METHOD CL_GUI_CONTROL=>SET_FOCUS

  • EXPORTING

  • CONTROL = alv_grid2

  • EXCEPTIONS

  • CNTL_ERROR = 1

  • CNTL_SYSTEM_ERROR = 2

  • others = 3

  • .

*IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

*ENDIF.

CALL METHOD CL_GUI_CFW=>FLUSH

EXCEPTIONS

CNTL_SYSTEM_ERROR = 1

CNTL_ERROR = 2

others = 3

.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

FREE alv_grid2.

FREE custom_container2.

REFRESH IMAT2.

ENDFORM. " ALV_DISPLAY2

Read only

Former Member
0 Likes
1,947

Hi,

I cannot import tis code as break lines are removed. When post code, use <> button, please.

I have seen a pair of things:

1) In both ALVs, the use of method REFRESH_TABLE_DISPLAY in forms DISPLAY_ALV and DISPLAY_ALV2 should match the following pattern:


* These forms are called from PBO
IF  grid_ref IS INITIAL.
"  First time PBO is called
"  Create ALV 
"  Set table for first display
...

ELSE.

" Call method refresh
CALL METHOD grid_ref->REFRESH_TABLE_DISPLAY.
ENDIF.

2) Have you tried to call 2nd screen without "STARTING AT" ??? I don't think this can cause the problem

By the way... Have you tried what Uwe suggested to manage double click??

Call method cl_gui_cfw=>set_function_code and catch command in PAI of 1st ALV to call the next screen.

It should work!!

Jorge