Application Development 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: 

dialog programming

Former Member
0 Kudos

differrnce between current_line and top_line

4 REPLIES 4

laxmanakumar_appana
Active Contributor
0 Kudos

Hi,

Top_line : Top row at next PBO. Set at PAI by position of the vertical slider box. Can be changed in the ABAP program.

syntax :

Loop at <itab> with control <name> cursor <name>-top_line.

module <mod_name>.

Endloop.

current_line :Current line in the loop. Set automatically in the LOOP loop to the value SY-STEPL +(TOP_LINE-1). No changes allowed in the ABAP program

you can set the cursor field or you can read the contents in the current line like :

set cursor field 'name of the field' line table_control_name-current_line.

check this link :

http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbac9f35c111d1829f0000e829fbfe/content.htm

Regards

Appana

Former Member
0 Kudos

Former Member
0 Kudos

Hi

When you create a table control you have to manage a screen table (the table control) and an internal table (where you store the data to be listed).

The table control is a table with only N records, where N is the number of the rows disegned by screen painter.

You can know this parameter by system variable SY-LOOPC.

So in the LOOP of PBO and PAI while looping table control the index can be from 1 to N, you can know its value by sistem variable SY-STEPL:

so it can be from 1 to SY-LOOPC.

Now when a record of internal table has to be listed in table control, it need to know the link beetween this record and the record of tc where it'll be shown.

You can know the link by the variable top_line and current_line:

- TOP_LINE is the index of the first record of internal table is shown in table control;

- CURRENT_LINE is the index of the record of internal table is looping

but just as I said above, SY-STEPL is the index of record of table control is looping, so the system obteins the value of CURRENT_LINE by this rule:

CURRENT_LINE = TOP_LINE + SY-STEPL - 1.

For example if you have an internal table with 100 hits and a table control can be displayed only 10 records:

- SY-LOOPC = 10

- 1 <= SY-STEPL <= 10.

If the record of internal table on the top of tc is 15:

Index of TC Record of internal table

1<-SY-STEPL 15 <TOP_LINE

2 16 <--CURREN_LINE = TOP_LINE + SY-STEPL - 1

3 17

4 18

5 19

6 20

7 21

8 22

9 23

10 24

Max

Former Member
0 Kudos

Hi,

TOP_LINE:Top row at next PBO. Set at PAI by position of the vertical slider box. Can be changed in the ABAP program

CURRENT_LINE:Current line in the loop. Set automatically in the LOOP loop to the value SY-STEPL +(TOP_LINE-1). No changes allowed in the ABAP program

<b>Reward if helpful</b>

Rgds,

Shakuntala