I've got a fundamental question:
I have to write a program which should give messages about the result of the program run (as nearly every program does 😉 ). In addition to that the result should be sent via email.
I am using a program as template which uses only WRITE statements to achieve that (the business requirements are quite equal). But honestly I don't like that, because you always have a mixture of your business logic with the messages that are written. I prefer to have the messages written at the end of the program.
In former projects I always used the structures BAPIRET2 to store my messages during the program run (I worked a lot with BAPIs at that time). And in the end I used the function BAL_DSP_LOG_DISPLAY or BAL_DSP_LOG_SAVE to show/save these messages.
In your opinion, is that the approach that I should use for the future? Can I combine that with using messages classes? Could you please give me an example?
Or is my approach not the best one? If so, I am open to alternatives...