Modify the standard records in database table

hi folks,
could u say me , how to modify the standard records(values) in database table.
For example in VBAP is one field like ZWERT(target value) , I wnat to modify the values of this field .
THANKS
KUMAR

Hi,
It's not advisable to modify the standard tables through program. If you want you can do using MODIFY.
MODIFY database_table FROM TABLE itab.
Thanks,
Sri.

Similar Messages

  • I want to delete the transactional record from database table

    Hai,
    I want to delete the transactional data from database table with out using the dialog programming is it there any trancation for this.
    for master data we have the transaction code for delete the records. The t.code is 'OBR2'.
    Plz help in that cse.
    Thanks and regards,
    P.Naganjana Reddy

    Hai,
    Plz help me urgent.
    I am asking i want to delete transactional data from database table without using the dialog programming.
    Thanks and Regards,
    P.Naganjana

  • To modify a field in a database table based record identification by primar

    hi
    i want to to modify a field in a database table based record identification by primary key filed and two more fields
    ie customer (primary key
    i want to modify record from intenal table the record existing with primary key field customer
    the status field needs to be mofied as " value rolled"
    the below code is happening
    loop at it_record into wa_Record
    wa_inv-customer (primary key) = wa_Record=custome
    wa_inv-date = wa_Record-date
    ...so one
    append wa_inv to it_invest
    clear wa_inv
    endloop.
    if not it_invest  is initial
    modify TABle1 ( this table is data base table which needs to be mofified) based on the primary key field
    and also date field and status field which is not primary key.
    regards
    arora

    Hi there.
    Your requirement is to update a Z Database table from your internal table, right? You have several options:
    LOOP AT it_invest INTO wa_inv.
      UPDATE dbtable
         SET date = wa_inv-date
       WHERE prim_key = wa_inv-prim_key
         AND any_field = wa_inv-any_field.
    ENDLOOP.
    or
    LOOP AT it_invest INTO wa_inv.
      UPDATE dbtable FROM wa_inv. "if wa_inv of same type of dbtable
    ENDLOOP.
    In the first example, I wrote any field because you can update dbase table, filtering for fields that don't belong to the primary key. However, remember that you will change all records that respect the key you used (so, in your case, use the primary key).
    Regards.
    Valter Oliveira.

  • Problem in modifying the existing record in table control

    Hi Experts,
    I have one table control.I have entered one record and save it.When I am modifying the same record a duplicate record is created.I need if I modify the same record that record should only modify.How to delete the duplicate record.

    Hi,
    In Flow logic.
    LOOP .                        
      MODULE tbc_modify ON CHAIN-REQUEST.
      MODULE tbc_mark.     
    ENDLOOP.    
    In module.
    MODULE tbc_modify INPUT.
      MODIFY t_data
        FROM fs_data
       INDEX tbc-current_line.
      IF sy-subrc NE 0.
        APPEND fs_data TO t_data.
      ENDIF.                              
    ENDMODULE.                            
    MODULE tbc_mark INPUT.
      DATA: tbc_wa2 LIKE LINE OF t_data.
      IF tbc-line_sel_mode = 1
      AND fs_data-mark = 'X'.
        LOOP AT t_data  INTO tbc_wa2
         WHERE mark = 'X'.
          tbc_wa2-mark = ''.
          MODIFY t_data
            FROM tbc_wa2
            TRANSPORTING mark.
        ENDLOOP.                          .
      ENDIF.                             
      MODIFY t_data  FROM fs_data
        INDEX tbc-current_line
        TRANSPORTING mark.      
    ENDMODULE.
    Edited by: sapabap403 on Aug 31, 2011 9:29 AM

  • Do you know of a standard tool to compare the fields of 2 database tables?

    do you know of a standard tool to compare the fields of 2 database tables? please note i dont want to compare data just the fields.
    ~Suresh

    Hi,
    I am not aware any standard tool but you can write custom report to use FM DDIF_FIELDINFO_GET to get fields information of SAP database table.
    Call the above FM twice in order to get field names for two different database tables. Then compare the results (table parameter DFIES_TAB) to find out the differences of field names.
    Hope this will help ...
    Regards,
    Ferry Lianto

  • 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>

  • Add a new record in database table without using table maintance generator

    Hi Expart ,
                  Plz. tell me how to add new record in database table without using table maintance ganerator ....give me one ex.
    Regards
    Bhabani

    Hi,
    The other way to safely handle the modification of tables is through is by programs that can be done with SE38 or SE80.
    To insert into database table we use INSERT statement :
    1. To insert a single line into a database table, use the following:
    INSERT INTO <target> VALUES <wa>.
    INSERT <target> FROM <wa>.
    2. To insert a several lines into a database table, use the following:
    INSERT <target> FROM TABLE <itaba>.
    Or even we can use MODIFY statementas this single statement is used to insert as well as update the records of database table.
    MODIFY <target> FROM <wa>.
    or MODIFY <target> FROM TABLE <itab>.
    thanx.
    Edited by: Dhanashri Pawar on Sep 10, 2008 12:25 PM
    Edited by: Dhanashri Pawar on Sep 10, 2008 12:30 PM

  • Inserting new records into database table at runtime

    Hi all ,
    How to insert new records into database table at runtime on click update?
    Thanks.

    Hi Sasikala,
    Just for your understanding am giving a sample code snippet which you can use to read the contents of your Table UI element & save the data on to your database. Suppose you have a button up on pressing which you want to read the data from your screens table & save on to the database then you can proceed as shown below:
    1) Obtain the reference of your context node.
    2) Fetch all the data present in your table into an internal table using methods of if_wd_context_node
    3) Use your normal ABAP logic to update the database table with the data from your internal table
    In my example I have a node by name SFLIGHT_NODE and under this I have the desired attributes from SFLIGHT. Am displaying these in an editable table & the user would press up on a push button after making the necessary changes to the tables data. I would then need to obtain the tables information & save on to the database.
    data: node_sflight           type ref to if_wd_context_node,
            elem_sflight           type ref to if_wd_context_element,
            lt_elements            type WDR_CONTEXT_ELEMENT_SET,
           stru_sflight           type if_main=>element_sflight_node,
           it_flights             type if_main=>elements_sflight_node.
    "   navigate from <CONTEXT> to <SFLIGHT_NODE> via lead selection
        node_sflight_node = wd_context->get_child_node( name = 'SFLIGHT_NODE'  ).
       lt_elements = node_sflight->get_elements( ).
    "   Get all the rows from the table for saving on to the database
        loop at lt_elements into elem_sflight.
          elem_sflight->get_static_attributes( importing static_attributes = stru_sflight ).
          append stru_sflight to it_flights.
        endloop.
    " Finally save the entries on to the database
        modify ZSFLIGHT99 from table it_flights.
        if sy-subrc eq 0.
    endif.
    However a word of caution here.... SAP doesn't ever recommend directly modifying the database through an SQL query. You would preferably make use of a BAPI for the same. Try go through Thomas Jung's comments in [here|modify the data base table which is comming dynamiclly;.
    Regards,
    Uday

  • How to fnd SAP STANDARD program of Database table

    Hi to all,
    Please can anybody tell me , how to find out SAP standard program of database Tables  S070    (Breakdown Statistics).
    As this table contain two filelds Time To Repair and Time Between Repair , i want to knew how the standard program for the table have calculate them.
    i shall be thankfull to you for this.
    Regards
    Pavneet Rana

    Hi,
    Program for table is generated dynamically for each user ID, when ever you change the selection screen in SE16 or when you are executing the table entries for first time. Usually it starts with /1BCDWB/DB followed by table name. In your case it would be /1BCDWB/DBS070.
    Go to Se16, enter your table name and click enter. Once you are in selection screen, goto Menu=>system=>Status. Here you can see the program name.
    Thanks,
    Vinod.

  • How to tracke the new entries in database table ?

    Hi,
    How to tracke the new entries in database table ? is there any FM or report is there to check it ?
    regards
    vishnu

    Hi Vishnu,
    u can write a report program for this and in that use the event  :
    AT NEW <field-name> ( use primary key)
    your statements
    ENDAT
    for eg.
    loop at itab ( herfe itab must be of type of table for which u want to track new entries)
    at new matnr
    write:/ new record
    endat
    endloop.
    schedule this report in background to run in every 5 or 10 mins as per your requirement and hence changes can be tracked.
    regards
    Vinod

  • Retrive last inserted  record  from database table

    Hi,
    some body inserting a record into table 'A' through some procedure/java program.i want to retrive the last inserted record from database table.records are not stored in order.Can any body help me.

    In general, unless you are storing a timestamp as part of the row or you have some sort of auditing in place, Oracle has no idea what the "first" or "last" record in a table is. Nor does it track when a row was inserted.
    - If you have the archived logs from the point in time when the row was inserted, you could use LogMiner to find the timestamp
    - If the insert happened recently (i.e. within hours), you may be able to use flashback query to get the value
    - If you're on 10g or later and the table was built with ROWDEPENDENCIES and the insert happened in the last few days and you can deal with a granularity of a few seconds and you don't need 100% accuracy, you could get the ORA_ROWSCN of the row and convert that to a timestamp.
    If this is something you contemplate needing, you need to store the data in the row or set up some sort of auditing.
    Justin

  • Fetch last record from database table

    hi,
    how to fetch last record from database table.
    plz reply earliest.
    Regards,
    Jyotsna
    Moderator message - Please search before asking - post locked
    Edited by: Rob Burbank on Dec 11, 2009 9:44 AM

    abhi,
    just imagine the table to be BSEG or FAGLFLEXA... then what would be performance of the code ?
    any ways,
    jyotsna, first check if you have a pattern to follow like if the primary key field have a increasing number range or it would be great if you find a date field which stores the inserted date or some thing..
    you can select max or that field or order by descending using select single.
    or get all data.. sort in descending order.(again you need some criteria like date).
    read the first entry. using read itab index 1

  • Modifying the Standard Report template

    Hi
    I have a report with 10 columns and 2 of them are wb_id, pa_id. Depending on the search critiria either wb_id or pa_id will be null. I want to highlight the row with some color when I select any row and I am modifying the standard template and
    column template condition is 'Use Based on PL/SQL Expression' and it is
    NVL(#COL02#,0) = NVL(:GLOBAL_WB_ID,0). But when I run the report it is giving the error that encountered # wherea as expecting.......
    Thans a lot.

    Hi,
    I have a report page uses the following block of pl/sql as its source.
    This calls a function by passing page items and this functions returns sql query.
    DECLARE
    V_SQL VARCHAR2(4000);
    BEGIN
    V_SQL := WF_PCK02.search_wb_pa(
    :P1000_WB_ID,:P1000_PA_ID,:P1000_RIVER_NO,:P1000_GENRE,:P1000_LOCATION,:P1000_WATER_DEPENDENT,:P1000_BASELINE,
    :P1000_NBT_PRESSURE_TYPE_ID,:P1000_PURPOSE,:P1000_NBT_SIC_DESC,:P1000_ACTIVITY_DESC,:P1000_NBT_MORPH_ACTIVITY,
    :P1000_SW_ASSET,:P1000_ORDER_BY,:P1000_R1);
    RETURN V_SQL;
    END;
    Now if user is searching for water bodies the results look like this.
    10317 - Allt Ceitlein SURFACE WATER River Y 2a 2b N N
    10318 - Allt a Chaorainn SURFACE WATER River Y 2b 2b N N
    10319 - River Coupall SURFACE WATER River Y 2b 2b Y N
    10320 - Allt a Bhiorain SURFACE WATER River Y 2b 2b Y N
    if the user is searching for PAS the results look like this.
    - UKS7992310 Lochs Long and Goil SHELLFISH WATER - Y 1a 9z N N
    - UKS79923100 Ulva SHELLFISH WATER - Y 1a 9z N N
    - UKS79923101 Ura Firth SHELLFISH WATER - Y 1a 9z N N
    - UKS79923102 Voe of Clousta SHELLFISH WATER - Y 1a 9z N N
    - UKS79923103 Wadbister Voe SHELLFISH WATER - Y 1a 9z N N
    - UKS79923104 Inner West Loch Tarbert SHELLFISH WATER - Y 1a 9z N N
    I had written a java script to select the current row, and page refreshes when I click
    any where on the row and displays the display item saying that
    currently selected id is 10317
    or
    Currently selected id is UKS79923100
    and also assigns the 10317 to GLOBAL_WB_ID or UKS79923100 to GLOBAL_PA_ID
    Now my user want to change the color of the currently selected row.
    For this I am trying to change the report template like this
    Column Template 1
    <td class="t15data"#ALIGNMENT# style="background:#d1e2f3">#COLUMN_VALUE#</td>
    Column Template 1 Condition
    NVL(#2#,0) = NVL(:GLOBAL_WB_ID,0);
    BUT
    it is giving the following error.
    Encountered the symbol "<" when expecting one of the following: ( ) - + case mod new not null others table avg count current ........................
    ERR-1025 Error processing PLSQL expression. :GLOBAL_WB_ID = NVL(10317,0);
    Then I changed the condition to substitute the #2# in single quotes like this.
    NVL('#2#',0) = NVL(:GLOBAL_WB_ID,0);
    BUT it is giving this error
    Encountered the symbol "10317" when expecting one of the following: ( ) - + case mod new not null others table avg count current ........................
    ERR-1025 Error processing PLSQL expression. :GLOBAL_WB_ID = NVL('10317',0);
    I am unable to understand where the error is coming from.
    Please help me.
    10317 is the first row of the result set.
    Thanks a million in advance.

  • Modify the standard segment value

    Hi Experts,
    I have a piece of code to modify the standard idoc segment value.
            wa_idoc_data_mon-segnam = c_segale_e1edl24.
            wa_in_e1edl24 = idoc_data-sdata.
            wa_in_e1edl24-matnr = wa_in_e1edl24-matnr+11(7).
            wa_idoc_data_mon-sdata = wa_in_e1edl24.
           MODIFY idoc_data FROM wa_idoc_data_mon INDEX g_indx.
    This modify statement works but it will change the normal structure of idoc type as we have in WE30 and put the status in RED.
    If i use transporting sdata then it will not modify the material to last 7 char.
    Thanks,
    Sahil

    Hi,
    It's not advisable to modify the standard tables through program. If you want you can do using MODIFY.
    MODIFY database_table FROM TABLE itab.
    Thanks,
    Sri.

  • How to delete the duplicate records in a table without promary key

    I have a table that contains around 1 million records and there is no promary key or auto number coulums. I need to delete the duplicate records from this table. what is the simple effective way to do this.

    Please see this link:
    Remove duplicate records ...
    sqldevelop.wordpress.com

Maybe you are looking for