Monday, March 16, 2009

Modifying Structures of table containing data

> I need to add a new field to the structure of an existing table which> contains data.Is there any risk of losing the data if the structure is> modified.
A1:
Use append structure and there is no risk.Recently I have extended VEKP (Shipping unit header) this way.Dominik
A2:
I've had experience with this in the past. I've found that as long as youfollow the SAP recommended approach, which is to create an APPEND structure byhitting the "Append Structures..." button when in Table Display / Change,everything should be okay. This also ensures that your custom data is not lostin the event of an upgrade.
A3:
Remeber these alterations when you, or your Basis staff, upgrades your SAP
system(s). There is a phase in the upgrade where the R/3 tool (transaction)SPDD is executed. SPDD compares SAP tables that are being imported/changedin the applied upgrade with the current state of those same tables in theexisting system. When it detects differences (i.e. customer has addedcustom fields to SAP table) it ASKS you what to do. Your choices are to"Return to SAP standard" or to add the custom fields to "appendstructures".
Returning to SAP standard is easy to explain; the custom fields are droppedand the table is "converted". This means the ENTIRE contents of thealtered table is exported to disk, the table is dropped and re-definedaccording to the current SAP standard for that table (including any new
fields that SAP added during the upgrade) and then the data is re-imported.This means two things: the data in the custom fields is lost forever ANDif the table is huge, the upgrade process takes several more hours to allowfor the table conversion.
If you choose to keep your custom fields during the upgrade, R/3 adds themautomatically to an append structure. Any fields that SAP themselves haveadded to the table are appended to the end of the physical table.
Append structures is an SAP R/3 concept. Logically, it looks like you haveall the fields in one table. In reality, any fields that are part of thetable in a the append structure (look in SE11 for append structureinformation for a table) are actually stored in a separate, R/3 maintained
table. When operations occur against a table with append structures,special ABAP/4 auto-generated routines are executed that use additional SQLto go after the custom fields stored elsewhere through append structures.
The benefit here is that when new "custom" fields are added to an SAP tablewith append structures, the base SAP table is not changed. This means noconversion needs to occur during an upgrade. The problem is that now youhave extra overhead, i.e. 2 reads versus 1, updaters may also experiencehits if fields are indexed, for every access to your table.
Bottom line, you can do this, no problem, but there are down-streamramifications that should be considered....

No comments:

Post a Comment