2013 Jun 14 7:41 AM
Hi,
Below is the code in which I am finding an issue,
CLASS respond_events IMPLEMENTATION.
METHOD respond_hotspot_click.
READ TABLE tab1 INTO wa INDEX e_row_id.
IF sy-subrc EQ 0.
IF e_column_id = 'BELNR'
AND wa-belnr IS NOT INITIAL.
SET PARAMETER ID 'BLN' FIELD wa-belnr.
SET PARAMETER ID 'BUK' FIELD wa-bukrs.
SET PARAMETER ID 'GJR' FIELD wa-gjahr.
CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN.
ENDMETHOD . "respond_hotspot_click
ENDCLASS . "respond_events IMPLEMENTATION
The problem here when I am into the transaction FB03 for the first time I click BACK it takes me to my report display. The second time it costs me 2 BACK to come out of the transaction and this gets increased consecutively every time I am in FB03. I tried with FLUSH/DISPATCH too. Not working.
Any leads on this?
2013 Jun 14 10:32 AM
Thanks guys. The issue got solved. The problem was there was no custom container check while displaying the ALV and everytime the SET HANDLER was getting executed.
IF g_custom_container IS INITIAL.
CREATE OBJECT g_custom_container
EXPORTING
container_name
='CTRL_AREA'.
CREATE OBJECT alv_grid
EXPORTING
i_parent = g_custom_container.
SET HANDLER w_respond_events->respond_hotspot_click FOR alv_grid.
ELSE.
CALL METHOD alv_grid->refresh_table_display.
ENDIF.
2013 Jun 14 7:48 AM
Try refreshing the grid after the call transaction.
CL_GUI_ALV_GRID->REFRESH_TABLE_DISPLAY.
Cheers!
Abhinab
2013 Jun 14 7:50 AM
2013 Jun 14 7:50 AM
Hi Sharan,
Try Call Screen <Screen Number> or Debug to see why it needs BACK press increasingly by 1 every time.
BR,
Ankit.
2013 Jun 14 7:55 AM
2013 Jun 14 8:00 AM
There isn't any specific routine to get back and I don't even have my PAI implemented for the screen. It is just like any other normal transaction and gets back. Do I need to do any while BACK? Further its the BACK of the transaction and nothing can be done from the program I guess.
2013 Jun 14 8:04 AM
Hi Sharan,
Please tell how are you trigerring it and post full code, if possible.
BR,
Ankit.
2013 Jun 14 8:04 AM
Try using FM 'FI_DOCUMENT_DISPLAY_RFC' with destination 'NONE'
BR
2013 Jun 14 8:23 AM
Hi,
do you have check what happened before you calling the method? It seems that calling the method increase and so the methed calles n-time and the FB03 dynpros lay over each other.
@Mohamed,
The FM 'FI_DOCUMENT_DISPLAY_RFC' do the same as Sharans code.
Regards,
Dirk
2013 Jun 14 8:57 AM
Looks like the table is not refreshed, but build again, when you return. The quick fix would then be to free the ALV table befor calling the transaction.
Other possibilities:
Are you using the get_selected_rows method?
Before using the get_selected_rows method, first call method 'get_metadata'…
CALL METHOD lr_table->get_metadata. " call this method....
* Then Get the selected rows/cell.
lr_selections = <rf_ref_table>->get_selections( ).
lt_rows = lr_selections->get_selected_rows( ).
ls_cell = lr_selections->get_current_cell( ).
If that does not work, free the ALV table and rebuild if again (for first display).
2013 Jun 14 10:32 AM
Thanks guys. The issue got solved. The problem was there was no custom container check while displaying the ALV and everytime the SET HANDLER was getting executed.
IF g_custom_container IS INITIAL.
CREATE OBJECT g_custom_container
EXPORTING
container_name
='CTRL_AREA'.
CREATE OBJECT alv_grid
EXPORTING
i_parent = g_custom_container.
SET HANDLER w_respond_events->respond_hotspot_click FOR alv_grid.
ELSE.
CALL METHOD alv_grid->refresh_table_display.
ENDIF.