Inserting single column in internal table

Hiii,
I have to insert data into a single column of a internal table from a field.The rest of the columns of the internal table are already filled.
wats is the syntax for it?? plz reply soon...its very urgent.

Hi,
try this
data idx type sy-tabix.
loop at itab.
itab-fld1 = 'some value'.    " your empty field
modify itab index idx.
endloop.
Regards,
V.Balaji
Reward if Usefull...

Similar Messages

  • Insert single column into oracle table

    i have a table t1 in whcih only one column is there
    Create table t1
    a number);now i need to load this column from a excel sheet.
    it have many rows and many column but need only corresponding column.
    please suggeest any way apart from external table and sql laoder.
    thanks

    No problem if you have thousands of rows.
    Say the value you want to insert is in column A of your excel file.
    In column B use the following formula:
    =CONCATENATE("insert into t1 values (";A1;");")And copy this formula to all other rows.
    Then select all the B column, copy it and paste it in a notepad file.
    Call the file as you want, for example c:\ins.sql
    open sqlplus and run
    SQL> @c:\ins.sqlAt the end don't forget to commit...
    Max
    [My Italian Oracle blog|http://oracleitalia.wordpress.com/2010/01/10/crittografia-in-plsql-utilizzando-dbms_crypto/]

  • Insert single column

    Hi all.
    What is the sql statement for insert a single column to  the table?
    Let say i gt a student table and a admino column.
    Thank

    u can never insert a single column.
    atleast u should insert blanks to the other fields.
    inserting a row is possible , inserting single column will not be a normalised table.
    by the way u can update a single column.

  • How to Delete a Column in Internal Table

    Hi All,
    Does any one know ,How to Delete a Column in Internal Table?

    Hi,
       For deleting the column in the internal table, you have to eliminate the field which you want to delete.
    loop at itab into wa.
      move corresponding wa to wa1.
    append wa1 to itab1.
    clear wa1.
    clear wa.
    endloop.
    wa1 is the workarea without the field which you want to delete.
    itab1 is the internal table which consists of the deleted column.

  • Adding a single column to mulitple tables

    I have to add a single column to 664 tables.
    I can copy the column from the table it is originally created in.
    Is there a way to paste the column in all the remaining tables?
    It doesn't work by selecting all the tables in the design ('Ctrl + a', right click 'paste').
    It does work if I click each individual table ('Ctrl', left click) but i do not want to have to click each of the 664 tables.
    Thanks,
    Nic

    You can create script for this purpose for all 664 tables.
    And if you use MS Excel to create that script, you will feel a bit relieved. Its not too much difficult, just simple steps to create the script.
    In MS Excel
    1- In first column Write >>Alter table [Drag this cell for 664 times]
    2- In second table Paste >>Table_Name [Select all tables Ctrl+a, and copy table names in this column 664 Tables will come there]
    3- In third column Write >>Add (COLUMN_NAME  VARCHAR2(50)); [Drag this cell for 664 times]
    Now Script is Ready, You can select all three columns now and paste them in notepad file.
    And execute this script in Database;
    Hope this will resolve your problem.

  • How to grey out one single column in a table control of TPMOE

    Hi Experts,
    Any body please tell me how to greyout a single column in a table control of TPMOE.
    Help needed ASAP.
    Thanks,
    sreenivas.

    lr_result      TYPE REF TO if_bol_bo_property_access
    lr_iterator TYPE REF TO if_bol_bo_col_iterator
          CALL METHOD lr_iterator->get_by_index
            EXPORTING
              iv_index  = index
            RECEIVING
              rv_result = lr_result.
          CALL METHOD lr_result->get_property_as_value
            EXPORTING
              iv_attr_name = 'TRANSFER_STATUS'
            IMPORTING
              ev_result    = lv_status.
    if  lv_status = x and component = cost_category.
    rv_disabled = true.
    else.
    call super.
    endif.
    INDEX will have the row number.
    Frame ur logic based on this.

  • How to insert  data from different internal  table  into a data base table

    hi all,
             I want to insert a particular field in an internal table to a field in a data base table.Note that the fields in the internal table and database table are not of the same name since i need to insert data from different internal tables.can some one tell me how to do this?
    in short i want to do something like the foll:
    INSERT  INTO ZMIS_CODES-CODE VALUE '1'.
    *INSERT INTO ZMIS_CODES-COL1 VALUE DATA_MTD-AUFNR .(zmis_codes is the db table and data_mtd is the int.table)

    REPORT  ZINSERT.
    tables kna1.
    data: itab LIKE KNA1.
    data lv_kUNAG LIKE KNA1-KUNNR.
    lv_kuNAG =  '0000010223'.
    ITAB-kuNNR = lv_kuNAG.
    ITAB-name1 = 'XYZ'.
    INSERT INTO KNA1 VALUES ITAB.
    IF SY-SUBRC = 0.
    WRITE:/ 'SUCCESS'.
    ELSE.
    WRITE:/ 'FAILED'.
    ENDIF.
    Here lv_kunag is ref to kna1 kunnr passed in different name
    In internal table .
    Try and let me know if this logic dint work.

  • @Inserting Records in an Internal Table

    Hi,
    How can I Insert records in an internal table..such that i can insert the records somewhere in the middle based on the entry in a field?

    INSERT wa INTO TABLE itab INDEX idx .
    Effect
    This variant can only be used for standard tables and sorted tables. Each line line_spec to be inserted into the line before the table index idx and the table index of the following lines is increased by one. A data object of the type i is expected for idx.
    If idx contains a value equal to the number of the existing table lines plus one, the new line is appended as the last line in the internal table. If idx contains a greater value, no line is inserted and sy-subrc is set to 4.
    An exception that cannot be handled is raised when:
    idx contains a value less than or equal to 0
    A line to be inserted would cause a duplicate entry in tables with a unique table key
    A line to be inserted would disrupt the sort order of sorted tables
    Within a LOOP loop, you can omit the addition INDEX. Each line to be inserted is inserted before the current table line of the LOOP loop. However, if the current line is deleted in the same loop pass, the response is undefined.

  • How to insert record inside the internal table in below code

    Hi all,
    My requirement is to find the sub-total and need to insert in between the internal table.
    You can see the output ....where I want the sub-total F2 when 1 & 2 combindely , 3 , 4& 5 combindely .Please check it and let me know is it possible
    when i am using modification  it is not creating extra row inside the table instead it is modifying one row and putting the total there.
    For ex: the origianl output is
    F1   F2       F3
    A      1          1
    B      1          1
    F      2          1
    D      3          1
    E      4          1
    C      5          1
    We want to display all the total of f2 of 1-2 , 3 , 4-5
    so expcected output is
    F1   F2       F3
    A      1          1
    B      1          1
    F      2          1
         *              3  ->This is the sub-total of 1& 2 of f2
    D      3          1
            *           1 ->this is the sub-total of 3
    E      4          1
    C      5          1
          *             2 -> this is the sub-total of 4 & 5
    = space
    But coming output is
    A 1          1
    B 1          1
    *             3 -> it is modifying the F row and inserting the total .Total is comong correct but is shoule insert  instead of modifying the record!!
      *           1
    E  4          1
    *             2
    Please help how to insert the row total at the end of the chage of field
    Please find the below code ..Due to space problem i am attaching below
    Sas

    Here is the solution ....i Got the answer Thanks for your helping hands friends
    REPORT  YTEST_MODIFY.
    DATA: BEGIN OF ITAB OCCURS 1,
    TOT TYPE C,
    F1 TYPE C,
    F2 TYPE C,
    F3 TYPE I ,
    END OF ITAB.
    DATA: BEGIN OF JTAB OCCURS 1,
    F1 TYPE C,
    F2 TYPE C,
    F3 TYPE I ,
    END OF JTAB.
    START-OF-SELECTION.
      ITAB-F1 = 'A'.
      ITAB-F2 =  1.
      ITAB-F3 =  1.
      APPEND ITAB.
      ITAB-F1 = 'B'.
      ITAB-F2 =  1.
      ITAB-F3 =  1.
      APPEND ITAB.
      ITAB-F1 = 'C'.
      ITAB-F2 =  5.
      ITAB-F3 =  1.
      APPEND ITAB.
      ITAB-F1 = 'D'.
      ITAB-F2 =  3.
      ITAB-F3 =  1.
      APPEND ITAB.
      ITAB-F1 = 'E'.
      ITAB-F2 =  4.
      ITAB-F3 =  1.
      APPEND ITAB.
      ITAB-F1 = 'F'.
      ITAB-F2 =  2.
      ITAB-F3 =  1.
      APPEND ITAB.
      SORT ITAB BY F2.
      LOOP AT ITAB.
        WRITE:/1 ITAB-F1 ,
              8 ITAB-F2 ,
              10 ITAB-F3 .
      ENDLOOP.
      LOOP AT ITAB.
        IF ITAB-F2 = 1 OR ITAB-F2 = 2.
          ITAB-TOT = 1.
          MODIFY ITAB.
        ELSEIF ITAB-F2 = 3.
          ITAB-TOT = 3.
          MODIFY ITAB.
        ELSEIF ITAB-F2 = 4 OR ITAB-F2 = 5.
          ITAB-TOT = 4.
          MODIFY ITAB.
        ENDIF.
      ENDLOOP.
      SKIP 2.
      SORT ITAB BY TOT.
      DATA : L_SUM(2) TYPE C,
             L_ROW(2) TYPE C.
      LOOP AT ITAB.
        MOVE-CORRESPONDING ITAB TO JTAB.
        APPEND JTAB.
        L_SUM = L_SUM + ITAB-F3 .
        AT END OF TOT.
          CLEAR JTAB.
          JTAB-F3 = L_SUM .
          APPEND JTAB.
          CLEAR L_SUM.
        ENDAT.
      ENDLOOP.
      LOOP AT JTAB.
        WRITE:/1 JTAB-F1 ,
              8 JTAB-F2 ,
              10 JTAB-F3 .
      ENDLOOP.
    *  DATA: a TYPE i , b .
    *  LOOP AT itab.
    *    IF b = 0.
    *      a = a + itab-f3.
    *    ENDIF.
    *    AT END OF tot.
    *      MOVE space TO itab-f1.
    *      MOVE space TO itab-f2.
    *      MOVE a TO itab-f3.
    *      MODIFY itab .
    *      CLEAR a.
    *      b = 1.
    *    ENDAT.
    *    b = 0.
    *  ENDLOOP.
    *  LOOP AT itab.
    *    MOVE-CORRESPONDING itab TO jtab.
    *    APPEND jtab.
    *  ENDLOOP.
    *  ULINE.
    *  LOOP AT jtab.
    *    WRITE: / jtab-f1 , jtab-f2 , jtab-f3.
    *  ENDLOOP.

  • Inserting columns from internal table to a database table!

    Hi people,
    How do I go about to insert columns from an internal table -intab- into an data base table -dbtab-. These tables contain some similar columns, not all.
    A code example would be much appriciated!
    /Armin

    hi armin,
    INSERT  dbtab      FROM TABLE itab. oder
    INSERT (dbtabname) FROM TABLE itab.
    Extras:
    1. ... CLIENT SPECIFIED
    2. ... ACCEPTING DUPLICATE KEYS
    3. ... CONNECTION con
    Effect
    Mass insert: All lines of the internal table itab are inserted in one single operation. The lines of itab must fulfill the same conditions as the work area wa in variant 1.
    When the command has been executed, the system field SY-DBCNT contains the number of inserted lines.
    The Return Code is set as follows:
    SY-SUBRC = 0:
    All lines successfully inserted. Any other result causes a runtime error.
    Note
    If the internal table itab is empty, SY-SUBRC and SY-DBCNT are set to 0 after the call.
    Addition 1
    ... CLIENT SPECIFIED
    Effect
    As with variant 1.
    Addition 2
    ... ACCEPTING DUPLICATE KEYS
    Effect
    If a line cannot be inserted, the system does not
    terminate with a runtime error but only sets the return value SY-SUBRC to 4. All other lines are inserted after the command is executed.
    hope this helps,
    do reward if it helps,
    priya.

  • Inserting single column in crosstab

    Post Author: millercepbs
    CA Forum: WebIntelligence Reporting
    Does anyone know of a way to insert only a single column in a crosstab table? Every time I try to insert a column, I get a column added next to each existing column. The problem is, I can't delete a single column either, so I cant add and then delete the extras. I would like to add a single column for things like a sum for each row, but I don't want it next to each column.

    Post Author: Sujitha
    CA Forum: WebIntelligence Reporting
    Hi
    Did you find a solution.I guess it can only happen when u add a column beside the header and change the color Bg color same as the column value.I had the same problem but luckily I had to add just after the header.

  • Insert statement in to internal table

    I have an editable ALV LIST report with the check box to it. When the user checks the check box on the report and hits a push Button it should copy the row from the internal table and insert the row to the same internal table in the next line.
    I had my code in this way,
        WHEN 'COPY'.
          LOOP AT t_output INTO wa_output.
            IF wa_output-chkbox = 'X'.
              wa_output-zactual = 0.
              wa_output-zqty = 0.
              INSERT wa_output INTO t_output INDEX sy-tabix.
            ENDIF.
          ENDLOOP.
    However the problem was,
    For e.g. let say I have only 3 rows in the internal table. So when the user selects the last, 3rd row and hits the push button the 3rd row copied and is inserted in the 3rd row. The user wanted the copied row in the next row, ie the 4th row.
    SO I changed the above code as below and now it goes to an endless loop.
        WHEN 'COPY'.
          LOOP AT t_output INTO wa_output.
            IF wa_output-chkbox = 'X'.
              wa_output-zactual = 0.
              wa_output-zqty = 0.
              Sy-tabix = sy-tabix + 1.
              INSERT wa_output INTO t_output INDEX sy-tabix.
            ENDIF.
          ENDLOOP.
    <b>I dont want to use another internal table.</b>
    I hope I am clear.
    Please suggest,
    Ster.

    Hi,
    Change the code as follows.
      data: lv_cnt type i.
        describe table t_output lines lv_cnt.
         LOOP AT t_output INTO wa_output where wa_output-chkbox = 'X'          
                                                                and  wa_output-zactual = 0
                                                                and  wa_output-zqty = 0.
              lv_cnt = lv_cnt + 1.
              INSERT wa_output INTO t_output INDEX lv_cnt.
          ENDLOOP.
    Regards
    Sailaja.

  • Update a single column of a table

    Hi Champs,
    I want to update a single column of table PA0000.
    Following is ABAp code I am using:
    UPDATE pa0000 SET massn = wa_upd_actn71-massn
                       WHERE pernr = wa_upd_actn71-pernr AND
                              massn = c_crct_entry.
    where in current scenario wa_upd_actn71-massn = 54,
                                         wa_upd_actn71-pernr = 10005092,
                                         c_crct_entry = 71.
    But this code is not working and note updating the DB table PA0000.
    Can you help me out?
    Edited by: Nishant Khimesra on Apr 7, 2009 2:00 PM
    Edited by: Nishant Khimesra on Apr 7, 2009 2:00 PM

    hiii,
    If u want to update it thr program then write the query as update <dbtablename> set fld = value where <condn>. make sure that the values u pass are converted as per the values in database.
    2nd way is goto se16n
    specify table name and then enter &sap_edit on command line. sap editing function will be edited. specify the filter parameters on the field and then execute the transaction. u can change thd data instantly as the data appears in editable alv.
    Regards,
    Anil N.

  • Inserting field in a internal table

    I have a internal table in which has 3 fields, out of which 2 are filled. Now I want to insert some value in field 1 which is not filled.
    I tried using
    Loop at itab into wa_itab.
    wa_itab-filed1 = 'test'.
    modify itab from wa_itab.
    endloop.
    but still nothing is happening. I even used INSERT command but without any result.

    Hi,
    Refer below code
        IF NOT it_crmm_territory[] IS INITIAL.
          LOOP AT it_crmm_territory INTO wa_crmm_territory.
            l_index = sy-tabix.
            CLEAR : wa_crmm_territory_v.
            READ TABLE it_crmm_territory_v INTO wa_crmm_territory_v WITH KEY terr_guid = wa_crmm_territory-terr_guid.
            IF sy-subrc EQ 0.
              wa_crmm_territory-valid_from = wa_crmm_territory_v-valid_from.
              wa_crmm_territory-valid_to   = wa_crmm_territory_v-valid_to.
              wa_crmm_territory-guid       = wa_crmm_territory_v-guid.
            ENDIF.
            MODIFY it_crmm_territory FROM wa_crmm_territory INDEX l_index
                                          TRANSPORTING guid valid_from valid_to.
            CLEAR : wa_crmm_territory.
          ENDLOOP.
        ENDIF.
    Regards,
    Prashant

  • Reading particular column from internal table

    Hi
    I am having one internal table with one row. I know the column number. I want to read that particular column value. What should I add with the below statement.
    Read table itab index 1.
    This will give me the whole row. I want only the particular column.
    Please help me to solve this issue
    Thanks.

    Hi,
    FIELD-SYMBOLS <FS_ANY>
    ASSIGN COMPONENT N OF STRCUTURE OF WORKAREA TO <FS_ANY>
    WRITE <FS_ANY>
    Where n is the column number and workarea is the row of the internal table.
    Rgards,
    Ravi
    Note : Please mark the helpful answers

Maybe you are looking for

  • Does Final Cut ProX works OK with the OS X Yosemite

    I've received a note to update my system to OS X Yosemite. Does FCPX works well with the new system? Is there any precaution that I should take before the update? Thank You for your help

  • Down loaded latest Maps 3ovi on N96. program wont ...

    Hi I Down loaded latest Maps 3ovi on N96. program wont open. The task bar goe's across the screen then stops then goe's back to the main menu screen. Can anyone help? I have uninstalled it but even maps 2 wouldn't work now .

  • Client_ole2

    hello, please would anybody give me a sample form or sample code that i can use to send mail from oracle forms running from application server using client_ole2. please reply at earliest regards, munira

  • Aligning a text layer to the centre of the image?

    Hi, I've just been creating a watermark for my photos in Photoshop CS5. I've found the 'Align' tool under 'Layer' in CS5 but align is greyed out. How can I align the text layer to the centre of the image if I can't use the align tool? Thank you! Chri

  • How to inject html into a wiki generate page?

    How do you put in custom HTML into a wiki generated page? Say I have a I want injected into each wiki page; where within the structure of the wiki server files am I able to do that? I figured finding the code where the <head> tag for a wiki page is c