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

to refresh alv output using function button

Former Member
0 Likes
2,671

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...

7 REPLIES 7
Read only

Former Member
0 Likes
1,437

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

Read only

0 Likes
1,437

hi Kannaih

thank you.

but can u give the same in detail.

thank you.

Read only

0 Likes
1,437

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

Read only

Former Member
0 Likes
1,437

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'.

Read only

Former Member
0 Likes
1,437

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

Read only

Former Member
0 Likes
1,437

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

Read only

Clemenss
Active Contributor
0 Likes
1,437

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