Skip to Content

How to Validate Address Fields of Vendor Master XK01/XK02

Can Anyone help me to validate Address Fields (Street, Street 2, Street 3, Street 4, Name 1 , Name 2 ) of Vendor Master -XK01/XK02.

I have a requirement to add field length restriction for specific companies.

I've found BADI - ADDRESS_UPDATE but it's not suitable as company field is not available.

Thanks in Advance.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Apr 26 at 08:24 AM

    See if you can use the UserExit "EXIT_SAPMF02K_001" for this (Prgr. "ZXF05U01") as the Address-Handle is provided ...

    Add comment
    10|10000 characters needed characters exceeded

    • Either through the mentioned UserExit or Badi, you could read the Address-Data from Memory.

      Go into Debugging, put BREAK and check "(SAPMF02K)ADDR_COMPLETE-ADDR1_TAB[1]-DATA" ...

      That should offer you the Data as is it Put on the Screen Fields of the transaction.

      Using this construct in your Code in the UExit or the BAdI will provide your with the Address that is entered on the Screen.

  • Apr 26 at 09:28 AM

    You could try BAdI ADDRESS_CHECK method ADDRESS_POSTAL_CHECK. Don't use BAdI ADDRESS_UPDATE which is not suitable to perform some custom check.

    To get the company code value, you could either use memory-id BUK or export the field (and others if required) to memory in a vendor master data exit such as BAdI VENDOR_ADD_DATA[_CS] or exit SAPMF02K/EXIT_SAPMF02K_001 and read them in the address BAdI.

    Question: But the address (LFA1-ADRNR) is not dependent on the company code, so check exact requirement with functional? What should be done for vendor defined for multiple companies, should you also look for other LFB1 records in database to get the more restrictive rule?

    Add comment
    10|10000 characters needed characters exceeded

    • The enhancement you look for should be in an address function group, so in some SAPLSZA1 main program. Navigate from a test session to dynpro field, F1, tech info, double-click on dy npro Nr to PAI logic and from MODULE to FORM statement.