We have an customer base of over 600,000 customers. Because SAP does not store pre formatted address lines in a table, we cannot simply access the addresses but have to instead run each customer’s record through function module ADDRESS_INTO_PRINTFORM. The processing time of doing this is considerable (over eight hours for 600,000 plus customers). We want therefore to be able to generate a table of pre-formatted address lines, which gets updated only when an address changes, and since address data does not change that often for an individual or company, the updating of the pre-formatted address table should be minimal.
There are huge benefits to having address data pre-formatted in this way. For one, an SQL join to a pre-formatted address table to retrieve address data will be massively quicker than running each customer through ADDRESS_INTO_PRINTFORM. Secondly the query can run on S4HANA database with no need to interact with the ABAP layer to get the address, and thirdly, by having addresses in this format they are instantly available for use in CDS views for OData Services and Fiori reports without the need to touch the ABAP layer.
The problem is, how do we identify when an element of the formatted address changes, in order to update the formatted address table? ADRC does not contain an audit stamp for the date any change was made to it. BUT000 does contain an audit stamp change date, which may be useful, but more likely we need to see the change history data for a BPs associated current address, and find out the created date and last change date for this history. A history button exists in the role address screen, but I’m unsure how to get to that data programmatically.
The address elements from ADDRESS_INTO_PRINTFORM that we need to identify when changed are the customers name (line 1 of the address), and any of the address lines.
Seeking suggestions on how to determine when these are changed?
Once the change is able to be identified we simply run a program that initially outputs all ADDRESS_INTO_PRINTFORM required fields into a table with a date each record was added to that table, then each time we need an address we access it from there, check ABAP to see if the address has changed, and if so update it, otherwise leave it alone. This updating can be done on a nightly basis and should take very little time to run, because only ever would a very small percentage of records be changed. The data in the table would then be able to be used daily direct in an SQL join, knowing that at most an address may be 1 day out of date.