SAP classical output report reassigning standard toolbar buttons/scrolling down a page

天涯浪子 提交于 2019-12-12 02:24:45

问题


I have an SAP classical output report that can have a variable number of pages and each page can have variable number of lines. I want to be able to scroll up or down a page at a time. The standard toolbar provides a button for this but this doesn't work as I'm not specifying how many lines to a page - it just scrolls down a few lines instead. Using

SCROLL LIST FORWARD 1 PAGES INDEX 0.

Achieves the required effect though. Is there any way to reassign the button on the standard toolbar to have it trigger an event that runs that code? Or something that achieves similar?

I was thinking I could do something like

AT USER-COMMAND.
    CASE sy-ucomm.
        WHEN 'pgdn'.
            SCROLL LIST FORWARD 1 PAGES INDEX 0.
     ENDCASE.

But I haven't been able to get it to work yet.


回答1:


I think you have to create a GUI status. Like this:

Then you set the GUI Status and program the commands:

report  zscroll.

data lines type i.

start-of-selection.
set pf-status 'ZSCROLL_GUI'. " Set GUI status

while lines <= 100. " Print sample data
  write / lines.
  add 1 to lines.
endwhile.

at user-command. " Your code here
    case sy-ucomm.
        when 'EXIT'.
          leave screen.
        when 'PGDN'.
          "Your code
        when 'PGUP'.
          "Your code
     endcase.

And the result is this:

Finally you click a button from menu or tool bar and you will see the event 'AT USER-COMMAND' working:

Hope it helps



来源:https://stackoverflow.com/questions/15606863/sap-classical-output-report-reassigning-standard-toolbar-buttons-scrolling-down

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!