SAP Data Migration – Dealing With Fallout (Part 3)

One of the inevitable aspects of data migration is dealing with fallout from automated data loads.  Typically, this process includes identifying the data that will not load, analyzing the error messages to determine the root cause, formatting a readable report that can be used as a tool in the cleanup process, and fixing the root cause of the problem so that it does not happen again.

Why the data will not load correctly.

There is a litany of reasons why some data records will load correctly while others will not.  Here is a list of some common root causes:

 

  1. Poor quality legacy data.
    Legacy systems which are not as tightly integrated as SAP, and are not under master data control allow the end user a bit of freedom when entering data.  A zip code may contain too little or too many characters; the email address is not properly formatted; numeric fields have transposed digits; various forms of abbreviations (especially in the city field), a quantity of zero (0) permitted by the legacy system and uploaded into a field where SAP will not accept a quantity of 0 and even simple misspellings  all can cause stringent validation checks to trigger an error and prevent the record from loading at all.  A more sinister type of error occurs when the data is functionally incorrect, but good enough to pass all of the SAP validity checks.  In this case, the data record will technically load into SAP, but will not be functionally correct.  Duplicate customers, duplicate vendors, and the data entry error for a quantity of 1000 instead of 100, and the wrong pricing condition applied to a sales order line are examples of this scenario.

 

 

  1. Functional configuration and supporting data effects.
    Many times I have watched the load statistics for a data object plummet from near 100% in the cycle two test load to near 0% in the cycle three test load.  This is very unnerving to the client because the cycle three test load is getting rather close to the go-live date, and “by the way, shouldn’t the statistics be getting better rather than worse?”  Functional configuration changes can wreak havoc on any data load.  Flipping the switch on a data field from optional to required; turning on batch management or serialization for materials for the first time; changes in the handling of tax, tax codes, and tax jurisdiction codes; that account determination entry that is missing or not set up correctly; a missing unit of measure or unit or measure conversion factor; the storage location in the upload file which does not exist in SAP – any of these can cause a load to drop mostly or completely onto the floor.While change is inevitable on any project, it is important to control and communicate the change so that the downstream impact can be recognized and understood.   Controlled change and communication always works better than total surprise.  Perhaps if we all know ahead of time about that data field that is now required, we can impose a requirement on the data extract side to make sure that the data field is populated before it enters the upload file. 
  2. Additional data in the upload file.
    Inserting a new field in the middle of the upload file data structure might be necessary for the business to close a gap, but if that change is not communicated to the technical team so that appropriate adjustments can be made to the load object’s input structures and processing logic, the new data will surely never load, and may cause misalignment of the data fields which follow it in the upload structure.

[Read more...]

Using Native SQL in an ABAP Proxy

Recently, I was looking at a requirements document to build an interface to an external system that wants to query customer master data by the customer first name and last name.  As I read this, there were a cacophony of thoughts, all demanding equal attention, racing through my head:

  • How will I ever match the inbound interface parameter “Tom” with “TOM”, or “tom”?
  • How will I ever match the inbound interface parameter “Smith” with “SMITH” or “smith”?
  • The ABAP WHERE clause is not case-INsensitive.
  • There could be hundreds of customers named Tom Smith.
  • KNA1-NAME1 and KNA1-NAME2 are not indexed fields.
  • And no, we are not storing any portion of either first or last name in an existing indexed field like SORTL.
  • There are well over one million customers in the database.
  • We have already decided to use PI for all interfaces.
  • I will have to buy the BASIS team a case of beer to get them to agree to create indices on the fields KNA1-NAME1 and KNA1-NAME2 in a table with over one million records.

I arrived at the conclusion that I need a case-insensitive database query, along with database indices created for the fields KNA1-NAME1 and KNA1-NAME2.

But, what is a case-insensitive WHERE clause?  A little research and help from colleagues revealed that many had gone before me, and this was nothing new.  To implement a case-insensitive WHERE clause in ABAP, you simply needed to use the native SQL UPPER() construct. The database system that is being used is Microsoft SQL Server, but the UPPER() function and its syntax is similar across different database platforms. This seemed like an easy nut to crack. But, as I soon found out, I actually had a lot to learn.
[Read more...]

Too Many Developers Spoil The Code

You may have heard the following idiom before:

Too many cooks spoil the broth

The common meaning extracted from this saying is that too many people working on a single task tend to make a mess of it.  But, what happens when you have too many developers working in a single piece of ABAP code?  That’s right, you get a big mess.  This issue is especially difficult to deal with when there are multiple functional requirements leveraging the same custom code object, form-based user-exit, or function-based user-exit.

While current releases of SAP (those built on SAP NetWeaver 2004s and later) have good built-in handling of enhancements and customizations via implicit and explicit enhancement points and BADIs, there still exists many old-school user-exits.

Multiple Developers; One Code Object

I recently worked on a project where three separate developers were creating three separate interfaces based on the outbound delivery IDOC.  While the development for all three interfaces was occurring at the same time, the go-live date for each of the interfaces were different (we’ll discuss that project management glitch at another time).  Each interface required a separate set of custom fields and, therefore, it’s own IDOC extension.  The problem is there is only one appropriate user-exit in IDOC_OUTPUT_DELVRY and three developers needed to be developing in it at the same time!

How did we solve this problem?
[Read more...]

How To Debug ABAP Web Service on SAP Web Application Server (WAS)

One of the more confounding aspects of developing in the SAP space is the lack of good, low-level, helpful instructions.  While this post is merely regurgitating information that is readily available elsewhere, it will be done in a manner that (hopefully) will actually be useful to vast majority of ABAP developers out there that,  like me, find a lot of SAP’s implementation of web services on the ABAP stack confusing.

Debugging a web service on the ABAP stack of SAP Web Application Server is a very useful procedure to know.  Here’s how you do it.

[Read more...]

Changing The Function Interface of Web Service Enabled Functions

Today, I got an email from one of my co-workers at my client with a very good question.  This developer had created an ABAP function to return SAP data.  Then, he exposed this function as a web service. Due to changes in functional scope, he had to change the function interface.  After he made all his changes and unit tested the ABAP code, he was surprised to find that his web service was still adhering to the old function interface.  He tried deleting and recreating the web service, but ran in to problems.  He was stuck in a pickle and needed a little push in the right direction.

[Read more...]

Discovering Something Old in SAP – Using an External Program as a Batch Job Step

Occasionally, I have the opportunity to utilize a feature in SAP that I have never used before.  It is not necessarily a new feature, and it may have existed in SAP for several releases.  There are several reasons for ignoring new functionality, but the primary reason that comes to mind is “I’ve always done it this way, I’ve installed hundreds of these, and I know it works”.

Sometimes, a special business or security requirement does not permit the “business as usual” scenario.  It is these situations which nudge me down the path which I have never explored.

[Read more...]