Sunday, February 2, 2020

KE51 transaction how to make field (Address) required in SAP ABAP.


KE51 transaction how to make field (Address) required in SAP ABAP.
SAP does not provide any configuration and user exit to make fields in Address tab required in transaction KE51.After that debug ABAP Code, I found the way that you need to create enhancement point in include program LRKPMF05 in subroutine md_user_command_handle.

This example we want to make field Street, City, Country and Region is required when user click SAVE. Please check out this ABAP Code below.
FORM md_user_command_handle CHANGING p_fcode.
1) Form MD_USER_COMMAND_HANDLE, Start                                                                                                               
ENHANCEMENT 1  ZIMP_CO_REQUIRED_ADDR_KE51.    "active version
IF md_fcode = 'MD_SAVE'.

IF PRCT_V-STRAS EQ ''.
  MESSAGE 'You must input Street' TYPE 'E'.
ENDIF.


IF PRCT_V-ORT01 EQ ''.
 MESSAGE 'You must input Kota' TYPE 'E'.
ENDIF.

IF PRCT_V-LAND1 EQ ''.
 MESSAGE 'You must input Country' TYPE 'E'.
ENDIF.

IF PRCT_V-REGIO EQ ''.
 MESSAGE 'You must input Region' TYPE 'E'.
ENDIF.

ENDIF.
ENDENHANCEMENT.

No comments:

Post a Comment