abapsap-selection-screens

Compilation of SELECTION-SCREEN fails


What's wrong with the following ABAP code block? Compilation of the program does causes an error, but no details are shown. Please suggest changes in the code so it works

REPORT  ZSELECTIONSCREENCOMMENTS.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TIT1.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 20.
PARAMETERS: P_MATNR LIKE MARA-MATNR, P_ERSDA LIKE MARA-ERSDA, P_ERNAM LIKE MARA-ERNAM.
SELECTION-SCREEN COMMENT 1(12) COM1 FOR FIELD P_MATNR.
SELECTION-SCREEN COMMENT 1(12) COM2 FOR FIELD P_ERSDA.
SELECTION-SCREEN COMMENT 1(12) COM3 FOR FIELD P_ERNAM.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK B1.
LOAD-OF-PROGRAM.
TIT1 = 'Selection-Criteria'.
COM1 = 'Material No'.
COM2 = 'ERSDA'.
COM3 = 'ERNAM'.

Solution

  • You are trying to place multiple comments at the same position within a single line (BEGIN OF LINE ... END OF LINE block), and you are adding multiple parameters to that single line without specifying positions.