2006 Dec 01 9:33 AM
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.
2006 Dec 01 9:37 AM
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
2006 Dec 01 9:34 AM
2006 Dec 01 9:37 AM
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
2006 Dec 01 11:00 AM
2006 Dec 01 11:05 AM
2006 Dec 01 11:11 AM
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
2006 Dec 01 9:39 AM
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