SE91 and MESSAGE statements only accept 4 variables in short text, but long text may also contain some system variables like &SY-DATUM& and (less known) some customer defined variables.
Create a message with a long text : add some variables in it, e.g. &V1&, &SY-DATUM& and &TEST&
Now before the message statement, pass the customer variable (to SapScript actually)
lv_name = '&TEST&'. lv_var = 'This is a test'. CALL FUNCTION 'SET_TEXTSYMBOL' EXPORTING name = lv_name value = lv_var value_length = 30. MESSAGE s001(zrgs) WITH 'A' 'BB' 'CCC' 'DDDD'.
Now double click on message (or use an Information type to trigger popup) and your &TEST& will be replaced with the short text.
Regards,
Raymond
PS: As the variable are temporary stored in memory, if you use this trick in a background job, they will no longer appear during log display ()