Fire up transaction SE39. Enter your 2 ABAP program names, 1 on the left and 1 on the right, then press enter. You will see the 2 programs in the split screen editor. Now select the “Compare” icon (Ctrl+Shift+F11). The system will show you the different lines in the code by highlighting them in blue. (Press Ctrl+Shift+F10 to see the next difference.)
Note: You can also use this transaction to connect to another system via RFC to compare code between systems.