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

Controlling Cursor/Scroll Bar

Former Member
0 Likes
458

Hi All,

I have a long interactive report which is stretched to many pages, now when I click on any of the lines in any page it gives me more data below that line as in hierarchy. I have the problem when I click on any such line which is not displayed in the first page, cursor is again set to the first page(after the report is displayed as the report is rewritten) and I have to scroll down to find my line.

Can anyone have any idea how can I set the report in such a way that I need not scroll down to find my line. I have tried with "Set Cursor line sy-lilli". Any other ideas & how?

Thank You All in advance.

Cheers....

2 REPLIES 2
Read only

Former Member
0 Likes
402

Hi,

The statement "GET CURSOR" could be useful in your case.

The "GET" can be used to retrieve the line number which was clicked. This value can be used later to position the cursor using the "SET CURSOR"...

Thanks,

Renjith

Read only

0 Likes
402

Please see this example. It's not perfect, but you get the idea. You must create the gui-status and assign function code "LINE".



report zrich_0002 no standard  page heading
                 line-count 10
                 line-size  80..


data: begin of imara occurs 0,
      check type c,
      matnr type mara-matnr,
      end of imara.

data: position type i.
data: page type i.

start-of-selection.

  set pf-status 'LINE_NUMBER'.

  select * into corresponding fields of
             table imara from mara up to 200 rows.

  perform write_list.

at user-command.
  case sy-ucomm.
    when 'LINE'.
      scroll list to page page.
      set cursor line position.
  endcase.


at line-selection.

  position = sy-lilli.

  describe list line sy-lilli page page.

  read table imara with key matnr = imara-matnr.
  if sy-subrc  = 0.
    if imara-check = space.
      imara-check = 'X'.
    else.
      imara-check = space.
    endif.
    modify imara index sy-tabix.
  endif.

  perform write_list.

  set user-command 'LINE'.


*---------------------------------------------------------------------*
*       FORM write_list                                               *
*---------------------------------------------------------------------*
form write_list.

  sy-lsind = sy-lsind - 1.

  loop at imara.

    format hotspot on.
    write:/ imara-matnr.
    if imara-check = 'X'.
      write:/ 'this material has now been expanded'.
    endif.
    hide: imara-check, imara-matnr.
    format hotspot off.

  endloop.


endform.

Regards,

Rich Heilman