Create spool to display it later in SP01, SP02…
With code below, you can easily add lines in spool like that :
ls_text-color = c_color_jaune.
CONCATENATE 'Error on PN' lw_matnr INTO ls_text-text SEPARATED BY space.
APPEND ls_text TO gt_text.
CLEAR ls_text.
ls_text-color = c_color_rouge.
APPEND ls_text TO gt_text.