09-30-2008 9:09 AM
Hi,
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...
09-30-2008 9:39 AM
Ok, I've no found some interesting example programs in package SZAL (programs SBAL_DEMO_*).
I also found the class CL_SBAL_LOGGER.
I think I will copy this one and add some own code, because I want to display the messages in a hierarchical structure as it is done in SBAL_DEMO_04_DETLEVEL.
The only problem that remains is how to send these logs via email. Could you please advice me on this?