How to modify a table?

hi
i want to modify a table
how do i write the command if i want to modify it according to the table's keys ????
thanks

Hi,
To change a single line, use the following statement:
MODIFY TABLE <itab> FROM <wa> [TRANSPORTING <f1> <f 2> ...].
The work area <wa>, which must be compatible with the line type of the internal table, plays a double role in this statement. Not only it is used to find the line that you want to change, but it also contains the new contents. The system searches the internal table for the line whose table key corresponds to the key fields in <wa>.
The system searches for the relevant lines as follows:
Standard tables
Linear search, where the runtime is in linear relation to the number of table entries. The first entry found is changed.
Sorted tables
Binary search, where the runtime is in logarithmic relation to the number of table entries. The first entry found is changed.
Hashed tables
The entry is found using the hash algorithm of the internal table. The runtime is independent of the number of table entries.
To change one or more lines using a condition, use the following statement:
MODIFY <itab> FROM <wa> TRANSPORTING <f1> <f 2> ... WHERE <cond>.
This processes all of the lines that meet the logical condition <cond>. The logical condition can consist of more than one comparison. In each comparison, the first operand must be a component of the line structure. If the table lines are not structured, the first operand can also be the expression TABLE LINE. The comparison then applies to the entire line.
Regards,
Swapna.

