cancel
Showing results for 
Search instead for 
Did you mean: 

Serial Number in table in smartform

Former Member
0 Kudos

Hi,

In my smartfrom, in main area of main window, I have a column SNo(Serial Number). In global data tab of global definitions, I have declared v_sno type n value 1 and in Initialization tab I has written the code:

data: v_sno type n.

v_sno = 1.

v_sno = v_sno + 1.

clear v_sno.

And also in Calculations tab of Table, I has given operator: number;target field : v_sno;Time : After loop.

In the output of column SNo I am getting:

1

2

3

4

5

6

7

8

9

0

1

2

Any body have faced this? Please give me the solution.

Thanks,

vbk.

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member681680
Discoverer
0 Kudos

Hello vbk,

Can you please declare as

data : v_sno type I.

instead n.

the size what n can hold is only one digit, they how can you expect 11, 12 ,......:)

former_member200345
Contributor
0 Kudos

Hi,

The statement "data: v_sno type n." declares a numaric char of length 1.

Declare the numaric character as per your requirement. For example, if you want to declare a numaric char of length 2, follow the declaration like below.

DATA: V_SNO(2) TYPE N.

Hope will solve your issue.

Regards,

Vijaymadhur.

Former Member
0 Kudos

Hi,

I have tried this one. Even though I declare v_sno(2) type N,  after the serial number 9 it is starting again from 0,1,2,...

Also on 1st page, in 5th row, SNo 5 is not displaying but record is displaying in the row. And in the next page of 1st row SNo 5 is displaying and record is not displaying.It is happening for remaining pages also. If I increase the main window height it is displaying correctly. Any idea of why it is happening like that?

Thanks,

Venkata.

former_member182040
Active Contributor
0 Kudos

just change  v_sno type you define like

data: v_sno type i.

Step 1 :In  Global definitions, declared v_sno type i  value 0.

Step 2 : In loop create new flow logic-->program line  and  write logic like

            v_sno = v_sno + 1.

and pass v_sno om input and output parameters .


Former Member
0 Kudos

Hi Krupa,

If I declare DATA : V_SNO TYPE I in global data tab,

I have 12 records in my internal table.

If I reduce the height of main window I am getting the serial numbers upto 12.

But, on 1st page, in 5th row, SNo 5 is not displaying but record is displaying in the row. And in the next page of 1st row SNo 5 is displaying and record is not displaying.It is happening for next page also. If I increase the main window height it is displaying correctly. Any idea of why it is happening like that?

Thanks,

VBK.

former_member182040
Active Contributor
0 Kudos

main your issue is like after 9 it will come 0 that issue solve or not ?

former_member182040
Active Contributor
0 Kudos

in smartforms EVENT in sort begin u do like

After end of sort event you create command like flow logic--> command and select check box new page

And in condition TAB you write

Former Member
0 Kudos

Hi Krupa,

Thanks for the reply. I am getting Sno from 1....12. My first problem was solved.

Thanks,

VBK.

mamun_eitekh
Explorer
0 Kudos

Thanks. Its worked!