Changing the length of a key field in a table

Hi,
I want to increase the length of the field from 2 to 4 in a standard SAP table and deliver it to the customers. This field is a key field in table. This field from this table is also used in view and view clusters.
What is the implication of changing the length to the customers. The customers would have already data in this field and they should not loose any data. Will the existing data for customers remain at length 2 or do they have to do some conversion?
Regards,
Srini.
Edited by: Srinivasa Raghavachar on Feb 7, 2008 12:45 PM

hi,
The database table can be adjusted to the changed definition in the ABAP Dictionary in three different
ways:
By deleting the database table and creating it again. The table on the database is deleted, the inactive
table is activated in the ABAP Dictionary, and the table is created again on the database. Data
existing in the table is lost.
By changing the database catalog (ALTER TABLE). The definition of the table on the database is
simply changed. Existing data is retained. However, indexes on the table might have to be built again.
By converting the table. This is the most time-consuming way to adjust a structure.
If the table does not contain any data, it is deleted in the database and created again with its new
structure. If data exists in the table, there is an attempt to adjust the structure with ALTER TABLE. If the
database system used is not able to do so, the structure is adjusted by converting the table.
Field 1     Field 2,    Field 3
NUMC,6  CHAR 8    CHAR, 60
Field 1    Field 2       Field 3
NUMC,6 CHAR, 8     CHAR,30
The following example shows the steps necessary during conversion.
Starting situation: Table TAB was changed in the ABAP Dictionary. The length of field 3 was reduced
from 60 to 30 places.
The ABAP Dictionary therefore has an active (field 3 has a length of 60 places) and an inactive (field 3
still has 30 places) version of the table.
The active version of the table was created in the database, which means that field 3 currently has 60
places in the database. A secondary index with the ID A11, which was also created in the database, is
defined for the table in the ABAP Dictionary.
The table already contains data.
Step 1: The table is locked against further structure changes. If the conversion terminates due to an
error, the table remains locked. This lock mechanism prevents further structure changes from being
made before the conversion has been completed correctly. Data could be lost in such a case.
Step 2: The table in the database is renamed. All the indexes on the table are deleted. The name of the
new (temporary) table is defined by the prefix QCM and the table name. The name of the temporary
Step 3: The inactive version of the table is activated in the ABAP Dictionary. The table is created on the
database with its new structure and with the primary index. The structure of the database table is the
same as the structure in the ABAP Dictinary after this step. The database table, however, does not
contain any data.
The system also tries to set a database lock for the table being converted. If the lock is set, application
programs cannot write to the table during the conversion.
The conversion is continued, however, even if the database lock cannot be set. In such a case
application programs can write to the table. Since in such a case not all of the data might have been
loaded back into the table, the table data might be inconsistent.
You should therefore always make sure that no applications access the table being converted
during the conversion process.
Step 4: The data is loaded back from the temporary table (QCM table) to the new table (with MOVECORRESPONDING).
The data exists in the database table and in the temporary table after this step.
When you reduce the size of fields, for example, the extra places are truncated when you reload the
data.
Since the data exists in both the original table and temporary table during the conversion, the storage
requirements increase during the process. You should therefore verify that sufficient space is available in
the corresponding tablespace before converting large tables.
There is a database commit after 16 MB when you copy the data from the QCM table to the original
table. A conversion process therefore needs 16 MB resources in the rollback segment. The existing
database lock is released with the Commit and then requested again before the next data area to be
converted is edited.
When you reduce the size of keys, only one record can be reloaded if there are several records whose
key cannot be distinguished. It is not possible to say which record this will be. In such a case you should
clean up the data of the table before converting.
Step 5: The secondary indexes defined in the ABAP Dictionary for the table are created again.
Step 6: The temporary table (QCM table) is deleted.
Step 7: The lock set at the beginning of the conversion is deleted.
If the conversion terminates, the table remains locked and a restart log is written.
Caution: The data of a table is not consistent during conversion. Programs therefore should not access
the table during conversion. Otherwise a program could for example use incorrect data when reading the
table since not all the records were copied back from the temporary table. Conversions therefore
should not run during production! You must at least deactivate all the applications that use tables to
be converted.
You must clean up terminated conversions. Programs that access the table might otherwise run
incorrectly. In this case you must find out why the conversion terminated (for example overflow of the
corresponding tablespace) and correct it. Then continue the terminated conversion.
Since the data exists in both the original table and temporary table during conversion, the storage
requirements increase during conversion. If the tablespace overflows when you reload the data from the
temporary table, the conversion will terminate. In this case you must extend the tablespace and start the
conversion in the database utility again.
If you shorten the key of a table (for example when you remove or shorten the field length of key fields),
you cannot distinguish between the new keys of existing records of the table. When you reload the data
from the temporary table, only one of these records can be loaded back into the table. It is not possible
to say which record this will be. If you want to copy certain records, you have to clean up the table
before the conversion.
During a conversion, the data is copied back to the database table from the temporary table with the
ABAP statement MOVE-CORRESPONDING. Therefore only those type changes that can be executed
with MOVE-CORRESPONDING are allowed. All other type changes cause the conversion to be
terminated when the data is loaded back into the original table. In this case you have to recreate the old
state prior to conversion. Using database tools, you have to delete the table, rename the QCM table to
its old name, reconstruct the runtime object (in the database utility), set the table structure in the
Dictionary back to its old state and then activate the table.
If a conversion terminates, the lock entry for the table set in the first step is retained. The table can no
longer be edited with the maintenance tools of the ABAP Dictionary (Transaction SE11).
A terminated conversion can be analyzed with the database utility (Transaction SE14) and then
resumed. The database utility provides an analysis tool with which you can find the cause of the error
and the current state of all the tables involved in the conversion.
You can usually find the precise reason for termination in the object log. If the object log does not
provide any information about the cause of the error, you have to analyze the syslog or the short dumps.
If there is a terminated conversion, two options are displayed as pushbuttons in the database utility:
After correcting the error, you can resume the conversion where it terminated with the Continue
adjustment option.
There is also the Unlock table option. This option only deletes the existing lock entry for the table .
You should never choose Unlock table for a terminated conversion if the data only exists in the
temporary table, i.e. if the conversion terminated in steps 3 or 4. table for table TAB is therefore QCMTAB.
Hope this is helpful,Do reward.

