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
795

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.

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

anversha_s
Active Contributor
0 Likes
766

hi,

1. create a field in internal table that u passing in ALV.

2. increment it when each record appends.

3. show this field as seriel num in ALV.

Rgds

Anver

Read only

Former Member
0 Likes
766

hi ravi

i have replied to your previous thread and here also.

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 col_pos are uniquely defined or not like 1, 2, 3 etc

just check this

shiba dutta

Read only

0 Likes
766

HI SHIBA,

NW ITS WORKING,I APPLIED LIKE THIS....THNX ALOT.

bye TC.

data:id type i.

loop at itab_final.

itab_final-id = sy-tabix.

modify itab_final .

endloop.

Read only

Former Member
0 Likes
766

in ur internal table declare a field with type n.

now, loop at internal table.

field = 1.

modify internal table index sy-index.

clear internal table.

field = field + 1.

endloop.

Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
766

Hi,

What i undersatnd is taht in ALV Grid u need to dispaly serial numbers before each row data . So u can declare an varaible an increment the count by one each time u fill the internal table , so u ll get theserial nos as the no. of records in ur table and dispaly the same in ALV.

Hope this helps.

Read only

Former Member
0 Likes
766

hi,

from the internal table make use of sy-tabix to get the serial number ..

 loop at itab.
  write sy-tabix.
 endloop.

or you can use SNRO tranasaction to crearte a number range object and use FM <b>'NUMBER_GET_NEXT</b>'.

rEGARDS,

Santosh