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.

Similar Messages

  • 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 can i update the REMARK field in ADRT database table

    Hi all,
    How can i update the REMARK field in ADRT database table
    By using Function modules or BAPI’s
    Please reply me fast

    Hi,
    you can try this code:
        SELECT SINGLE * FROM KNA1 WHERE KUNNR = wa_kunnr.
        IF sy-subrc = 0.
          CLEAR adrct.
          SELECT SINGLE * FROM adrct WHERE addrnumber = kna1-adrnr.
          IF sy-subrc = 0.
            adrct-remark = wa_remark.
            MODIFY adrct.
          ENDIF.
        ENDIF
    best regards,
    Thangesh

  • Extracting Values of a Field from a Database Table in SAP ECC System

    Hi,
    I downloaded Extracting Values of a Field from a Database Table in SAP ECC System Using MII 12.0
    senario from sdn. I'm trying to do that senario in MII 12.05. But I have problem with section 6 in page 7 (you can supply senario from sdn)
    "6- Under the loop of Repeater, use action u2018Rowu2019 to append just the string part of the WA which will display only values for field u2018Batchu2019"
    I did not find WA elemen in Output element of Repeater_0
    How can I create WA element?
    Thanks.

    Cemil,
    Set up a SAP JCo Interface action block.  Use the RFC name RFC_READ_TABLE.
    In the link editor map the table to "MARA", set RowCount to something small (20 is good sample size) and create an xml transaction property named FIELDS and copy the following into it:
    <?xml version="1.0" encoding="UTF-8"?><FIELDS>
          <item>
            <FIELDNAME>MATNR</FIELDNAME>
            <OFFSET/>
            <LENGTH/>
            <TYPE/>
            <FIELDTEXT/>
          </item>
          <item>
            <FIELDNAME>MTART</FIELDNAME>
            <OFFSET/>
            <LENGTH/>
            <TYPE/>
            <FIELDTEXT/>
          </item>
          <item>
            <FIELDNAME>BSTME</FIELDNAME>
            <OFFSET/>
            <LENGTH/>
            <TYPE/>
            <FIELDTEXT/>
          </item>
          <item>
            <FIELDNAME>XCHPF</FIELDNAME>
            <OFFSET/>
            <LENGTH/>
            <TYPE/>
            <FIELDTEXT/>
          </item>
          <item>
            <FIELDNAME>DATAB</FIELDNAME>
            <OFFSET/>
            <LENGTH/>
            <TYPE/>
            <FIELDTEXT/>
          </item>
        </FIELDS>
    Then link the Transaction.FIELDS to SAP_JCo_Interface_0.Request{/RFC_READ_TABLE/TABLES/FIELDS}.  You may run into problems with two other fields and optionally they can be removed (set link type to remove xml).  I usually remove them initially for testing.  The two fields are:
    SAP_JCo_Interface_0.Request{/RFC_READ_TABLE/INPUT/NO_DATA}
    SAP_JCo_Interface_0.Request{/RFC_READ_TABLE/INPUT/DELIMITER} (or you can set this to something like a semicolon,";" or tilda,"~".  I find it easier to caclulate position by length, but that is my own idiosyncrasy.)
    Once you get this one working, we can explore how to do filtering on the dataset.  Your output should be something like this:
    <?xml version="1.0" encoding="utf-8"?>
    <RFC_READ_TABLE>
      <INPUT>
        <DELIMITER />
        <NO_DATA />
        <QUERY_TABLE>MARA</QUERY_TABLE>
        <ROWCOUNT>20</ROWCOUNT>
        <ROWSKIPS>0</ROWSKIPS>
      </INPUT>
      <TABLES>
        <DATA>
          <item>
            <WA>000000000000000023ROH 00000000</WA>
          </item>
          <item>
            <WA>000000000000000038HALB 00000000</WA>
          </item>
          <item>
            <WA>000000000000000043HAWA 00000000</WA>
          </item>
          <item>
            <WA>000000000000000058HIBE 00000000</WA>
          </item>
          <item>
            <WA>000000000000000059HIBE 00000000</WA>
          </item>
          <item>
            <WA>000000000000000068FHMI 00000000</WA>
          </item>
          <item>
            <WA>000000000000000078DIEN 00000000</WA>
          </item>
          <item>
            <WA>000000000000000088FERT 00000000</WA>
          </item>
          <item>
            <WA>000000000000000089FERT 00000000</WA>
          </item>
          <item>
            <WA>000000000000000098HALB 00000000</WA>
          </item>
          <item>
            <WA>000000000000000170NLAG 00000000</WA>
          </item>
          <item>
            <WA>000000000000000178NLAG 00000000</WA>
          </item>
          <item>
            <WA>000000000000000188NLAG 00000000</WA>
          </item>
          <item>
            <WA>000000000000000288HALB 00000000</WA>
          </item>
          <item>
            <WA>000000000000000358HAWA 00000000</WA>
          </item>
          <item>
            <WA>000000000000000359HAWA 00000000</WA>
          </item>
          <item>
            <WA>000000000000000521HAWA 00000000</WA>
          </item>
          <item>
            <WA>000000000000000578FERT 00000000</WA>
          </item>
          <item>
            <WA>000000000000000597HAWA 00000000</WA>
          </item>
          <item>
            <WA>000000000000000598VERP 00000000</WA>
          </item>
        </DATA>
        <FIELDS>
          <item>
            <FIELDNAME>MATNR</FIELDNAME>
            <OFFSET>000000</OFFSET>
            <LENGTH>000018</LENGTH>
            <TYPE>C</TYPE>
            <FIELDTEXT>Material Number</FIELDTEXT>
          </item>
          <item>
            <FIELDNAME>MTART</FIELDNAME>
            <OFFSET>000018</OFFSET>
            <LENGTH>000004</LENGTH>
            <TYPE>C</TYPE>
            <FIELDTEXT>Material Type</FIELDTEXT>
          </item>
          <item>
            <FIELDNAME>BSTME</FIELDNAME>
            <OFFSET>000022</OFFSET>
            <LENGTH>000003</LENGTH>
            <TYPE>C</TYPE>
            <FIELDTEXT>Purchase Order Unit of Measure</FIELDTEXT>
          </item>
          <item>
            <FIELDNAME>XCHPF</FIELDNAME>
            <OFFSET>000025</OFFSET>
            <LENGTH>000001</LENGTH>
            <TYPE>C</TYPE>
            <FIELDTEXT>Batch management requirement indicator</FIELDTEXT>
          </item>
          <item>
            <FIELDNAME>DATAB</FIELDNAME>
            <OFFSET>000026</OFFSET>
            <LENGTH>000008</LENGTH>
            <TYPE>D</TYPE>
            <FIELDTEXT>Valid-From Date</FIELDTEXT>
          </item>
        </FIELDS>
        <OPTIONS />
      </TABLES>
    </RFC_READ_TABLE>
    Add a repeater sourced on:
    SAP_JCo_Interface_0.Response{/RFC_READ_TABLE/TABLES/DATA/item}
    Link your repeater output to a tracer with this:
    Repeater_0.Output{/item/WA}
    What you will see in each tracer message is a single line of data with all the fields contents concatenated together.  You can look up what each field in the string represents by the length of the field as returned in the Response segment of the RFC_READ_TABLE rfc.  Then you can parse out the data you are interested in.
    Give this a try and let me know how you succeeded.
    By the way, I could not find the scenario you referred to.  Can you post a link?
    Regards,
    Mike
    Edited by: Michael Appleby on Jan 12, 2009 5:16 PM

  • To replace values of one of the field in the database table

    How to replace values of one of the field in the database table with a new values? Pls help to solve

    Hi
    You can use the UPDATE command to update one of the field value in a table
    see the UPDATE syntax and use it
    but in real time you should not do like this
    Regards
    Anji

  • How to delete data from single field in a database table?

    Hi guys,
         Plz suggest me How to delete data from single field in a database table?
    thnks,
    pavan

    hi
    in addition to abv details..chk this:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb3aef358411d1829f0000e829fbfe/content.htm
    http://dev.mysql.com/doc/maxdb/en/34/ee7fbd293911d3a97d00a0c9449261/content.htm
    regards,
    madhu

  • How to Find the Data Type of the Field In a Database Table

    Hi Experts,
    I'm currently working on a program which needs to find out the data type of the given field in a database table. In addition to accessing DD03L directly, is there any other workaround such as function module to help me achieve this? It would be helpful if a demo example could be provided.
    Thanks a lot.

    Hi,
    Use this..
    DESCRIBE FIELD dobj  TYPE typ.
    write typ.
    type will contain the data type of the object.
    and check this thread also....
    Re: How to get datatype of fields in dynamic structures
    Cheers,
    Simha.
    Reward all the helpful answers..

  • Modify the Field Type of standard Table fields in a Query

    Hello. I have a question.
    Is there a way to "modify" the field type for standard table fields that are included in a Query?
    I made a simple query out of a join of tables, but several fields have a lot of decimals, and I would like to present them in the query without any decimals, just as a regular "N" field.
    I tried the possibility of creating extra local fields where all I do is transfer the value to the new "N" field, but I have many fields like this, so if there's a better way; I'd prefer that.
    Maybe somewhere in the InfoSet there's a way to modify the type of the standard table fields?
    Thank you.

    Hi,
    This document may help you out.
    [http://help.sap.com/saphelp_erp60_sp/helpdata/en/d2/cb4468455611d189710000e8322d00/frameset.htm|http://help.sap.com/saphelp_erp60_sp/helpdata/en/d2/cb4468455611d189710000e8322d00/frameset.htm]
    Cheers,

  • How to find the structure fields data in database tables?

    how to find the structure fields data in database tables?

    Your question doesn't appear to be Web Dynpro ABAP related. Please only post questions in this forum if they are directly Web Dynpro ABAP related.  There are several other more general ABAP related forums.

  • Mapping the CMP Fields with the Database Table using Websphere???

    Hi,
    How to Map the CMP Fields with the Database Table using Websphere
    thru ejb.jar.xml???
    Thanks,
    JavaCrazyLover

    Hi,
    How to Map the CMP Fields with the Database Table using Websphere
    thru ejb.jar.xml???
    Thanks,
    JavaCrazyLover

  • 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

  • Backing Up Database Table and Records in Oracle 10g

    Hi All,
    I created database for my company with Oracle 10g Database Server and want to backup all my database tables and records within (i.e creating another username inside the data and transfer them) and outside (i.e transfering them in another destination outside the database server) the database. Could you please instruct me on how to achieve?
    I look forward to hearing from you all.
    Thank you.
    Jc

    Hi, use RMAN utility
    do this
    rman target sys/*** nocatalog
    run {
      allocate channel t type disk;
      backup
        format '/app/oracle/backup/%d_t%t_s%s_p%p'
          (database);
       release channel t;
    {code
    Also read backup and recovery guide at http://download.oracle.com/docs/cd/B19306_01/backup.102/b14192/toc.htm
    regards                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Change field value in a table, based on another field value in the same row (for each added row)

    Please Help, I want to change field value in a table, based on another field value in the same row (for each added row)
    I am using this code :
    <HTML>
    <HEAD>
    <SCRIPT>
    function addRow(tableID) {
    var table = document.getElementById(tableID);
    var rowCount = table.rows.length;
    var row = table.insertRow(rowCount);
    var colCount = table.rows[0].cells.length;
    for(var i=0; i<colCount; i++ ) {
    var newcell = row.insertCell(i);
    newcell.innerHTML = table.rows[1].cells[i].innerHTML;
    switch(newcell.childNodes[0].type) {
    case "text":
    newcell.childNodes[0].value = "";
    break;
    case "checkbox":
    newcell.childNodes[0].checked = false;
    break;
    case "select-one":
    newcell.childNodes[0].selectedIndex = 0;
    break;}}}
    function deleteRow(tableID) {
    try {var table = document.getElementById(tableID);
    var rowCount = table.rows.length;
    for(var i=0; i<rowCount; i++) {
    var row = table.rows[i];
    var chkbox = row.cells[0].childNodes[0];
    if(null != chkbox && true == chkbox.checked) {
    if(rowCount <= 2) {
    alert("Cannot delete all the rows.");
    break;}
    table.deleteRow(i);
    rowCount--;
    i--;}}}catch(e) {alert(e);}}
    </SCRIPT>
    </HEAD>
    <BODY>
    <INPUT type="button" value="Add Row" onClick="addRow('dataTable')" />
    <INPUT type="button" value="Delete Row" onClick="deleteRow('dataTable')" />
    <TABLE id="dataTable" width="350px" border="1">
    <TR>
    <TD width="32"></TD>
    <TD width="119" align="center"><strong>Activity</strong></TD>
    <TD width="177" align="center"><strong>Cost</strong></TD>
    </TR>
    <TR>
    <TD><INPUT type="checkbox" name="chk"/></TD>
    <TD>
    <select name="s1" id="s1">
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    </select>
    </TD>
    <TD><input type="text" name="txt1" id="txt1"></TD>
    </TR>
    </TABLE>
    </BODY>
    </HTML>

    Hi,
    Let me make sure u r working with table control.
    First u have to create a event(VALIDATE) to do the validation.
    Inside the event,
    1. First get the current index where user has pointed the curson
    2. Once u get the index read the internal table with index value.
    3. Now u can compare the col1 and col2 values and populate the error message.
    1. DATA : lo_elt TYPE REF TO if_wd_context_element,
                   l_index type i.
    lo_elt = wdevent->get_context_element( name = 'CONTEXT_ELEMENT' ).
         CALL METHOD LO_ELT->GET_INDEX( RECEIVING  MY_INDEX = l_index.
    above code should be written inside the event.
    Thanks,

  • Creation of key field in a database table

    Hi All,
    As per my requirement, i have to add few new key fields in an existing table.
    Now total number of key fields are 17, but while saving this is giving me an syntax error stating 'According to SAA standard key fields cannot be more that 16'.
    I s there any other go? i can not reduce the number of key fields.
    Regards,
    Pankaj.
    Edited by: Pankaj Bist on Sep 5, 2008 3:24 PM

    Hi,
    In the se11 transaction,In the menu bar o like this.
    Utilites-->Database Utility and the Press the button Activate and Adjust Database.
    Note:
    Make sure that you total data in the table to be downloaded into ur system.
    As ctivate and Adjust Database makes data to be deleted.
    Regards,
    Rama.

  • How can I Insert a Text field in a DATABASE TABLE???

    Hello at all,
    i have a database Table ZTEST with 2 columns.
    MANDT     TYPE     CLNT
    TEXT         TYPE     char     (255)
    In my internal table tab, i have a text content. I want insert this content in my database table ZTEST.
    DATA: tab TYPE TABLE OF ZTEST,
               lin TYPE ZTEST.
    lin-text = 'HELLO WORLD'
    APPEND lin TO tab.
    INSERT INTO ZTEST VALUES tab.
    Commit Work.
    Is this correct???? BECAUSE it doesnt work.
    Edited by: ETN_58 on Mar 31, 2010 10:27 AM

    Hi All,
    Here table ZTEST has two fields kunnr and text where kunnr is the key field.
            REPORT  ZATEST                                  .
           tables ztest.
          DATA: itab TYPE TABLE OF ZTEST with header line.
            itab-kunnr = '67890'.
            itab-text = 'HELLO WORLD'.
            APPEND itab.
           if sy-subrc eq 0.
               INSERT  ZTEST from table itab.
            Commit Work.
          endif.
           Check with this, its working fine.
                 Regards,
                Md Ziauddin.

Maybe you are looking for

  • Join these 2 iTunes folders in Windows 7 preserving artwork

    I have searched and not found an up to date understandable answer as how to join 2 working portable same apple user iTunes folders into one itunes folder while above all else preserving hand edited Abum Artwork and hand edited tags. ( It was many hou

  • FTP Server to Server file transfter

    I am using Apache common.net package 2.0 for my FTP file transfer from one server to another server. And i'm using eclipse 3.3.2 IDE for my code execution. Following is the function i'm using for ftp to ftp file transfer. public void severtoservercop

  • Why is FCPX freezing repeatedly while moving title clips?

    Hello to all. I am facing an exasperating situation. I am at the tag end of a project and I find that FCPX is freezing whenever I try to relocate a title. Have been forcrd to repeatedly force quit! Have trashed the preferences repeatedly, have restar

  • Robotics/ DaNI robot ( NIrobotics starter kit 2.0)

    Dear All I would like to use A * algorithm to find the shotest path in indoor environment by DanI robot  In addition, the robot includes PING ultrasonic sensor .  My question is any document or advices for avoiding obstacles by using ultrasonic senso

  • Convert InfoPath form to PDF issues

    Hello, We have some web based InfoPath forms hosted in a MOSS 2007 SharePoint environment. Users who have Acrobat professional installed on their computers are having problems converting the forms when using the Adobe PDF Toolbar in IE. There are two