Similar Messages

  • Change the decimal places of a field in screen table control

    HI ,
    I have a MENGE field having data element as , BSTMG (decimals 3 ).
    This field MENGE , I have used in a table control. The value in this field is filled from a custom Z-table where the same data element BSTMG is used. So , for eq.) value in MENGE field is shown as 6.010
    But the requirement is that the value should be displayed as only 2 decemals i.e.)   6.01
    I dont want to change the domain of the field in the Z-table , to 2 decimal places , because the table is used in other developments also , so it will give a dump there which I have to correct in other developments also.
    So , is there any way to change the decimal places of a field in screen table control , without changing the domain , in the table from where the value is fetched... ????
    Edited by: abhijeet_7013 on Feb 14, 2011 3:18 PM

    Hi, create a structure in local program with same field names and change the TYPE with some 2 decimal domain of MENGE. Populate this local stucture and use it in TABLE CONTROL.
    Hope this helps...
    Cheers

  • Activation error while changing the data type of a field of a table

    hi friends,
    i am facing one problem while changing a data type of a field of a table.
    i just created one table(Yqm32) .i have assigned charcter data type to one field(ztotal_count) .now i want to change this charcter data type to numeric data type.
      while changing to NUMC data type activation error is comming as below.
    Table is not yet classified                           
    Field ZTOTAL_COUNT: Type change                       
      ALTER TABLE is not possible                         
    Structure change at field level (convert table YQM32) 
    Check on table YQM32 resulted in errors   
    Table YQM32 could not be activated                       
    (E- Structure change at field level (convert table YQM32)
    plz suggest.i need to change the data type from char to numc.
    Thanks & Regards

    Hi Pabitra......
    From the SE11 change the table as u wanted and then from menubar select
    UTILITIES--> DATABASE UTILITY
    It will open database utility
    there u select the Activate and adjust database button.
    then the database table will get adjusted.
    just try it once.........
    Suresh......

  • Unable to change the length of field in idoc segment

    Dear all,
    My requirement is to change the length of a field(Z field) in a segment (Z Segment). I tried the following but in vain
    1)Tried to  Cancel the release and then change the length of the domain. Unfortunately it is givin an error saying "Error while resetting release of segment ZC9DEMARA01".
    I also tried cancelling hte release of extension and then cancelled the release of segment
    2) Created a new version, but in new version the earlier fields are diabled. So I am unable to edit.
    I have gone through some of the links available in SDN but I could not solve as I am unable to cancel the release in the first step.
    [Idoc segment field length changes]
    Could you please help me.
    Thanks in advance!
    regards,
    Aravind

    Hello Aravind,
    I Have created one Segment type with some fields, changed the field length also its working.
    just try to cancel the release and change the length of the filed and do it set release again.
    Try it .
    Thanks,
    santhosh

  • Can we change the length of fields appearing in the ALV layout

    Hi All,
    We are using the FM 'REUSE_ALV_LIST_DISPLAY' to display the output.We have a column  Clearing agent status in the output which has 3 lights(Red,Green,Yellow).After getting the output if i change the layout, the output of this column is appearing as description instead af light.
    Eg:For green light,it is 'All approvals are issued'.
    When checked in debugging, I could find out that there is one subroutine 'Column_width_optimize' in which the output length of the columns are getting changed.Initially the output length would be same as data elements length.But once this subroutine runs,the lengths are getting changed.(Clearing agent status if of length : 60,but it is getting changed to 30 which is the length of its description.)
    Now,I want to know if we can change the output length so that i obtain the required output.
    Thanks
    Prathima

    Hi,
    You can change the length in th eoutput by using
    outputlen in fieldcat.
    You can use like this
    w_fieldcat-outputlen = '20'.
    If you want 20 char lenght in the output.
    I think it is useful for you.

  • Can we change the data type of a field based on the value of the field

    HI Gurus,
    My Requirement is as below -- Could you please guide me
    in the Printable Adobe form -- for ex - as usual for dates fields in the Object Pallette the object type is a date/time field  and for quantity/currency fields corresponding fields are taken
    now in case the either the date, quantity or currency is initial in place of displaying 0.00 or empty date we need to display N/A (Not Applicable)
    for this I would like to change the data type of the field
    to put it simply --
    we need to change the data type of date field from DATE&TIME to Char type to hold N/A or  Quantity field to Char field to hold N/A
    how can we realize this in SAP adobe forms
    Thanks in Advace
    Ramchander Rao.K

    Hello Ramchander,
         You cannot change the data type of the field at run time in Adobe forms because the type of field you choose at the time of design level is associated with the data type itself.
    If you want to achieve your requirement, then your main idea should be to set the data type as CHARACTER itself while designing the field in the adobe form itself. CHAR field will comfortably hold the value of Calculation/amount field, Currency field, Amount, Date, Time HHMMSS, Unit Accuracy, Currency key, Floating point number, Numeric text, Client, Language and many other data types.
    After designing the field as TEXT field in Adobe form you have two options.
    Option 1:
    Select the Date field initially as type TEXT field or CHAR field in Adobe forms.
    Suppose the name of the field is TEXTFIELD1, then write the Javascript code on this field in Initialize event as below.
    if ( this.rawvalue == null )
         this.rawvalue = "N/A";
    If the field is not blank, then it will show the date. Else it will show "N/A".
    Option 2:
    Select the Date field initially as type TEXT field or CHAR field in Adobe forms. Do the formatting part in ABAP itself. It will increase the performance. Avoid Javascript as much as possible.
    Suppose you have a DATE variable l_dats of type DATS. Then take another variable l_date of type CHAR. Then write the below ABAP code.
    MOVE l_dats TO l_date.
    IF l_date IS INITIAL.
         l_date = 'N/A'.
    ENDIF.
    Bind the l_date to the TEXT field in the form.
    Even in this case, if the field is not blank, then it will show the date. Else it will show "N/A".
    But I will suggest you to use Option 2 of keeping the AMOUNT, QUANTITY, DATE, TIME fields etc as CHAR or TEXT fields in Adobe form and do the required formatting in ABAP itself.

  • Is it possible to change the length of a note in the score editor?

    I thought I saw somewhere that it was now possible to adjust the length of a note in the score editor graphically, i.e. by clicking on the note and somehow adjust its length directly to change it from 1/4 note to 1/8 (for example).
    I don't want to do this by going over to the "Length" dialog on the left because I hate having to switch from thinking in terms of music notation and then having to think (temporarily) in MIDI ticks per beat, etc.
    I must admit that I'm finding it extremely frustrating to simply enter music into Logic in a score....I thought this was supposed to be one of its strengths but it seems to be providing amazing capabilities at the expense of ease of use for beginners.

    dhjdhj wrote:
    I thought I saw somewhere that it was now possible to adjust the length of a note in the score editor graphically, i.e. by clicking on the note and somehow adjust its length directly to change it from 1/4 note to 1/8 (for example).
    greetings dh... are you into Key Commands? There are two which will help you do the above in a trice:
    • Nudge Region/Event Length Right by SMPTE Frame
    • Nudge Region/Event Length Left by SMPTE Frame
    I set mine to the simple letter o and n
    - I click on a note and press o repeatedly.. it grows and grows longer and longer
    – I click on a note and press n repeatedly.. it shrinks and shrinks shorter and shorter
    All by little increments
    If you keep a Piano Roll window open while you do this, you can see the length do this exactly
    man, it is VERY quick and handy for changing the length of notes
    It really helps to have a view of the midi Piano Roll to cross check the exact length and position of the notes.
    Check out the Key Commands:
    • Set Next Higher division
    • Set Next lower division
    These change the note value in the transport bar near the time signature. Your time signature may be 4/4 but the "grid" on which the notes are appear in the Piano Roll could be displayed in quarter, 8th or 16th notes. If you experiment with these commands, then you can match the note lengths easily to the grid display visually (with the above nudge length commands)
    Also - you may like to experiment with the following 3 KEY Key Commands:
    1 • Nudge Region/Event Position Right by Nudge Value
    2 • Nudge Region/Event Position Left by Nudge Value
    This will move your selected notes forward in time or back in time according to the
    value that is set in the Transport bar - say it is 16ths .. then each press of the key will move the notes a 16th
    or if the value is 8th notes, then each press of the key forward or backwards will move the selected notes forward or back by this amount
    ... amazingly useful when you are taking a whole phrase and pasting it somewhere else, or if say you started to write a phrase in the Score Editor and you started on the wrong beat.. then you just Nudge back and forth
    3 • Set Nudge Value to Division
    .. this will in a trice change change the Nudge Value to whatever Note division value is set in the Transport bar
    HTH and forgive me if I have given you too much information
    ..problem is I spent too much time in the Transport Bar in Los Angeles last year drinking with the iSchwartz and other Logic reprobrates... you should join us some time

  • How to change the length of a JTextField?

    Hello,
    I am trying to shorten the length of a JTextField with the following code :
    // up to this point, getColumns() returns a value of 35.
    jTextField1.setColumns(20);
    (jTextField1.getParent()).invalidate();
    (jTextField1.getParent()).validate();
    When I ran this code, it does not change the length of the text field at all.
    I wonder if I am writing my code correctly or is there a better/more correct
    way to do this?
    Thank you for your help.
    Akino.

    Packing a frame works:
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class ShortText implements ActionListener {
        JTextField txtF;
        JFrame frame;
        public ShortText() {
         frame = new JFrame();
         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         txtF = new JTextField(30);
         JButton btn = new JButton("Shorten");
         btn.addActionListener(this);
         frame.add(txtF, BorderLayout.NORTH);
         frame.add(btn, BorderLayout.SOUTH);
         frame.pack();
         frame.setVisible(true);
        public static void main(String[] args) {
         new ShortText();
        public void actionPerformed(ActionEvent e) {
         System.out.println("Old Columns: " + txtF.getColumns());
         txtF.setColumns(20);
         frame.pack();
         System.out.println("New Columns: " + txtF.getColumns());
    }

  • How to change the lengths of the layout

    Hi ,
    I am executing one report, output is coming fine but next if i go to print preview for PO number only 9 digits are appearing one digit is missing, actually column is trucated, there in print preview there is one tab called Change Layout, there if i see length of the PO no is 9, so its showing only 9 digits, actually length of the PO no should be 10.in change layout the length is editable i can change from 9 to 10, after that there is a button called copy, then it will show correctly, it works only one time, so each and every time user has to change the length, so can any one suggest how to change that length in the layout permanently, bcos there is no save button there.
    Can any one tell me from where all these lengths are coming which are appearing in change layout.Surely its not coming from the report.

    Hi friend,
    That depends upon the space provided by the ALV column for that variable or the heading size its not based on the data element size.
    If you want to be more clear lust count the space available for each field available at the print preview.
    The details for that are stored in table T180S just see the documentation available for that table.
    And see when the table is getting filled like that so that you will be able to find a solution where and how it is getting populated.
    Use column width optimization for getting the correct output.
    If you have any queries in this please revert back to me i will help you.
    Thanks,
    Sri Hari
    Edited by: srihari.kumar on Jan 5, 2012 4:01 PM

  • How do I change the length of multiple photo's after I've added them?

    How do I change the length of multiple photo's after I've added them?

    Hey,
    The best way to do this is to select all the clips by holding down the shift key or command key if the clips you want to change are not all right next to each other and then selecting each clip that you want to change. Then double-click on the clips which will open up the inspector tab and then you can change the duration. If you want to just change all clips to the same duration just double-click on one of the photos and in the inspector tab next to the durationt tab you will see a box that says "add duration to all clips". If you click that, when you change the duration all the photos will change to that duration. That will then change the duration of all the clips at the same time.

  • Changing the Length of the Label

    Hi friends,
    How do I change the Length of the Label in Select-options Component, by default it is taking only
    20characters i.e, medum from dataelement.say I want display more than characters i.e  Long Text of Data element.
    How can I access the Long Text of dataelement in Webdynpro select-options component?
    Regards,
    Xavier.P

    I think,  in select-options component we will be adding the fields to selection screen using the method
    add_selection_field of if_wd_select_options. no where we will be placing the UI elements in view.
    Regards,
    Xavier.P

  • Error when changing the length of IO

    Hi Experts,
    I have changed the length of one of my Info-Object from NUMC-2 to NUMC-3. While trying to activate it it is giving the error "Structure Change at field Level(change Table)".
    But When i changed the length of one more IO before from Char-1 to Char-3, it successfully got activated.
    Please help me out.
    Regards,
    Pavan

    Hi Ananda,
    We cannot delete the master data.
    Can Anyone pleasetell me why this IO is not getting activated when i change length from NUMC2 to NUMC3
    I didn't face any problem when i changed the length of one of my IO from Char-1 to Char-3. It successfully got activated
    But im facing this problem when I try to change the length of another IO from NUMC-2 to NUMC-3.
    If anyone any any solution for this otherthan deleting the existing data, please do let me know.
    Regards,
    Pavan

  • Another user has changed the row with primary key oracle.jbo.Key   HELP

    I created VO which based on two entities. Then user search from that VO, when result comes update two row of each entity .
    HERE my function
    public String lockPayment() {
    getAppImpl().getcheckPaymentsVO1().setRangeSize(-1);
    Row[] rw2 = getAppImpl().getcheckPaymentsVO1().getAllRowsInRange();
    checkPaymentsVORowImpl tparow;
    tparow = null;
    for (int j = 0; j < rw2.length; j++) {
    tparow = (checkPaymentsVORowImpl)rw2[j];
    // tparow.setApayLock("1");
    tparow.setAtaxLock("1");
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding = bindings.getOperationBinding("Commit");
    Object result = operationBinding.execute();
    if (!operationBinding.getErrors().isEmpty()) {
    return null;
    return null;
    When I click it gives me error:
    ----------> Another user has changed the row with primary key oracle.jbo.Key
    Any suggestion !!!!!!
    Edited by: 903927 on Dec 14, 2012 1:00 AM

    Hi,
    see this: https://blogs.oracle.com/onesizedoesntfitall/entry/the_case_of_the_phantom
    Frank

  • Masked Input Plugin - Cannot change the length

    I use the masked plugin alot. But the strange thing is that it does not have a length field so it defaults to 30. In order to change the length, I have to change it to a Text Field, then change the length (e.g., to 15 for phone number) and then change the type back to Masked Input. The length is then shorten.
    Can't the masked input plugin be changed to include the length field? It seems to still use it.
    Robert
    http://apexjscss.blogspot.com

    Hi Robert,
    are you talking about the display length of the field or the number of characters which can be entered.
    Don't have access to the source code now from my iPad, but in the plugin definition you could check if the checkbox for field width (don't remember the exact name) in the standard attributes region is checked.
    Have you downloaded the plugin from http://apex.oracle.com/plugins or do you use the copy from the sample app?
    Regards
    Patrick

  • The length of UUID key is invalid

    I am trying to use the new oracle service registry but when i register a service through the business service control and try to create a datacontrol for it in JDeveloper i get the following error:
    DCA-40002: The WSDL document is invalid due to the following reason: java.io.IOException: org.systinet.uddi.InvalidParameterException: The length of UUID key is invalid
    Some of the installed sample services are working fine but when i try to register and use my own services i always get this error in JDeveloper.
    Has anybody succeeded in generating data controls from jdeveloper for service registry entries?
    Kind Regards,
    Andre Jochems

    I've had a similar problem when trying to create a ws stub. Could this error message be misleading and the real issue is that the xsd referenced in the wsdl was not found ?
    (just a thought)

Maybe you are looking for

  • Link Sales Order with STO

    Dear All, I am having a scenerio, where I would like to link Sales Order Document Number with Stock Transport Order. Can anybody advise me , plsease. Rgds, Indrajit

  • How can I post or add a PDF, DOC, MP3 or other file on my site for visitors to download?

    The exact approach can vary, depending on if you are hosting your site using Adobe Business Catalyst or another hosting provider. In either case, however, the steps would be something like this: Use an FTP client to create a "documents" folder on you

  • 23" Studio Display with Power Book (17")

    I am considering running a 23" studio display with my 17" PB. From perusing the discussions here it seems this is entirely possible (although there is some debate over keeping the clam shell closed during operation...). As a photographer and heavy us

  • Games for apple tv

    how do i play games on my ipad and tv at the same time?

  • Remove folder in Message

    Dear All, I am newbie using E90, just bought for a week ago, 2 days ago I made new folder in Massage (under My folder), I like to remove it but can`t find out how to do that, any help? Thank you before