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

ALV problems

Former Member
0 Likes
1,033

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

10 REPLIES 10
Read only

Former Member
0 Likes
984

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.

Read only

0 Likes
984

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

Read only

uwe_schieferstein
Active Contributor
0 Likes
984

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

Read only

0 Likes
984

Hello Uwe,

first , thanks very much , I use the call function module to display the ALV

Read only

0 Likes
984

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

Read only

Former Member
0 Likes
984

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.

Read only

Former Member
0 Likes
984

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

Read only

Former Member
0 Likes
984

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

Read only

0 Likes
984

Hi,

Even i had same problem, and i copied standard pf-status to z- and put it in my code, it work fine then.

Read only

0 Likes
984

Hi,

Even i had same problem, and i copied standard pf-status to z- and put it in my code, it work fine then.