09-03-2009 3:48 PM
Hi friends,
I have created one interactive report using oops..
on my selection screen i have a select-option TABNAME for DD02L table with no intervals option.
ie : i enter table names in that field..
for example i enter VBAP
MARA,
MARC. etc
when i execute i get a basic list which gives some details about the tables.
now on my basic list when i double click on any row then ie : say if i click on 2nd row , in the back ground based on the index on which i have click iam reading that particular row from the table and from that using the table name iam displaying the all the fields of the table in the ist secondary list....
Till now its working fine but once when i go back to the back to the basic list and when i click another row... here even if click another row its displaying the same fields of the table which was ist click.
ie : say ist time i have clicked mara then later vbap.....But its displaying me the mara details instead it should display vbap details...
I have used refresh_table_display method also.... But its not working fine...
How can i correct it...
Regards,
Kumar.
09-03-2009 9:38 PM
Hello Kumar
I can only guess that you call the second screen (perhaps '0200') within the event handler method for event DOUBLE_CLICK. This is not really a good idea. Instead use a simple trick to overcome this refreshing problem:
METHOD handle_double_click.
" Save the row perhaps in a static attribute of your event handler method, e.g.
. lcl_eventhandler=>ms_row = e_row. " ms_row defined as static attribute of event handler class
" Trigger PAI with a defined ok-code:
CALL METHOD cl_gui_cfw=>set_new_ok_code
EXPORTING
ok_code = 'DETAIL_LIST'.
ENDMETHOD.
This method call triggers PAI of your screen which otherwise does not occur after an event has been raised.
MODULE user_command_0100 PAI.
CASE gd_okcode.
WHEN 'DETAIL_LIST'.
perform DISPLAY_DETAIL_LIST. " and call screen '0200'
WHEN OTHERS.
...
ENDCASE.
ENDMODULE.
The next time you make a double click a new row/index is filled into the static attribute. By triggering PAI (followed by PBO) you ensure a flushing (= refreshing) before the secondary list is displayed.
Regards
Uwe
09-03-2009 9:38 PM
Hello Kumar
I can only guess that you call the second screen (perhaps '0200') within the event handler method for event DOUBLE_CLICK. This is not really a good idea. Instead use a simple trick to overcome this refreshing problem:
METHOD handle_double_click.
" Save the row perhaps in a static attribute of your event handler method, e.g.
. lcl_eventhandler=>ms_row = e_row. " ms_row defined as static attribute of event handler class
" Trigger PAI with a defined ok-code:
CALL METHOD cl_gui_cfw=>set_new_ok_code
EXPORTING
ok_code = 'DETAIL_LIST'.
ENDMETHOD.
This method call triggers PAI of your screen which otherwise does not occur after an event has been raised.
MODULE user_command_0100 PAI.
CASE gd_okcode.
WHEN 'DETAIL_LIST'.
perform DISPLAY_DETAIL_LIST. " and call screen '0200'
WHEN OTHERS.
...
ENDCASE.
ENDMODULE.
The next time you make a double click a new row/index is filled into the static attribute. By triggering PAI (followed by PBO) you ensure a flushing (= refreshing) before the secondary list is displayed.
Regards
Uwe
09-04-2009 6:39 AM
Hi,
Guess the problem is you are also changing the fieldcatalog along with the data.
Try using the method SET_FRONTEND_FIELDCATALOG also along with the REFRESH_ALV_DISPLAY.
Also use FLUSH when coming back from screen 200.
Regards,
Vasanth