We all know that WITH HEADER LINE is obsolete in ABAP Objects. But it you can still use it in procedural programming. I am sure, after reading this you would agree not to use it.
At one of the client’s place, we have implemented lot of Interfaces. Inbound IDocs were used widely to implement majority of the interfaces. Inbound interfaces uses the process code to process the business logic. This process code is attached to a Function Module. Generally this FM would be extract Inbound IDOC data, Validate them, Process Business Functions or call BAPI, Populate Status table and Clear Global Variables.
Consultant 1 has implemented the logic and is working as expected with low volumes. When the Volume gets increased, interface started complaining about the performance. Consultant 2 has found that the clearing the global variables is not implemented in the FM. Because of this same data was keep on repeating. Since the business purpose was to only update certain things, it was not actually creating any new transaction documents. So, Consultant 2 has implemented similar to this code:
clearing - version 1
clear: i_data, i_messages, i_var2.
On one fine day, when the interface went live in the production and the partner system sent all of the business transactions at once, support team noticed exceptional increase in the DB. So, Consultant 3 found out that there are lot of IDOCs created for the interface with thousands of Status messages – totaling to few millions.
After research consultant 3 figured out that the clear statements introduced in the inbound process code FM are incomplete. It revealed that the table I_MESSAGES which is being moved to Status messages of the Inbound IDOC was declared WITH HEADER LINE. Due to this fact, it makes the changes done by Consultant 2 as incomplete. They should be like this. Consultant 2 made changes and had moved to production. Life came to normal!
clearing - final version
clear: i_data, i_messages, i_var2. refresh: i_messages.
Why it was missed as WITH HEADER LINE table was used along with the other tables which are defined by the type. So, those tables were getting cleared with the simple CLEAR statement. Clear on I_MESSAGES was only clearing the header line.
Now, the discussion has been started to remove those unwanted status messages as they were occupying space. It was also degrading the performance, as table was huge and taking more time to process each request. It has been decided to archive all those IDOCs. Consultant 3 went ahead and schedule a job to remove all those IDOCs.
As I mentioned earlier, there were huge number of records to be deleted. System suddenly stop creating IDocs while job was running. Due to this problem all of the interfaces stopped working as System has locked the entire Status table. System couldn’t find any more memory to perform the delete operation and it gave. System has started rolling back the changes. This Rollback would was going on and on. It took long long time of about 8 hours to finish. Till this time all the interfaces were stopped, all the jobs were put on hold, system was on its knees.
Too much effect of HEADER LINE!
You can outline these lessons:
- Don’t use WITH HEADER LINE along with other tables declared by TYPE. If possible, refrain using HEADER LINE.
- Schedule deletion jobs with smaller chucks with often commit
Have you even faced this type of problems?