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

dynamic serail numbers

Former Member
0 Likes
760

Hi all,

i have an internal table it_item with fields it_item-matnr ,it_item-desc and ...

to display in the form i need to get the serial nos dynamically if i have more than one matnr exists.

waiting for reply.

regards

akmal

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
732

simply add one more column to ur itab called as SNO and then fetch data from the corresponding fields of ur table ..after tht -

loop at itab.

itab-sno = sy-tabix.

modify itab index sy-tabix.

endloop.

so records will now have serial numbers.

amit

Message was edited by:

Amit Tyagi

5 REPLIES 5
Read only

Former Member
0 Likes
733

simply add one more column to ur itab called as SNO and then fetch data from the corresponding fields of ur table ..after tht -

loop at itab.

itab-sno = sy-tabix.

modify itab index sy-tabix.

endloop.

so records will now have serial numbers.

amit

Message was edited by:

Amit Tyagi

Read only

0 Likes
732

please write more precisely the modify statement.

ragards

akmal

Read only

alex_m
Active Contributor
0 Likes
732

Hi,

What is your requirement, why u need serial number here?....

Read only

Former Member
0 Likes
732

hi,

i require serial nos to display in my form.if there is one entry it should have a number 1 in the sl.no column n if there are more than one entries it shoukld get it dynamically.hope u got it.

regards

akmal

Read only

Former Member
0 Likes
732

are you taliking about the repeatation of material no?

then the code

data : counter type i.

sort itab by matnr.

loop at itab.

at new matnr.

clear : counter.

endat.

counter = counter + 1.

itab-slno = counter.

modify itab index sy-tabix.

endloop.

it will show

1 m1

2 m1

3 m1

1 m2

2 m2

like this if you want any other thing let me know.

regards

shiba dutta