cancel
Showing results for 
Search instead for 
Did you mean: 

User Eixts / BADI for the cutomer master IDOC (DEBMAS06)

Former Member
0 Kudos

Hi All,

We have requirement to extend the customer master IDOC 'DEBMAS06' to add the address fields i.e (ADRC-STR_SUPPL3,STR_SUPPL4,STR_SUPPL5). Can any one tell me the suitable EXITs or BADI's to populate street3, street4 and stree5 to the customer master. Otherwise can any one tell me how to over come this problem.

Thanks in advance

K N C

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Naveena,

Create a segment with the fields you have hased for and thenextend it and write the code

Create the project in the enhancement" VSV00001 User exit Customer and vendor distribution Receipt/issue

Crearte the code as follows in the function exit( EXIT_SAPLVV01_001) under tthe include as follows:

I have create a zcustomer as the segment so wrote the code according to that.

DATA: WA_ZCUSTOMER TYPE ZCUSTOMER.

DATA: LS_DATA TYPE EDIDD,

LS_E1KNA1M TYPE EDIDD,

LS_SEGMENT TYPE ZCUSTOMER,

LV_COUNT TYPE I.

DATA: L_KUNNR TYPE CHAR10.

DATA: L_ADRNR TYPE KNA1-ADRNR.

CHECK MESSAGE_TYPE = 'DEBMAS'.

CHECK IDOC_TYPE = 'DEBMAS06'.

*IDOC_CIMTYPE = 'ZCUSTOMER'.

READ TABLE IDOC_DATA INTO LS_DATA WITH KEY SEGNAM = 'E1KNA11'.

IF SY-SUBRC = 0.

LOOP AT IDOC_DATA INTO LS_DATA FROM SY-TABIX.

IF LS_DATA-SEGNAM NE 'E1KNA11'.

EXIT.

ELSE.

LV_COUNT = SY-TABIX + 1. "Get the segment position as per IDoc Defn.

READ TABLE IDOC_DATA INTO LS_DATA WITH KEY SEGNAM = 'ZCUSTOMER'.

IF SY-SUBRC NE 0.

READ TABLE IDOC_DATA INTO LS_E1KNA1M WITH KEY SEGNAM = 'E1KNA1M'.

IF SY-SUBRC = 0.

L_KUNNR = LS_E1KNA1M-SDATA+3(10). "Customer No.

SELECT SINGLE ADRNR FROM KNA1 INTO L_ADRNR "Address no.

WHERE KUNNR = L_KUNNR.

IF SY-SUBRC = 0.

SELECT SINGLE STR_SUPPL3 LOCATION CITY2 FROM ADRC INTO WA_ZCUSTOMER

WHERE ADDRNUMBER = L_ADRNR. "Required fields

IF SY-SUBRC = 0.

LS_SEGMENT-STR_SUPPL3 = WA_ZCUSTOMER-STR_SUPPL3.

LS_SEGMENT-STR_SUPPL4 = WA_ZCUSTOMER-STR_SUPPL4.

LS_SEGMENT-STR_SUPPL5 = WA_ZCUSTOMER-STR_SUPPL5.

ENDIF.

ENDIF.

ENDIF.

Edited by: Farhy Farhy on Sep 24, 2010 12:19 PM