Register Login

Create User Exit for Customer Master Steps

Updated May 18, 2018

To Create User Exit for customer master follow these steps:-

1. Go to transaction CMOD.
 

2. Put Project as ZPROJ. Click on Change.

3. Click on Enhancement Assignment.

4. Put Enhancement as “SAPMF02D”.

5. Press Enter. Click on Components.

6. Click on “EXIT_SAPMF02D_001”.

7. Click on Include
“ZXF04U01”.

8. Copy the below written code to this include:
*&---------------------------------------------------------------------*
*& Include ZXF04U01
*&---------------------------------------------------------------------*
DATA: it_kna1 TYPE TABLE OF kna1,
kunnr TYPE kna1-kunnr.
DATA: pan TYPE j_1imocust-j_1ipanno,
l_ilen TYPE i.
DATA: wt_t059z TYPE t059z OCCURS 1 WITH HEADER LINE.
DATA : BEGIN OF wt_lfbw OCCURS 0.
INCLUDE STRUCTURE T_KNBW.
DATA : END OF wt_lfbw.
FIELD-SYMBOLS :<fs_pgname1> TYPE j_1ipanno.
ASSIGN ('(SAPLJ1I_MASTER)J_1IMOCUST-J_1IPANNO') TO <fs_pgname1> .
if <fs_pgname1> IS not ASSIGNED.
MESSAGE w000(8i) WITH 'PAN Number is not available.Please update PAN '.
endif.
READ TABLE T_KNBW INDEX 1.
KUNNR = T_KNBW-KUNNR .
CALL FUNCTION 'J_1BSA_COMPONENT_ACTIVE'
EXPORTING
bukrs = T_KNBW-bukrs
component = 'IN'
EXCEPTIONS
component_not_active = 1
OTHERS = 2.
CHECK SY-SUBRC = 0.
pan = <fs_pgname1>.
l_ilen = strlen( pan ).
IF pan = ' '.
MESSAGE w000(8i) WITH 'PAN Number is not available.Please update PAN '.
ELSEIF l_ilen NE 10 .
MESSAGE 'Please enter 10 DIGIT PANCARD NO.' TYPE 'E'.
ELSEIF pan+0(5) CA '0123456789'
OR "q
pan+5(4) CA 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
OR
pan+9(1) CA '0123456789'.
MESSAGE 'PANCARD no should be in the format 1-5 char 6-9 numeric last char' TYPE 'E'.
ENDIF.

9. Activate include, exit and project.


×