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

regarding serial number

Former Member
0 Likes
806

hi frnds,

i need ur help,i hv to show serial number i.e 1,2,3...... in my program

output.wat shud i do plz help me..i m working in ALV.

looking forward to an early reply..

ravi gupta.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
781

ty this

in your internal table declare a field as id of type i.

after fetching the value in itab.

loop at itab.

itab-id = sy-tabix.

modify itab index sy-tabix.

endloop.

in fieldcatalog just include your id field.

regards

shiba dutta

hi frnds,

i need ur help,i hv to show serial number i.e 1,2,3...... in my program

output.wat shud i do plz help me..i m working in ALV.

looking forward to an early reply..

ravi gupta.

6 REPLIES 6
Read only

Former Member
0 Likes
781

Serial numbers are stored on the table EQUI.

Read only

Former Member
0 Likes
782

ty this

in your internal table declare a field as id of type i.

after fetching the value in itab.

loop at itab.

itab-id = sy-tabix.

modify itab index sy-tabix.

endloop.

in fieldcatalog just include your id field.

regards

shiba dutta

Read only

0 Likes
781

thnx,thnx alot ,the problem has been solved.

bye .tc.

Read only

0 Likes
781

SORRY IT DOESNT WORK.............

Read only

0 Likes
781

just let me know the id value is modifying in itab or not.

pls check that by debugging.

if it is working.

data : wfieldcat type slis_fieldcat_alv,

ifieldcat type slis_t_fieldcat_alv.

then in your fieldcat.

wfieldcat-fieldname = 'id'.

wfieldcat-col_pos = '1'.

append wfieldcat to ifieldcat.

clear wfieldcat.

now check in your fieldcat if any other coloumn you are defining as col_pos '1' or not if it is so change the col_pos .

means check the <b>col_pos</b> are uniquely defined or not like 1, 2, 3 etc

Read only

Former Member
0 Likes
781

hi

add a field in your internal table with type integer.

loop at that table and increase the counter by 1 at each iteration.

display that field as first column. it becomes serial number.

example code:

data: begin of itab occurs 0,

sno type i,

-


type -


,

-


type ---,

end of itab.

--

--

--

loop at itab.

add 1 to itab-sno.

modify itab.

endloop.

hope this logic helps.

thanks

pavan