PARAMETERS VALIDATION

CODE :

TABLES: mara.

SELECTION-SCREEN BEGIN OF BLOCK b1.
PARAMETERS : p_matnr TYPE mara-matnr.
SELECTION-SCREEN END OF BLOCK b1.

"VALIDATIONS

AT SELECTION-SCREEN ON p_matnr.
"IF EMPTY
IF P_matnr IS INITIAL.
MESSAGE 'Parameter IS EMPTY' TYPE 'I'.
ELSE.
"INVALID INPUT
SELECT SINGLE matnr FROM mara WHERE matnr EQ @p_matnr INTO @DATA(lv_pmatnr). 
IF sy-subrc <> 0.
MESSAGE 'MATERIAL NUMBER NOT FOUND IN MARA' TYPE 'I'.
ENDIF.
ENDIF.

OUTPUT SCREEN : 

In order to validate it let us take 2 cases:

  • case 1 : Empty Input
  • case 2 : Invalid Input

CASE 1 : EMPTY INPUT

POST EXECUTING THIS POPUP WILL BE SHOWN 

CASE 2 : INVALID INPUT

POST EXECUTING THIS POPUP WILL BE SHOWN :

NOTE : THIS CODE IS JUST FOR DEMONSTRATION PURPOSE , YOU CAN MAKE THE CHANGES ACCORDING TOP YOUR REQUIREMENTS

Be the first to comment

Leave a Reply

Your email address will not be published.


*