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

Dialog prog.

Former Member
0 Likes
980

Can anyone plz give me sample code to handle pageup, nextpage, previouspage, lastpage options for a table in screen in Dialog Program.

Thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
949

FOR NEXT PAGE

current-line = current-line + sy-loopc

For previous page

current-line = current-line - sy-loopc

For first page

current-line = top_line (ie. 1)

for last page:

first use describe table to know the no of records

devide the records by sy-loopc get quotient.

current_line = sy-loopc * quotient .

Can anyone plz give me sample code to handle pageup, nextpage, previouspage, lastpage options for a table in screen in Dialog Program.

Thanks.

8 REPLIES 8
Read only

Former Member
0 Likes
949

hi,

use this code afret making table control manually and gave scrolling buttons, and than gave that coding in the TAB control PAI.

here tab_vbap is the table control name, t_vbap is the table which is use in Table contol making, ok_code is sy-ucomm,

PERFORM scrolling_inserting USING 'TAB_VBAP'

'T_VBAP'

'MARK'

CHANGING ok_code.

FORM scrolling_inserting USING p_tc_name TYPE dynfnam

p_table_name

p_mark_name

CHANGING p_ok LIKE sy-ucomm.

DATA l_table_name LIKE feld-name.

FIELD-SYMBOLS <table> TYPE STANDARD TABLE.

FIELD-SYMBOLS <tc> TYPE cxtab_control.

ASSIGN (p_tc_name) TO <tc>.

CONCATENATE p_table_name '[]' INTO l_table_name. "table body

ASSIGN (l_table_name) TO <table>. "not headerline

DESCRIBE TABLE <table> LINES l.

CASE p_ok.

WHEN 'FP'.

<tc>-top_line = 1.

WHEN 'LP'.

<tc>-top_line = ( l - g_tab_marc_lines ) + 1.

WHEN 'NP'.

chek = <tc>-top_line + g_tab_marc_lines.

IF chek < l.

<tc>-top_line = ( <tc>-top_line + g_tab_marc_lines ).

ELSE.

<tc>-top_line = ( l - g_tab_marc_lines ) + 1.

ENDIF.

WHEN 'PP'.

chek = <tc>-top_line - g_tab_marc_lines.

IF chek <= 0.

<tc>-top_line = 1.

ELSE.

<tc>-top_line = ( <tc>-top_line -g_tab_marc_lines ).

ENDIF.

ENDCASE.

ENDFORM. " scrolling_inserting

hope it will help u.

with regards

chetan vishnoi

Read only

Former Member
0 Likes
949

hi vinutha,

here is no need to define this typeof coding if u make ur table contro with help of wizard,

i think u try this and see the coding , it will help u

with regards

chetan vishnoi

Read only

Former Member
0 Likes
949

hi

ucan also use that FM 'SCOLLING_IN_TABLE'

with regards

chetan vishnoi

Read only

0 Likes
949

thanks

Read only

Former Member
0 Likes
950

FOR NEXT PAGE

current-line = current-line + sy-loopc

For previous page

current-line = current-line - sy-loopc

For first page

current-line = top_line (ie. 1)

for last page:

first use describe table to know the no of records

devide the records by sy-loopc get quotient.

current_line = sy-loopc * quotient .