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

how to perform page down in module pool program

Former Member
0 Likes
434

hi all,

any body can semd me the sampel code to perform page down in module pool program.

thanks,

maheedhar.T

1 ACCEPTED SOLUTION
Read only

andreas_mann3
Active Contributor
0 Likes
372

hi,

try this

1) in module ok-code
***Blättern
    WHEN 'P--'.                        "letzte Seite / last Page
      PERFORM scroll_loop USING 'P--'.
    WHEN 'P++'.                        "erste Seite / 1st page
      PERFORM scroll_loop USING 'P++'.
    WHEN 'P+'.                         "eine Seite vor / page down
      PERFORM scroll_loop USING 'P+'.
    WHEN 'P-'.                         " eine Seite zurück / page previous
      PERFORM scroll_loop USING 'P-'.
...

2) 

FORM scroll_loop USING fcode.


  DATA: itab_lines LIKE sy-tabix,
        first_line LIKE sy-tabix,
        j LIKE sy-tabix.

  DATA c_line LIKE sy-stepl.


  GET CURSOR FIELD cursor_field.       "to see what Loop is selected
  GET CURSOR LINE  c_line.

  DESCRIBE TABLE sumtab LINES itab_lines.
  tc_nz-lines = itab_lines.

  CASE fcode.
    WHEN 'P--'.
      tc_nz-top_line = 1.
      SET CURSOR FIELD cursor_field LINE 1.
    WHEN 'P++'.
      first_line =  tc_nz-lines - loopline_ire05 + 1.
      IF first_line > 1.
        tc_nz-top_line = first_line.
      ELSE.
        tc_nz-top_line = 1.
      ENDIF.
    WHEN 'P+'.
      first_line = tc_nz-top_line + loopline_ire05.
      j = tc_nz-lines - loopline_ire05 + 1.
      IF j LE 0.
        j = 1.
      ENDIF.
      IF first_line LE j.
        tc_nz-top_line = first_line.
      ELSE.
        tc_nz-top_line = j.
      ENDIF.
    WHEN 'P-'.
      first_line = tc_nz-top_line - loopline_ire05.
      IF first_line < 1.
        first_line = 1.
      ENDIF.
      tc_nz-top_line = first_line.
  ENDCASE.


ENDFORM.                               " SCROLL_LOOP

A.

Message was edited by:

Andreas Mann

2 REPLIES 2
Read only

andreas_mann3
Active Contributor
0 Likes
373

hi,

try this

1) in module ok-code
***Blättern
    WHEN 'P--'.                        "letzte Seite / last Page
      PERFORM scroll_loop USING 'P--'.
    WHEN 'P++'.                        "erste Seite / 1st page
      PERFORM scroll_loop USING 'P++'.
    WHEN 'P+'.                         "eine Seite vor / page down
      PERFORM scroll_loop USING 'P+'.
    WHEN 'P-'.                         " eine Seite zurück / page previous
      PERFORM scroll_loop USING 'P-'.
...

2) 

FORM scroll_loop USING fcode.


  DATA: itab_lines LIKE sy-tabix,
        first_line LIKE sy-tabix,
        j LIKE sy-tabix.

  DATA c_line LIKE sy-stepl.


  GET CURSOR FIELD cursor_field.       "to see what Loop is selected
  GET CURSOR LINE  c_line.

  DESCRIBE TABLE sumtab LINES itab_lines.
  tc_nz-lines = itab_lines.

  CASE fcode.
    WHEN 'P--'.
      tc_nz-top_line = 1.
      SET CURSOR FIELD cursor_field LINE 1.
    WHEN 'P++'.
      first_line =  tc_nz-lines - loopline_ire05 + 1.
      IF first_line > 1.
        tc_nz-top_line = first_line.
      ELSE.
        tc_nz-top_line = 1.
      ENDIF.
    WHEN 'P+'.
      first_line = tc_nz-top_line + loopline_ire05.
      j = tc_nz-lines - loopline_ire05 + 1.
      IF j LE 0.
        j = 1.
      ENDIF.
      IF first_line LE j.
        tc_nz-top_line = first_line.
      ELSE.
        tc_nz-top_line = j.
      ENDIF.
    WHEN 'P-'.
      first_line = tc_nz-top_line - loopline_ire05.
      IF first_line < 1.
        first_line = 1.
      ENDIF.
      tc_nz-top_line = first_line.
  ENDCASE.


ENDFORM.                               " SCROLL_LOOP

A.

Message was edited by:

Andreas Mann

Read only

0 Likes
372

HI Andreas,

can u plz send me the whole code .

thanks,

maheedhar.t