‎2010 Nov 15 5:10 AM
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
‎2010 Nov 15 6:04 AM
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
‎2010 Nov 15 5:19 AM
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.
‎2010 Nov 15 6:44 AM
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
‎2010 Nov 15 6:54 AM
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.
‎2010 Nov 15 5:22 AM
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
‎2010 Nov 15 6:04 AM
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
‎2010 Nov 15 7:19 AM
Venkat is correct, just supply refesh command as he said. It'll work 100%.
<fieldcatalogue>-refresh = 'X'.
Regards
Munish Garg