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: 

serial no starting with 0

former_member554223
Participant
0 Kudos
110

hello all i want to loop a serial no in a table in smartforms

data: lv_serial_no type I value 1.

LOOP AT IT_ITAB.
* LV_SERIAL_NO = LV_SERIAL_NO + 1.
* IT_ITAB-SR = LV_SERIAL_NO.

*ENDLOOP.

but the internal tabe SR is starting with 0..

sr

0

1

2

.

pls help me.

1 REPLY 1

bala_sikkal
Explorer
0 Kudos
57

Try this..

LOOP AT IT_ITAB.

if sy-tabix = 1.

LV_SERIAL_NO = 0.

else.

LV_SERIAL_NO = LV_SERIAL_NO + 1.

endif.

IT_ITAB-SR = LV_SERIAL_NO.

ENDLOOP.