The drag queen message
2011-10-31
The AT SELECTION-SCREEN modules of a report can throw error messages and send you back to the selection screen. But once you get past the START-OF-SELECTION, if you get an error message, the program ends. The solution to getting an error and returning to the selection screen, is to disguise the message:
START-OF-SELECTION.
IF condicao_desejada.
MESSAGE S208(00) with 'Erro!' DISPLAY LIKE 'E'.
EXIT.
ENDIF.
WRITE 'Olá, eu sou o resto do programa'.
The type S message pretended to be type E. It seemed to be E - but it was joking.
If you try it out, you’ll see that the system returns an error but it does not exit the program completely; it goes back to the selection screen and does not run the rest of the program (because of the EXIT).
Thanks to Sérgio Lopes for this tip.
And thanks to Tiago Celestino for the photo
Greetings from Abapinho.