Identifying Rows in the ALV Grid Control 
For a large number of methods, you need to identify a row in the ALV Grid Control. To do this, you use the structure LVC_S_ROID in most cases which contains the fields SUB_ROW_ID and ROW_ID. The value of field ROW_ID depends on SUB_ROW_ID:
SUB_ROW_ID is set to 1, if the row is a subtotals line (otherwise, the field is set to 0).
ROW_ID contains the row number of the row. If the row is a subtotals line, this value is negative. The absolute value indicates which subtotals line the row is.