09-18-2007 6:58 PM
i need to add column to show the row no. of the report say as :
1
2
3
...
this has to be the first column
how to maintain a variable for this and how to use it??
please help
09-19-2007 6:54 AM
one simple way is in your final itab declare a slno type i field
data : begin of itab occurs 0,
slno type i,
<other fields>
end of itab.
after filling the data in itab.
loop at itab.
itab-slno = sy-tabix.
modify itab.
endloop.
in fieldcatalog also you have to define that slno field as the first column.
but it will change its order if you are sorting the output or filtering the output.
regards
shiba dutta
09-18-2007 7:02 PM
HI,
Declare a variable of type i as the first variable in your internal table .. and while populating the records into ur internalt able increment the counter an put that value in this first field.
Thanks
Mahesh
09-18-2007 7:30 PM
pls support ur suggestion with example code..
how to print in grid ..how to pass the value .....where to increment...
pls help
09-18-2007 7:46 PM
pls can you tell how to put the value in the field and where to initialize the variable???
09-19-2007 6:50 AM
Mahesh,
can you pls help me with some sample code on this...i really need it urgently...
thank you
09-18-2007 7:06 PM
Hi,
In your final internal table, while processing the data increment the counter.
And fill this field in the field catalog and display using ALV.
Thanks,
Sri.
09-18-2007 7:08 PM
can u pls help me with some lines of code..
im new n have no idea as to how to proceed
09-19-2007 6:54 AM
one simple way is in your final itab declare a slno type i field
data : begin of itab occurs 0,
slno type i,
<other fields>
end of itab.
after filling the data in itab.
loop at itab.
itab-slno = sy-tabix.
modify itab.
endloop.
in fieldcatalog also you have to define that slno field as the first column.
but it will change its order if you are sorting the output or filtering the output.
regards
shiba dutta
09-19-2007 7:20 AM
thanks a lot..it worked
just one more thing..im not getting the heading of this column ..where to give that??
09-19-2007 11:11 AM
i think in fieldcatalog of the alv you dint define the seltext_l
just define the fieldcatalog like this
fieldcat-fieldname = 'SLNO'.
fieldcat-col_pos = 1.
fieldcat-outputlen = 5.
fieldcat-seltext_l = 'S.No.'.
append fieldcat to ifieldcat
regards
shiba dutta