Can you try whether this simple logic suits your purpose?
PARAMETERS: bukrs type bukrs .
SELECTION-SCREENCOMMENT /10(30) comm1.
PARAMETERS: matnr type matnr.
SELECTION-SCREENCOMMENT /10(30) comm2.
AT SELECTION-SCREEN.
AT SELECTION-SCREENOUTPUT.
ifnot bukrs isINITIAL.
if bukrs ne'1000'and bukrs ne'2000' .
comm1 = 'Enter valid company code'.
else.
clear comm1.
endif.
else.
clear comm1.
endif.
if matnr CA'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.
comm2 = 'Enter valid material no'.
else.
clear comm2.
endif.
Here if the company code is not 1000 or 2000, it will give the error msg below company code parameter and if the material number contains alphabet, it will give error message below the material number
Output.