Similar Messages

  • How to modify a table column name

    Hi all,
    How to modify a table column name...
    Thanks

    could type the command here... but will not do that..because you are supposed to read the docs.
    You can find the command here..
    http://www.faqs.org/docs/ppbook/r22871.htm
    Regards,
    G.

  • How to modify the table control?

    Hi all,
    How to modify the table control after setting the lines  = 1. ie tbl_ctr-lines = 1.(tbl_ctr is the table control).
    Can anyone explain this with an example?
    Thanks.

    hi
    http://help.sap.com/saphelp_nw04/helpdata/EN/9f/dbac5e35c111d1829f0000e829fbfe/content.htm
    Regards
    pavan

  • How to modify  a table without  setting system to modifiable

    Hi All
    Is there a way to modify a table without setting the system to modifiable either in SCC4 or SE06.
    We locked SCC4 in our system , however one tables are not able to modify.
    table name YAUTM
    Is there a way to bypass this?
    Edited by: Shou Woon Wee on Jan 11, 2008 3:09 AM

    Hi Shou......
    if it gives you a message....."the client is not modifiable"/ ALIAS "table not modifiable"  ...then from a security perspective....you cant, and you might not want to bypass it!
    SCC4 settings are meant to be for that!  Contact your Basis team for this.
    The only way to bypass this is thru ....sending changes through a transport request.
    Curiosity: what environment are you trying this out ? cant be sandbox or DEV!
    Regards
    Abhishek

  • How to modify DataBase Table with an internal Table

    Hi, Friends.
    I am coping Data from a Database table to an internal table after modifying data in the internal table I want to modify the db table according to the modification in the internal table. can some one help me out in this way, i am doing this modification in Table Control in Screen programing.
    My Code is as follow.
    MODULE zfsl_stinf_tc_init OUTPUT.
      IF tc_copy IS INITIAL.
        SELECT * INTO CORRESPONDING FIELDS OF TABLE it_zfsl_stinf FROM zfsl_stinf.
        tc_copy = 'X'.
        REFRESH CONTROL 'TC_FOR_ZFSL_STINF' FROM SCREEN '0001'.
      ENDIF.
    ENDMODULE.                 " zfsl_stinf_init  OUTPUT
    *&      Module  zfsl_stinf_tc_move  OUTPUT
          text
    MODULE zfsl_stinf_tc_move OUTPUT.
      MOVE-CORRESPONDING wa_it_zfsl_stinf TO zfsl_stinf.
    ENDMODULE.                 " zfsl_stinf_tc_move  OUTPUT
    *&      Module  STATUS_0001  OUTPUT
          text
    MODULE status_0001 OUTPUT.
      SET PF-STATUS 'ZFSL_SCREEN_1ONLY'.
    SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_0001  OUTPUT
    *&      Module  zfsl_stinf_tc_modify  INPUT
          text
    MODULE zfsl_stinf_tc_modify INPUT.
      MOVE-CORRESPONDING zfsl_stinf TO wa_it_zfsl_stinf.
      MODIFY it_zfsl_stinf FROM wa_it_zfsl_stinf INDEX tc_for_zfsl_stinf-current_line.
    _*"" here i have the modified internal table  " it_zfsl_stinf "*_
    ENDMODULE.                 " zfsl_stinf_tc_modify  INPUT
    Kind regards,
    Faisal

    Hi
    Here you are modifying your dbtable in module pool programming
    so  better to use work area to modify the database table
    example:
    data: itab type table of zfsl_stinf .
    data: wa_itab type itab.
    select single * from zfsl_stinf INTO itab WHERE <condition>
    (pass your values to wa_itab.)
    modify zfsl_stinf from values of wa_itab.
    Regards
    Srinivasu

  • How to Modify Internal table

    select  pernr dlart darbt subty
               into (loan-pernr , loan-ln_type,loan-ln_amt, loan-subty)
               from  pa0045
               where pernr  =  pernr-pernr
               and   subty in ('Y001' , 'Y011' , 'Y010' , 'Z001' , 'Z005' , 'Z006')
             and  begda  <     fisc_day.
    APPEND loan.
    ENDSELECT.
    SELECT   ZZTEL0144B ZZTEL0144B ZZTEL0147B ZZTEL0150B ZZTEL0153B ZZTEL0156B
           into (wa-ZZTEL0144B,wa-ZZTEL0144B,wa-ZZTEL0147B,wa-ZZTEL0150B, wa-ZZTEL0153B, wa-ZZTEL0156B)
    from pa9999
      WHERE pernr = loan-pernr
      and   subty in ('Y001' , 'Y011' , 'Y010' , 'Z001' , 'Z005' , 'Z006')
        and  begda  <     fisc_day.
    APPEND wa.
    ENDSELECT.
    in 1st Query i gett data related tothe PF loans . in 2nd query i got the data related to the balances and repayments. i have to apprend the 2nd query in internal table Loan. according to the respect records  kindly help me out

    >> is it possible to define internal table with header line.
    NO.. you have to create a work area & loop at the itab into this work area.. and you can modify the itab contents from this work area..
    ~Suresh

  • How to modify internal table with new value after data processing

    Hi,
    My code is as below:
    LOOP AT i_raw INTO wa_raw.
       IF  ( wa_raw-/BIC/ZOUASCLS = 'BA') OR ( wa_raw-/BIC/ZOUASCLS = 'CO' ) .
          LOOP AT i_crrs INTO wa_crrs.
            IF wa_raw-/BIC/ZOUIDCIF = wa_crrs-ZCBGCIFNO.
              wa_raw-/BIC/ZOUINDAP = '03'.
            ELSE.
              wa_raw-/BIC/ZOUINDAP = '02'.
            ENDIF.
          ENDLOOP.
        ENDIF.
      ENDLOOP.
    Initially column /BIC/ZOUINDAP is empty and I want to populate either value '02' or '03' as shown above.
    How do I insert those values into each i_raw records ?
    Pls help!

    Hello,
    try this code:
    IF ( i_raw-/BIC/ZOUASCLS = 'BA') OR ( i_raw-/BIC/ZOUASCLS = 'CO' ) .
    LOOP AT i_raw INTO wa_raw.
    WHERE wa_raw-/BIC/ZOUIDCIF = i_crrs-ZCBGCIFNO.
    IF SY-SUBRC = 0.
    wa_raw-/BIC/ZOUINDAP = '03'.
    ELSE.
    wa_raw-/BIC/ZOUINDAP = '02'.
    APPEND wa_raw INTO i_raw.
    ENDLOOP.
    ELSE.
    i_raw-/BIC/ZOUINDAP = ' '.
    ENDIF.
    Hope it helps.
    Best regards.
    Simone.

  • How to update PRPS Table?Is there any FM's available for it?

    Hi,
    I need to update two customized tables of PRPS table,These fields are present on any screen.How to modify the table entries with these values?
    suppose my field name is docnum,and i want to add a document number directly to this table with out using any screen and user exit.

    Try this.
    BAPI MAP2I_BAPI_BUS2054_CHG_TO_PRPS.
    Yuvaram

  • How to modify MARA.

    plz tell me how to modify MARA table....

    Hi,
    This is Really Funny.
    One Asks for how to Update Mara.
    And the reply is
    MARA is a predifined Table
    And the Problem is solved.
    And moreover the person answerd this has asked for the same Question today only with the Same Subject line .
    Regards
    Sandipan
    Edited by: Sandipan Ghosh on Jan 12, 2009 2:29 PM

  • How to modify or put entry in a particular field of a database table

    i want to to modify a field in a database table record identification by primary key fileds
    the situatio is like this
    there are two primay key in database table
    customer number PK
    status PK
    date
    and third field which i want to modify is customer part number.
    based on condition that
    database table1-cuspip = wa_record-cuspip.
    database table1-status <> wa_record-status
    and database table-date = wa_record-date
    if above is true a particular field  the database table  for that record
    ie customer_part_number = 'FAiled'.
    loop at it_record into wa_Record
    endloop.
    please suggest how to modify the database table record if the avove condition is tru and please give me full working code
    regards
    Arora

    Dear Nishant,
    Use UPDATE function for updating the customer part number.
    But please do mention the database table and the keys used for update.
    if en entry already exists with the key then the Entry will fail so use MODIFY statement to modify the Consumber Part Number  with the specificed keys  and transport the modified customer part number and then do COMMIT the changed entry to database.
    Hope this helps you in some way.
    Encourage others to answer you queries by suitably rewarding them.
    Thanks
    Venugopal

  • How to modify a row from a table?

    Hi experts!
    I've a doubt, I need to modify a table with some information I've search, if I do the code below, my program works slowly because the tabla ITDATOS has 650 rows... so, the problem is, how can I modify this in another way?
    FORM RELLENA_DATOS_GENERALES USING PERSONAL.
    DATA: UNIDAD TYPE P0001-ORGEH.
    DATA: TEXTO TYPE HRP1000-STEXT.
    data: indice type sy-index.
      LOOP AT ITDATOS.
      indice = sy-index.
    * Nombre, grupo de personal y área de personal.
        LOOP AT P0001 WHERE PERNR EQ ITDATOS-PERNR.
    *      AND
    *                                   BEGDA LT FECHA-HIGH AND
    *                                   ENDDA GT FECHA-LOW.
    * Nos quedamos con el último resgistro que existe en la fecha seleccionada por pantalla.
          ITDATOS-ENAME = P0001-ENAME.
          ITDATOS-PERSG = P0001-PERSG.
          ITDATOS-PERSK = P0001-PERSK.
        ENDLOOP.
    * Dni.
        LOOP AT P0002 WHERE PERNR EQ ITDATOS-PERNR.
    *      AND
    *                                   BEGDA LT FECHA-HIGH AND
    *                                   ENDDA GT FECHA-LOW.
    * Nos quedamos con el último resgistro que existe en la fecha seleccionada por pantalla.
          ITDATOS-PERID = P0002-PERID(9).
        ENDLOOP.
        LOOP AT P0050 WHERE PERNR EQ ITDATOS-PERNR.
    *      AND
    *                                   BEGDA LT FECHA-HIGH AND
    *                                   ENDDA GT FECHA-LOW.
    * Nos quedamos con el último resgistro que existe en la fecha seleccionada por pantalla.
          ITDATOS-ZAUSW = P0050-ZAUSW.
        ENDLOOP.
    * Recogemos el dato de departamento del infotipo 0001
        SELECT SINGLE ORGEH FROM PA0001 INTO UNIDAD WHERE PERNR EQ ITDATOS-PERNR.
        SELECT SINGLE STEXT FROM HRP1000 INTO TEXTO WHERE OBJID EQ UNIDAD AND
                                                          PLVAR EQ '01'   AND
                                                          LANGU EQ 'S'.
        ITDATOS-DEPART = TEXTO.
    * Insertamos datos modificando tabla ITDATOS ya existente con la información específica.
        MODIFY ITDATOS index indice.
      ENDLOOP.
    ENDFORM.                    " RELLENA_DATOS_GENERALES
    Thanks a lot,
    Regards,
    Rebeca

    Hi,
    Take another internal table and work area same as the initial internal table and work area used in screen 8002 which is to be used to delete the selected data.
    Take the names of the input/output fields as work_area-field_name and select column in table control as work_area-flag.
    Also take a flag field of size 1 datatype character as the last field in the internal table and work area while declaration.
    You have to pass a code in PBO of the screen for reading internal table into the table control.
    So it reads the internal table into the table control whenever you perform any action on use command.
    All you need to do is to write a code to modify the internal table form the table control while performing any user action.
    At screen logic,
    PROCESS BEFORE OUTPUT.
      MODULE status_8002. "for pf-status
      LOOP WITH CONTROL po_tab. "po_tab is table control
        MODULE pass_data. "to pass data into table control from internal table
      ENDLOOP.
    PROCESS AFTER INPUT.
      MODULE user_command_8002. "for user command(back and exit)
      LOOP WITH CONTROL po_tab.
        MODULE modify_data. "to modify data from table control into table control
      ENDLOOP.
    In PBO,
    *&      Module  STATUS_8002 OUTPUT
    MODULE status_8002 OUTPUT.
      SET pf-status 'ZAB_PFSTA'. " pf-status
      DATA : line_count TYPE i.
      DESCIRBE TABLE it_ekpo
      LINES line_count.
      po_tab-lines = line_count + 10.
      " to make table control scrollable
    ENDMODULE.                 " STATUS_8002  OUTPUT
    *&      Module  PASS_DATA  OUTPUT
    MODULE pass_data OUTPUT.
      READ TABLE it_ekpo into wa_ekpo INDEX po_tab-current_line.
    ENDMODULE.                 " PASS_DATA  OUTPUT
    "it_ekpo is internal table and wa_ekpo is the work area
    In PAI,
    *&      Module  MODIFY_DATA  INPUT
    MODULE MODIFY_DATA INPUT.
      MODIFY IT_EKPO INDEX PO_TAB-CURRENT_LINE FROM WA_EKPO.
      "modify records from table control into the internal table
    ENDMODULE.                 " MODIFY_DATA  INPUT
    Now at PAI, if you done any changes in the table control, then all these changes will be reflected to the internal table, and PBO will read the modified internal table.
    Hope this solves your problem.
    Thanks & Regards,
    Tarun Gambhir

  • Urgent : How to modify the line type and table type

    I am working on ALV Grid Control, i need to know how to modify the line type values to table type.
                 ls_celltab-fieldname = 'ZSAVINGS '.
                 ls_celltab-style = l_mode.
            INSERT ls_celltab INTO TABLE pt_celltab.
    Here ls_celltab is line type and pt_celltab is table type.
    Please give me the suggestion ASAP.
    C.Bharath Kumar

    Hi,
    Here is the example
    DATA: BEGIN OF LINE,
            LAND(3)  TYPE C,
            NAME(10) TYPE C,
            AGE      TYPE I,
            WEIGHT   TYPE P DECIMALS 2,
          END OF LINE.
    DATA ITAB LIKE SORTED TABLE OF LINE
              WITH NON-UNIQUE KEY LAND NAME AGE WEIGHT.
    LINE-LAND = 'G'.   LINE-NAME   = 'Hans'.
    LINE-AGE  = 20.    LINE-WEIGHT = '80.00'.
    INSERT LINE INTO TABLE ITAB.
    LINE-LAND = 'USA'. LINE-NAME   = 'Nancy'.
    LINE-AGE  = 35.    LINE-WEIGHT = '45.00'.
    INSERT LINE INTO TABLE ITAB.
    Regards
    Sudheer

  • How to modify and save the data in the table control

    how to modify and save the data in the table control

    hi priya,
    kindly go thru the code below.
    PROCESS BEFORE OUTPUT.
      MODULE status_9010.
      LOOP WITH CONTROL tab_control.
        MODULE move_data_to_table.
      ENDLOOP.
    PROCESS AFTER INPUT.
      MODULE user_cancel AT EXIT-COMMAND.
      LOOP WITH CONTROL tab_control.
        MODULE move_data_from_table.
      ENDLOOP.
    MODULE move_data_to_table OUTPUT.
    This is to move the data from the internal table to *the table control
    *zmpets_mode-modecode, zmpets_range-rangeid, *zmpets_servfacto-factor are field names of the table *control columns.
      READ TABLE int_factor INDEX tab_control-current_line.
      IF sy-subrc = 0.
        zmpets_mode-modecode = int_factor-modecode.
        zmpets_range-rangeid = int_factor-rangeid.
        zmpets_servfacto-factor = int_factor-factor.
      ENDIF.
    ENDMODULE.                 " move_data_to_table  OUTPUT
    **********************************************8888
    MODULE move_data_from_table INPUT.
    *To move the data from the table control to internal *table 'INT_FACTOR'.
      int_factor-chk = line.
      int_factor-modecode = zmpets_mode-modecode.
      int_factor-rangeid = zmpets_range-rangeid.
      int_factor-factor = zmpets_servfacto-factor.
       MODIFY int_factor INDEX tab_control-current_line.
        IF sy-subrc NE 0.
          APPEND int_factor.
          CLEAR int_factor.
        ENDIF.
    ENDMODULE.                 " move_data_from_table  INPUT
    if this helps , kindly award points.
    for any clarification just mail me.
    regards,
    Anversha.S
    [email protected]

  • How to modify the standard table

    plzzzzz answer my qestion.
    how to modify the standard table?
    in my knowedge we have the accese key is it correct or worng

    Hi
    <b>The system asks for access key only of two reasons:</b>
    1) You may be having problem of access rights. You would have to contact basis peopl.
    2) You may try to name an object not complying with the rules. You may have to check with the same.
    the process of getting access key is
    <b>the steps to get access key</b>
    you can also try via transaction OSS1
    In your Inbox, click on 'Registration', then on 'Register Objects', then you will have to choose your installation and give details about your object.
    The details you can get by going to your object and clicking on 'Change' - the pop-up screen which asks you for the access key gives you all the details you need to fill in on OSS1 to get your key.
    <b>or</b>
    U can get Access key from www.service.sap.com
    After getting into the site,select quicklinks, then click s to goto SSCR, in
    that select registration,
    after giving the proper details, u can get the access key
    <b>or</b>
    on sap support portal (sapnet)
    --> key & request
    ---> register SSCR key
    ---> registration
    ---> register developper
    and then choose your rigth installation number
    you can get the access key in this way
    <b>reward if usefull</b>

  • Updating a view after modifying a table...

    Hello,
    Here is the scenario.
    I have a a table in HANA with 50+ columns of data.  I have created both Attribute and Analytical views of that data.  These views have been activated and deployed.  Now I need to modify my table to add two new columns that I will want to included in my existing Attribute and Analytical views.  How can I accomplish this?  It seems that when I modify my table, the views in HANA studio do not have the ability to be updated.  It seems I have to re-create my voews from scratch to now include my two new columns.  Hopefully I am missing something simple.
    Thanks in advance!

    Hi Matt, no way you need to recreate your views after a DDL change on the underlying tables.
    When the table structure changes, you usually need to close any information view editors on the model in question and then reopen the model for editing after the change, but otherwise should be fine. I have done this many times.
    What revision are you working on? Can you give the exact sequence of steps?
    Regards,
    Justin

Maybe you are looking for

  • Problem downloading pictures

    I have moved pictures from my phone to Windows Live Photo Gallery many times.  Today I tried on both phones (mine and my husband's) and did not get the pictures--just iconic preloads.   The screen "says" it has downloaded the pictures, gives the numb

  • PDF Print Settings

    Hi all, Can you please let me know where to find the settings for the following options: 1) We are on BI 7.0 and we are using Portal to run the reports. After the report is generated when we choose the Print Version (to print to PDF), the dialog box

  • Oracle database design

    Hi, I am designing a database and want to design it based on 3NF. I have a table and few columns that are not a one to many relation ship. Can I design it in such a way those columns that are not a child to be in few seperate tables, with one to one

  • I can't snyc my phone it's stuck on back up

    I can't snyc my music from my library in intunes on my computer to my 3g iphone,  It gets stuck in the back up mode step 1 of 5

  • File Upload program with return value

    Hello, I have the following code in my Java program which I use to upload files and return the value of "filename" to the original opening window. Somehow there where changes which now invalidates this piece of code and gave a javascript error messag