Get customer address

Get customer address

ABAP code to get address from KUNNR (customer number) :


    SELECT SINGLE tsad3t~title_medi AS title, but000~name_org1, but000~name_org2,
                  but000~name_org3, but000~name_org4, adrc~po_box, adrc~street,
                  adrc~post_code1, adrc~city1, adrc~tel_number
      FROM but000
      LEFT OUTER JOIN tsad3t ON tsad3t~title = but000~title " Get the title (and 
                            AND tsad3t~langu = @sy-langu    " not the code)
      INNER JOIN but020 ON but020~partner = but000~partner
      INNER JOIN adrc   ON adrc~addrnumber = but020~addrnumber
      INTO @DATA(ls_customer)
      WHERE but000~partner = @lv_kunnr. " <== Specify customer number

About the author

fjourneau administrator

Hi, I'm Florian Journeau, SAP ABAP R3 Freelance, based in Toulouse, France. You want to know more about me, have a look on my CV : cv.fjourneau.net.

Leave a Reply