ZZXREFDETAIL–SAP’s Dreaded Universal Cross Reference Table (…that your favorite SAP functional consultant hates to see)

Posted by Vortex Team

SAP Architect Matthew Montano continues his series on the Vortex Consulting blog:

I think the Las Vegas odds are good that your SAP ERP system has a custom table starting with Z and a name like ‘XREF…’.

Why am I so sure that’s a safe bet?

After 25 years, I’ve seen far too many SAP functional consultants and developers stumble across a requirement where the answer is to utilize a cross reference table. The solution inevitably ends up being a custom database Z Table. (Of course, there is always the question as to why custom code was needed in the first place…you can read more about my thoughts on that in my previous blog post on custom SAP ABAP source code.)

More often than you realize, the implementation of a quick custom database Z Table means skipping all of the additional documentation that a custom solution would warrant. Conversely, using SAP in the manner it was intended can minimize or eliminate the need for additional documentation and security controls. 

And, of course, quick solutions are almost always shortsighted–focusing on a solution for now and not how it might support the next similar requirement.

A good SAP functional consultant can avoid inadvertently creating a house of cards combination of custom tables and custom code and additional unique dependencies. You definitely want to avoid the “short blanket syndrome” where you leave your feet cold for no reason.

Vortex SAP functional consultant sitting at computer with complex SAP data chart with many rows on screen.

So here’s what the process might look like:

It all starts with a simple “If the Sales Area is X, then set the flag to Y.”

Everyone gets excited that the business requirement has been quickly addressed with the ~magic~ of the Z Table.

Then other custom functionality uses the same Z Table.

Then someone forgets to update the table.

Then someone updates it incorrectly (maybe with something as simple as entering an O versus a 0?).

Then someone forgets to update the documentation that describes how to update the table.

Then someone corrupts the table.

Then the table is not included in the system backup.

Then an auditor asks why a single user has single and solitary control over dozens of core functions of your SAP system.

It never ends well.

Graphic with text stating that SAP functional consultant can offer better solutions than a custom Z Table.

In almost all cases, your SAP functional consultant can offer a better solution that respects all key aspects:

  • Maintains data integrity
  • Ensures security
  • Delivers appropriate validation

It often takes a few extra lines of code to retrieve the data, but the benefits of everything that SAP already provides is almost free. 

Below are some ideas so you too can avoid the dreaded Z Table.

Do you need a value that is different by customer, vendor, or material? Store it along with the rest of the Business Partner (Customer or Vendor) or Material data. There are numerous existing fields that might already suit your requirement. If not, adding additional characteristics is easy for a well-versed SAP functional consultant.

Do you need to track a value that varies by Sales Area or Purchasing Organization? Why not create a customer or vendor with a fixed partner number and store the data there? 

For more complex requirements, SAP has built an entire toolkit named Business Rules Framework plus–or simply BRFplus–that provides an entire infrastructure to securely store and validate cross-reference data. A small learning curve can yield extensive benefits.

There are numerous other SAP-supported capabilities to store data within SAP GTS, SAP CRM, the IDoc/ALE Integration, and more. Use them!

So, the next time someone suggests using a Z Table to store data, stop them. It is absolutely worth the investment for the long-term stability of your solution to ensure that critical data is stored in the right place so it is subject to the correct validation, security, and retention controls.

If you feel your project needs assistance in finding better solutions to meet your business requirements, please do reach out to Vortex. SAP functional consultants are at the center of our ERP solutions offering. Contact us today to get the conversation started.

SAP Architect Matthew Montano

About the Author: Matthew Montano is a Vortex Consulting SAP architect with more than 25 years of experience in Electronic Data Interchange, Supply Chain Integration, and Third-Party Logistics. His passion for good documentation and streamlined work process has yielded measurable results for clients in the consumer packaged goods, life sciences, manufacturing, and transportation industries across both the United States and Canada.

Check out his previous blog posts here: Why Years of SAP ERP Experience Makes Me Question if You Really Need that Custom Code / Time Zones in SAP: Let’s Dig In / Daedalian ABAP Source Code (aka Throw us Old Folks a Bone)