cancel
Showing results for 
Search instead for 
Did you mean: 

current row number in sapmart forms

Former Member
0 Kudos

Hello,

i am looping an internal table and i want to show the serial numbers against each records, like..

S.NO COL1 COL2

1 abc def

2 abc def

3 abc def

4 abc def

. ... ...

. ... ...

how do i output the S.NO ( which is the current row number of the interanl table ) ?

hope u have comprehended me ??

thanks..

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

Hi,

Take a variable of type I in the global data tab. Then in the CALCULATIONS tab of your TABLE do the following. Chose the OPERATION as CNT(number). Enter the above declared variable in the TARGET FIELD NAME and BEFORE LOOP in the TIME. And tick the INITIALIZATION check box. And print this variable in the position as a normal variable in the layout.

Thanks and Regards,

Bharat Kumar Reddy.V

Former Member
0 Kudos

Thanks Kumar ..

Answers (4)

Answers (4)

Former Member
0 Kudos

hi,

welcome to sdn .

following is one of the solution to your problem.

tables mara.

data itab like table of mara with header line.

select * from mara into table itab.

loop at itab.

write 😕 sy-tabix,itab-matnr.

endloop.

Please reward points by clicking star.

Former Member
0 Kudos

Simply you can define a variable in the internal table as a counter for S.no and use it in smartform.This can be one of the solution.

Thanks,

Gaurav

Former Member
0 Kudos

Hi,

In the SMART Forms, inside the loop of the table object declare another variable, and you can use the system variable SY-INDEX for printing.

Regards,

Ravi

Note : Please mark the helpful answers

Former Member
0 Kudos

hi

u can declare a variable of type sapscript-counter0 and use it for displying the current loop pass

plz mark useful replies

regards

ganesh