‎2009 Aug 25 4:29 PM
Hi all,
did anybody know about how the ALV standard buttons work .? after I run my programs , I get the correct output in the ALV .
then I want to sort the output table by click the sort button , then the layout changed , but I have a column needed to be
recalculated . then I set a break-point on the user command , however when I click the the sort button , it doesn't go to the user
command . I have totally no idea . is there anybody help ???
thanks in advance !
Nick
‎2009 Aug 25 5:35 PM
What type of ALV did you write? Objects or the call function module? In both you have to set up the user command code. And check for it. I can give you a code snippet. But I'm not sure which one to put out here.
‎2009 Aug 25 8:09 PM
Hello Michelle ,
thanks ! I already write the user_command in the program . but for the status of ALV, I copy from list viewer . then when the layout is shown , it is automatically seen . However , when I click on that buttons , it doesn't trigger the user_command events .
so do you get any ideas?
Best Regards
Nick
‎2009 Aug 25 5:59 PM
Hello Nick
Assuming you are using CL_GUI_ALV_GRID then the standard toolbar function do NOT trigger event USER_COMMAND (as do custom buttons).
A possible workaround is to make the toolbar interactive (go_grid->set_toolbar_interactive( ) ) and define a new ok-code for the SORT button. Then you are able to catch the event but, of course, you need to implement to sorting logic yourself.
Regards
Uwe
‎2009 Aug 25 8:06 PM
Hello Uwe,
first , thanks very much , I use the call function module to display the ALV
‎2009 Aug 25 8:12 PM
hi nick,
i hope you have used REUSE_ALV_GRID_DISPLAY.
in that FM, you have the I_****** parameters were you pass the respective event responding subroutines. like
i_callback_top_of_page = 'SUB_TOP_OFPAGE'
what ever you write in the
FORM SUB_TOP_OFPAGE.
ENDFORM.
will reflect in the top of page. like wise you need to check which event is getting triggered for you.
so trigger a debugger as i have said in the previous post. and check
‎2009 Aug 25 6:10 PM
Hi Nick,
when the ALV is displayed, put /h on the command bar. hit enter.
then click the sort button. it will take you to the debugger window. check which event is getting triggered there.
‎2009 Aug 25 6:12 PM
you have to mention the form name and the event name in the events table and pass it on the ALV call... then only it can be possible .....
Regards,
Siddarth
‎2009 Aug 25 8:22 PM
Wow! Long thread. Maybe someone has a better idea than I have.
You could copy the standard STANDARD_FULLSCREEN from function group SLVC_FULLSCREEN to your program. Change the sort code to something that you will use in your user-command routine. Then you will have to set up the status in your program with the set pf-status from the function module.
Hopefully there is a better answer. This seems like a lot of work.
I do have a program where I have used the pf-status. But I have not tried to trap for one of the predefined statuses. Worst case, you could create your own sort button.
Good Luck!
Michelle
‎2009 Aug 25 8:44 PM
Hi,
Even i had same problem, and i copied standard pf-status to z- and put it in my code, it work fine then.
‎2009 Aug 25 8:44 PM
Hi,
Even i had same problem, and i copied standard pf-status to z- and put it in my code, it work fine then.