sort table itab by vbeln posnr.
read table itab index 1.
ranges-low = itab-vbeln.
clear itab.
describe table itab lines w_line.
read table itab index w_line.
ranges-high = itab-vbeln.
ranges-sign = 'I'.
ranges-option = 'BT'.
append ranges.
This is surely help u.