We are implementing a CRM system, and need to extract customer details held in SAP. An Abap Program has been written to extract all of the information that we need.
We anticipate that after the full extract we will need to extract those customers whose details were created or changed after the initial extract. Transaction OV51 will display the changes to the customer. These changes are held in tables CDHDR and CDPOS.
But I cannot find a link between the customer number KNA1-KUNNR, and CDHDR.
Meanwhile, OV51 is a display t-code and won't update CDHDR. The t-codes for the change are VD02 or XD02. These are the t-codes that will write records to CDHDR.
The customer number, KNA1-KUNNR, can be found in CDHDR-OBJECTID. Be aware that numbers are stored as text with leading zeros. So if your KUNNR is 8000000, then OBJECTID will be 0008000000.
Also, be careful using CDHDR in custom ABAP programs. For example, when I changed the street address on a customer it created TWO records in CDHDR.