Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata

To give custom message for a mandatory field of a selection screen  (i.e scr number 1000) .

Remove the obligatory when declaring parameters

Then  write loop at screen code at selection screen output event , this will make the screen field look like a mandatory one i.e with a checkbox.

Error rendering macro 'code': Invalid value specified for parameter 'lang'
*----------------------------------------------------------------------*
* AT SELECTION SCREEN OUTPUT                                           *
*----------------------------------------------------------------------*
AT SELECTION-SCREEN OUTPUT.
  LOOP AT SCREEN.
    IF screen-name = 'S_SUBTY-LOW'.
      screen-required = '2'.
      MODIFY SCREEN.
    ENDIF.                             " IF screen-name = 'S_SUBTY-LOW'.
  ENDLOOP.                             " LOOP AT SCREEN.

To handle the case where field is left empty use AT SELECTION-SCREEN event.

Error rendering macro 'code': Invalid value specified for parameter 'lang'
*----------------------------------------------------------------------*
* AT SELECTION SCREEN                                                  *
*----------------------------------------------------------------------*
AT SELECTION-SCREEN.
  IF  sy-ucomm EQ 'ONLI'.
    IF s_subty IS INITIAL.
      MESSAGE 'Enter Appraisal Type'(049) TYPE 'E'.
    ELSE.
      PERFORM validate_subty.
    ENDIF.                             " IF s_subty IS INITIAL.
  ENDIF.                               " IF  sy-ucomm EQ 'ONLI'.

 

This will execute only when F8 is pressed and give an error if the field is left empty else validate the subtype.

Hope this helps.

  • No labels

1 Comment

  1. HELLO,

    the second paragraph is ok .

    but in the first paragraph  "screen-required='2' (look like as a mandatory field ) i don't see this , because in execution i don't see anything that change .but with ='1' the  execution is stopped if the field is empty.???? i don't see the différence