Changes in the existing table structure

Dear All,
I have table called X and having some rows. I want to add another column with not null and add primary key. But I have to do care of existing data and database is in production?
Thanks

SQL> create table myt1 (x int not null);
Table created.
SQL> insert into myt1 values(1);
1 row created.
SQL> alter table myt1 add (y int);
Table altered.
SQL> update myt1 set y=1;
1 row updated.
SQL> alter table myt1 modify (y not null);
Table altered.
SQL> desc myt1
Name Null? Type
X NOT NULL NUMBER(38)
Y NOT NULL NUMBER(38)
Edited by: Robert Geier on Nov 12, 2009 10:33 AM

Similar Messages

  • Need to add 2 new columns to the existing table control of C223 transaction

    Hi ABAP Gurus,
    I have to do a screen enhancement for transaction C223.
    Below is the requirement:
    need to add 2 new columns to the existing table control of C223 transaction.
    there is no customer exits, screen exit or user exit present for this transaction C223, i have found one enhancement spot for this transaction.
    i dont have any idea how to do this in standard transaction C223, the table control in C223 saves the data to MKAL table and the table control uses the structure MKAL_EXPAND in the screen program.
    i have created an append structure for  the 2 fields to the standard table MKAL.
    Can anyone please suggest me how this can be done in standard screen C223, will the enhancement spot can be used to do this....
    please sugest...
    Thanks & Regards

    Hi Santosh,
    Thanks for the reply. I have looked into this Enhancement Spot CPFX_SCREEN_SET , inside this there is only one method INPUT_DISABLED having below parameters
    IM_MKAL     Importing     Type     MKAL                                                                                Production Version
    EX_MSGID     Exporting     Type     SY-MSGID                                                                                Messages, Message
    EX_MSGTY     Exporting     Type     SY-MSGTY                                                                                Messages, Message
    EX_MSGNO     Exporting     Type     SY-MSGNO                                                                                Messages, Message
    EX_MSGV1     Exporting     Type     SY-MSGV1                                                                                Messages, Message
    EX_MSGV2     Exporting     Type     SY-MSGV2                                                                                Messages, Message
    EX_MSGV3     Exporting     Type     SY-MSGV3                                                                                Messages, Message
    EX_MSGV4     Exporting     Type     SY-MSGV4                                                                                Messages, Message
    EX_INPUT_DISABLE     Exporting     Type     CHAR1                                                                                Display Only if X Was Set
    the BADI definition present here is a SAP internal so we cant implement the BADI , but we can created a enhancement spot implementation for this. as per my understanding on this the enhancement spot is only for making the table control fields display / change .  i dont think this can be used to add two new coloumns to C223 table control.
    I am not sure thats why seeking your help/valuable sugestion on this.
    Please provide your sugestion on this , so that i can come to conclusion on this issue.
    Thanks & Regards
    Siddhartha Mishra

  • Only query on existing form without any changes on the existing records?

    Dear all,
    I am working a brand new form. The form is able to query all the records from the table. However, when I leave the form, it will ask me "Do you want to save the changes you have made?" everytime. I didn't make any changes on the existing records.
    My form only has 2 fields (one with LOV and one without).
    Does anyone know what went wrong?
    Thanks.

    How do you populate your datablock? Do you query one of your values in a Post-Query trigger?
    However you are populating your datablock, Forms is detecting that the status of the Form, Block or Record is changing.
    Also, please let us know your Forms version.
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • Get "Creation Script" of the existing table ( in SQL database) using C# and without using SMO dlls

    Hi All,
    I need to get the "Creation Script" of the existing table using c# and without using SMO dlls (is it possible? I don't know).
    I.e. In SQL Management Studio -> right click on any table -> Script table as -> Create To  - > open in the new query editor window. This will give you the schema of the table with the constraints of the table.
    For E.g. In Northwind database, for the table "Categories", I would like to get it as show below
    USE [Northwind]
    GO
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[Categories](
        [CategoryID] [int] IDENTITY(1,1) NOT NULL,
        [CategoryName] [nvarchar](15) NOT NULL,
        [Description] [ntext] NULL,
        [Picture] [image] NULL,
     CONSTRAINT [PK_Categories] PRIMARY KEY CLUSTERED
        [CategoryID] ASC
    )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
    ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
    GO
    I would like to get the same schema using c#. Please help.
    Thanks & Regards,
    Kalai.

    SMO is the easiest way to get this. This is what Management Studio uses. If you can't use SMO, get a Profiler trace of the queries that SMO executes when generating the script and execute the same using ADO.NET.
    Regards,
    Farooq Mahmud
    Support Escalation Engineer 
    •  Microsoft Health Solutions Group

  • Change to the existing outgoing positive payment file (EID 820)

    Hello Experts,
    I have to make a change to the existing outgoing positive payment file (EID 820).
    The current scenario is:
    We are running the payment run in SAP and generating IDocs using program RFFOEDI1 mentioned in printout data medium. The IDocs generated are of Basic Type PEXR2002. These IDocs then processed by SAP PI and converted to EDI and the EDI is sent to the Bank. Currently in this process, we are not assigning the check numbers at the time of payment run. Also the check numbers are not there in the IDocs. The Bank prints the checks and sends us the check number which we update in SAP using Z program.
    Now there is a change in the requirement and we need to assign the check numbers at the time of payment run and also transmit them with the EDI file to the Bank. Bank will print the checks and send it to the vendors.
    Now as per my understanding, the check number will not be assigned until I use the program RFFOUS_C in printout data medium.
    Please suggest the possible options to generate IDocs which has the check number in it.
    Thanks in advance
    Sanjay Sarode

    You can use RFFOEDO_1 can still generate check 3's, just maintain check number in the check lots configuration and ensure you assign the lots to the correct payment method.
    Thanks
    Shine

  • How to send  changes in the Database Table Periodically using Change Pointe

    Hi,
           How to send  changes in the Database Table to the external system Periodically using Change Pointers.
    Thanks & Regards,
    Gopi.

    That depends on what table you are referring to.

  • Can we addnew partition and sub partition in the existing table in one shor

    can we addnew partition and sub partition in the existing table in one short

    nav wrote:
    can we addnew partition and sub partition in the existing table in one shortYes,
    You can and below is the example for Range-List partition
    ALTER TABLE <table_name>
       ADD PARTITION <partition_name> VALUES LESS THAN (<value>
          STORAGE (INITIAL 20K NEXT 20K) TABLESPACE <TS name> NOLOGGING
              SUBPARTITION Clause
              SUBPARTITION Clause
              SUBPARTITION Clause
              SUBPARTITION Clause
               );

  • Log for changes in the SAP table

    Hello All,
    I have a SAP table in which we want to log all the changes being made by the number of users like modifying some record or adding a new record.
    Now What I have done is in the SE11 under technical settings I have checked the checkbox which is "Log data changes", Needless to say I have the developer access key to the system.
    Now I want to test whether changes being made by me in the SAP table are logged somewhere or not I want to know where can we see the changes being logged made by me.
    Is there a tcode to see the changes being made in the table or a SAP table exists for this.
    Thanks,
    Mark

    Hi,
    BAL_OBJECT_SELECT --> To get the LOG for a object
    You can use below Tables/Structures
    DDPRT -->  Structure of ABAP/4 Dictionary logs
    DDPRTXT
    Regards
    Sudheer

  • Imported source file name changed for the external table

    Hi,
    I have external table from flat file. Now the source file name is changed. I can change the file location to point to the new file name, but I can't update the source for the flat file property(as seen under flat file properties,structure tab. the column "Sampled From"). Is there way to have this update without having to import the file using the new file name again?

    In the Files section in the object navigator find the flat file you want to change the source of.
    Double click on the actual file, and on the General tab change the old file name to the new one.
    The fact that it has been sampled from a different file should not 'disturb' the working of the external table.
    However, if the structure of the new file is different I'd suggest to resample.
    Good luck, Patrick

  • Issue occurring after modification in the existing table screen

    Hi All,
    I have a table maintenance generator in which I have developed a functionality.
    I am calling a SEARCH BUTTON on this and then it is displaying me the SEARCH screen and after entering a search criteria, I am getting another screen with the similar records as that of search criteria,
    After clicking back on search screen If I again click change buton of the first screen then it is going to third screen which I got after execution of serach button before.
    So it should come to change mode in existing screen but it is not happening.
    Amol

    Amol,
    Hi. The way SAP screen processing usually operates is to include a F4 search against a field, rather than a button on the generated table maintenance screen.
    In SE11 define a search help against a field on your table (SE16 will show that this works by including a drop down when 'clicking' on the specified field). If you have a search help defined then re-generating the table maintenance will automatically include the F4 search on your field. In the search help you can include search help exits for specific functionality.
    Regards
    Robin

  • Load Data from a table on one server's database, to the same table structure in multiple server databases

    Hi,
    I have a situation where i have to load data from one server/database table to multiple servers/databases.
    Example:
    I need to load data from dbo.TABLE_A  (on Server: Server_A & Database: Database_A)  to the same table on the list of server databases like
    Server: Server_B , Database: Database_B
    Server: Server_C , Database: Database_C
    Server: Server_D , Database: Database_D
    Server: Server_E , Database: Database_E
    Server: Server_F , Database: Database_F
    Server: Server_G , Database: Database_G
    Server: Server_H , Database: Database_H
    so on and so forth on 250 such server database combinations.
    The table structure is the same on all the servers.
    If i make the source or destination dynamic, it throws an error while mapping ?
    I cannot get Linked server permissions and SQL Server Config thing doesn't work as well.
    Please suggest on how to load data from one source to multiple server/databases.
    Thank you.

    I just need to transfer one table's data. its like i have to use a query to pick data for
    the most recent data. So i use something like, select A, B, C, D from dbo.table where ETL_TIMESTAMP > (the max(etltimestamp) in the destination on different server). There are no foreign key relationships and the data should not be truncated. it just had
    to append the new records.

  • Download the transperant table structure

    Hi,
    i need to download the table structure like field, data element, short description, etc.. without using report. anybody knows, please reply..
    Thanks in advance.

    hi bala,
    check this thread
    Downloading data and structure of a table
    hope it helps you.
    thanks
    Sachin

  • How to reorg the existing Table

    Hi All,
    I am maintaing a Histroy table, which contains the data from last one year.
    Month on month i am loading the table as the process got over. In some scenario i may need to load the table multiple times by deleting the existing rows corresponds to the month.
    But by this result my query fetching taking a lot of time. I need to reorg of table as soon as i deleted the records.
    please any suggest how can i achive this.
    Regards,
    Prasad G

    A. Create New Table With Partition by range (month) and
    - Oracle online table reorganization
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/tables.htm#sthref2342
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/tables.htm#sthref2362
    http://www.dba-oracle.com/t_online_table_reorganization.htm
    - Using CREATE TABLE AS SELECT (CTAS) to Reorganize Oracle Tables
    http://www.dba-oracle.com/t_create_table_select_ctas.htm
    Or create table with Partition and then insert into new_table select * from old_table
    - Export/Import -> create new table (partition) and import ....
    B. Exchanging Partitions
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/partiti.htm#sthref2762
    Find Out solution for yourself.
    Good Luck

  • Extending the TOA02 table structure

    HI Experts,
    I am developing a Report to perform PDF document archiving. I created a custom document type ZSTREAM_PDF and also a Custom Business Object ZSTREAM_UP . I linked up  these CUstom Object and Document type using the Transaction OAC3 also. I made the needed entry in OAC2 for the document type.
    I have made use of the TOA02 table to connect to the Archive Link. I extended the Structure of this Table by appending a new structure to include a new field.  Because of this extension I got some runtime error when I try to attach a document using  another transaction MIR4 .
    Can any one give some suggestions in these please.
    Regards - SwarnaShree.

    Since this table TOA02 contains only technical information and it is not advisable to include the business data. Hence closing this thread.

  • Change Dataype in existing Table

    Hi,
    I need to change the dataype from
    varchar2( 10 Byte) to varchar2( 15 char) of 10 columns . These 10 column are suppose to store data with special character.What would be the effect on existing data.
    Thankyou
    Shweta
    Edited by: 984137 on Jan 25, 2013 3:55 AM
    Edited by: 984137 on Jan 25, 2013 3:56 AM

    SQL> desc test1;
    Nombre                                    ┐Nulo?   Tipo
    OBJECT_NAME                               NOT NULL VARCHAR2(30)
    OBJECT_ID                                 NOT NULL VARCHAR2(20)
    SQL> alter table test1 modify object_name char(50);
    Tabla modificada.
    SQL> desc test1;
    Nombre                                    ┐Nulo?   Tipo
    OBJECT_NAME                               NOT NULL CHAR(50)
    OBJECT_ID                                 NOT NULL VARCHAR2(20)
    SQL>

Maybe you are looking for