You can try with field LFBNR,
I will tell you the effect...
When you do GR, the this field will update with same GR document..
When you cancel the GR, then this field will update with original GR document...
You have write logic like that..
If system find the value from LFBNR, and it will match on MBLNR, then this is the original GR document...
And when system found value in LFBNR, and it will not match with MBLNR, then this is reversal document...
You can also go with the movement type (field BWART) on MSEG table,
The 101 movement type will be GR document and the 102 movement type will be Reversal document...
The same can be happens for field SHKZG..
S = Gr document..
H = Reversal Document ..