‎2008 Jun 21 12:53 PM
hi frnds..
its alv ... i have added refresh button in output ... as per requirement..
but i am getting the exact functionality to incorate in form user-command.
here i am using REUSE_ALV_GRID_DISPLAY.
i just want the output to refresh while i click the refresh button.
can u pls help me...
‎2008 Jun 21 1:02 PM
Use
DATA REF1 TYPE REF TO CL_GUI_ALV_GRID.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
E_GRID = REF1.
CALL METHOD REF1->CHECK_CHANGED_DATA.
Regards
Kannaiah
‎2008 Jun 21 1:04 PM
hi Kannaih
thank you.
but can u give the same in detail.
thank you.
‎2008 Jun 21 1:14 PM
Suppose if you have changed any row of the ALV output or if your ALV output contains the check box and you have checked the box and the program needs to identify the same into the final internal table, in which your program fetched the data, then use the below method in the USER_COMMAND form.
DATA REF1 TYPE REF TO CL_GUI_ALV_GRID. "Global class for the ALV
Calling the FM to import the ALV grid from output.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
E_GRID = REF1.
"Checking the changed data.
CALL METHOD REF1->CHECK_CHANGED_DATA.
Use the above code and analyze the same in debugging.
Regards
Kannaiah
‎2008 Jun 21 1:03 PM
use this.....
FORM USER_COMMAND USING UCOMM LIKE SY-UCOMM SELFIELD TYPE SLIS_SELFIELD.
case UCOMM.
when '&IC1'. "this is for double click.
READ TABLE it_idoc INDEX selfield-tabindex.
SET PARAMETER ID 'DCN' FIELD it_idoc-docnum.
SUBMIT RSEIDOC2 WITH DOCNUM = it_idoc-docnum
WITH CREDAT = It_idoc-credat AND RETURN.
selfield-refresh = 'X'.
‎2008 Jun 21 1:08 PM
Hi Sekhar,
Modify your code seeing the following:
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.
.
.
.
WHEN 'REFRESH'
.
.
(write ur code here)
.
.
rs_selfield-refresh = 'X'.
ENDCASE.
ENDFORM. "user_command
With the help of the statement rs_selfield-refresh = 'X'. you will be able to Refresh ur ALV list.
Award points if useful.
Thanks,
Nadim
‎2008 Jun 21 1:13 PM
hi sekhar,
you can do this in two steps:
In your user_command subroutine just put the following steps:
1. SET SCREEN 0.
2. your logic for updating the outtab[] alv internal table
3. Call the REUSE_ALV_GRID_DISPLAY fm for outtab[] table again
The SET SCREEN command will sort off REMOVE the previous ALV from screen sequence memory and display the latest one in step 3.
Hence when you click on BACK to exit, it will not run through all previous ALVs which were displayed prior to refresh button being pressed.
Cheers,
Aditya
‎2008 Jun 21 3:01 PM
Hi sekhar,
pseudo code like this
perform read_data changing gt_alv_display_table.
perform display_alv_data usiing gt_alv_display_table.
---
FORM user_command.
...
WHEN 'REFRESH'
selfield-refresh = 'X'.
perform read_data changing gt_alv_display_table.
---
Regards,
Clemens