I would do this with excel. Download PERNR ENDDA and BEGDA to excel.
Image may be NSFW.
Clik here to view.
1. In row 1 enter any record i.e. as I have done.
2. In cell D2 enter formula =IF(AND(A2=A1;C2<B1);1;0)
3. In cell E2 enter formula =IF(AND(A2=A3;B2>C3);1;0)
Then you can do special paste values only, then remove all rows where D and E = 0, and all other rows are relevant for amending. You can then, with a bit of manipulation use the same file for your LSMW.
Image may be NSFW.
Clik here to view.