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

Refreshing ALV

Former Member
0 Likes
946

Hello Experts,

I am displaying a alv grid output. With the help of custom button i am deleting some lines. I have written the code for deleting selected lines of internal table in

FORM user_command USING r_ucomm LIKE sy-ucomm

rs_selfield TYPE slis_selfield.

Endform.

Once the deletion happens and execution of above form-endform completes, will the output gets refreshed automatically(Output should come with out deleted lines)?.

Please provide inputs.

Regards,

Viswanath A

1 ACCEPTED SOLUTION
Read only

venkat_o
Active Contributor
0 Likes
849

Viswanath,

<li>Follow this way .


*&---------------------------------------------------------------------*
*&      Form  user_command
*&---------------------------------------------------------------------*
FORM user_command USING r_ucomm     LIKE sy-ucomm
                        rs_selfield TYPE slis_selfield.
  case r_ucomm.
    when 'DELETE'.
      "write code for deletion.
  endcase.
  rs_selfield-refresh = 'X'.
Endform.                    "user_command

Regards,

Venkat.O

6 REPLIES 6
Read only

deepak_dhamat
Active Contributor
0 Likes
849

Hi ,

FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
Endform.

When you are calling above code to delete seleted data .

you might be deleting this record from say table it_disp and displaying table it_disp1

so when you are deleting from it_disp then you should once again

refresh it_disp1 table which you are using to display in alv grid

and then move it_disp to it_disp1 again and call function to display ALV again

such as

delete it_disp where bismt = passing field .

refresh it_disp1[] .

clear it_disp1 .

it_disp1[] = it_disp[] .

perform display .

Regards

Deepak.

Read only

0 Likes
849

Hi Deepak,

I am using it_disp for displaying ALV. In the form end form i am deleting the lines of it_disp.

My requirement is not to call the other alv In the same alv, display has to happen with out deleted lines.

Regards,

Viswanath A

Read only

0 Likes
849

Hi,

Vishwanath ,

You have to Refresh Alv for that , if you cannot do that then simple option is refresh previous data and move new data from which you have deleted records .

and display the same .

Regards

Deepak.

Read only

birendra_chatterjee
Active Participant
0 Likes
849

Hi,

The solution lies in the subject line of your thread...

In FORM user_command, after deleting lines from the internal table, You need to set rs_selfield-REFRESH = 'X'.

Rgds,

Birendra

Read only

venkat_o
Active Contributor
0 Likes
850

Viswanath,

<li>Follow this way .


*&---------------------------------------------------------------------*
*&      Form  user_command
*&---------------------------------------------------------------------*
FORM user_command USING r_ucomm     LIKE sy-ucomm
                        rs_selfield TYPE slis_selfield.
  case r_ucomm.
    when 'DELETE'.
      "write code for deletion.
  endcase.
  rs_selfield-refresh = 'X'.
Endform.                    "user_command

Regards,

Venkat.O

Read only

Former Member
0 Likes
849

Venkat is correct, just supply refesh command as he said. It'll work 100%.

<fieldcatalogue>-refresh = 'X'.

Regards

Munish Garg