I'm maintaining a BAdI and there is some code that would be repeated on a number of cases.
If using plain ABAP then I would simply put this code into a subroutine and use PERFORM.
But as I am in BAdI the OO ABAP will not allow this.
Seems to be a lot of work to now create a class just to save repeating some code....is there a better way or will I need to create a class for this.
For example;
Method
....
....
IF test = A
code line 1
code ine 2
IF test = B
code line 1
code ine 2
...
endmethod
So in this case I would like to not repeat code line1 and 2 but place this in a "routine" like so
method...
...
IF test = A
PERFORM codelines
IF test = B
PERFORM codelines
....
endmethod.
Routine codelines
code line 1
code ine 2