How to delete a record in a connected database?

We are encountering a problem using the delete function for removing a record in a connected database table. The database is an excel-file and we are able to add a new record, update existing records but not delete records. We are using the following script in FormCalc since I read that the function does not work in JavaScript:
$sourceSet.DataConnection.delete()
The error message returned is:
"Deleting data in a linked table is not supported by this ISAM."
We are also curious to know how we can reload the connection so that for example a drop-down list containing values from each record in the table is updated automatically when we insert a new record.
Thanks!
Annika

You also asked:<br /><br /><font color="grey"><i>We are also curious to know how we can reload the connection so that for example a drop-down list containing values from each record in the table is updated automatically when we insert a new record.</i></font><br /><br />You should be able to achieve this quite easily using the Data Drop Down List from the Library palette's Custom tab. This object has a pre-defined Initialize script which populates the list with items from a data connection you specify.<br /><br />While the object is pre-configured to load items from the data connection only upon initialization (which only occurs when the form is loaded and after a data merge), you could move the script into a Script Object function and call it whenever you insert a new record (just after the statement which inserts the record).<br /><br />This is the script from the Initialize event of the Data Drop Down list put into a Script Object function called LoadDropDownList which takes the drop down list to populate using the data connection as a parameter:<br /><pre>function LoadDropDownList(oDropDownList)<br />{<br />     /*     This dropdown list object will populate two columns with data from a data connection.<br />     <br />          sDataConnectionName - name of the data connection to get the data from.  Note the data connection will appear in the Data View.<br />          sColHiddenValue      - this is the hidden value column of the dropdown.  Specify the table column name used for populating.<br />          sColDisplayText          - this is the display text column of the dropdown.  Specify the table column name used for populating.<br />     <br />          These variables must be assigned for this script to run correctly.  Replace <value> with the correct value.<br />     */     <br />     <br />     var sDataConnectionName = "&lt;value&gt;"; //     example - var sDataConnectionName = "MyDataConnection";<br />     var sColHiddenValue = "&lt;value&gt;"; //     example - var sColHiddenValue = "MyIndexValue";<br />     var sColDisplayText = "&lt;value&gt;"; //     example - var sColDisplayText = "MyDescription"<br />     <br />     //     Search for sourceSet node which matchs the DataConnection name<br />     var nIndex = 0;<br />     while(xfa.sourceSet.nodes.item(nIndex).name != sDataConnectionName)<br />     {<br />          nIndex++;<br />     }<br />     <br />     var oDB = xfa.sourceSet.nodes.item(nIndex);<br />     oDB.open();<br />     oDB.first();<br />     <br />     //     Search node with the class name "command"<br />     var nDBIndex = 0;<br />     while(oDB.nodes.item(nDBIndex).className != "command")<br />     {<br />          nDBIndex++;<br />     }<br />     <br />     //     Backup the original settings before assigning BOF and EOF to stay<br />     var sBOFBackup = oDB.nodes.item(nDBIndex).query.recordSet.getAttribute("bofAction");<br />     var sEOFBackup = oDB.nodes.item(nDBIndex).query.recordSet.getAttribute("eofAction");<br />     <br />     oDB.nodes.item(nDBIndex).query.recordSet.setAttribute("stayBOF", "bofAction");<br />     oDB.nodes.item(nDBIndex).query.recordSet.setAttribute("stayEOF", "eofAction");<br />     <br />     //     Clear the list first so that we replace any existing items<br />     <b>oDropDownList</b>.clearItems();<br />     <br />     //     Search for the record node with the matching Data Connection name<br />     nIndex = 0;<br />     while(xfa.record.nodes.item(nIndex).name != sDataConnectionName)<br />     {<br />          nIndex++;<br />     }<br />     var oRecord = xfa.record.nodes.item(nIndex);<br />     <br />     //     Find the value node<br />     var oValueNode = null;<br />     var oTextNode = null;<br />     for(var nColIndex = 0; nColIndex < oRecord.nodes.length; nColIndex++)<br><br />     {<br><br />          if(oRecord.nodes.item(nColIndex).name == sColHiddenValue)<br><br />          {<br><br />               oValueNode = oRecord.nodes.item(nColIndex);<br><br />          }<br><br />          else if(oRecord.nodes.item(nColIndex).name == sColDisplayText)<br><br />          {<br><br />               oTextNode = oRecord.nodes.item(nColIndex);<br><br />          }<br><br />     }<br />     <br />     while(!oDB.isEOF())<br />     {<br />          <b>oDropDownList</b>.addItem(oTextNode.value, oValueNode.value);<br />               oDB.next();<br />     }<br />     <br />     //     Restore the original settings<br />     oDB.nodes.item(nDBIndex).query.recordSet.setAttribute(sBOFBackup, "bofAction");<br />     oDB.nodes.item(nDBIndex).query.recordSet.setAttribute(sEOFBackup, "eofAction");<br />     <br />     //     Close connection<br />     oDB.close();<br />}</pre><br />The required modifications to the original script are in bold.<br /><br />The easiest way to create the Script Object is to right-click on the top-level form object ("form1" by default) in the Hierarchy palette and select the <i>Insert Script Object</i> option. This will insert an un-named Script Object which you should then rename to something meaningful like, "ScriptObject". Once you've done this, you can call the function from any event on any object on your form with the following JavaScript:<br /><pre>ScriptObject.LoadDropDownList(&lt;SOM expression for drop down list&gt;);</pre><br />If you were calling this function on an "add record" button's Click event, the drop down list was named "DropDown" and both objects were in the same subform, you would do this:<br /><pre>ScriptObject.LoadDropDownList(DropDown);</pre><br />Stefan<br />Adobe Systems

Similar Messages

  • I have an 8g Ipod Touch and I accidentally recorded some video on it.  Now I don't know how to delete it.  When I connect to Itunes, there is no 'Video' Folder, so I can't even see/find the videos to delete them!

    I have an 8g Ipod Touch and I accidentally recorded some video on it.  Now I don't know how to delete it.  When I connect to Itunes, there is no 'Video' Folder, so I can't even see/find the videos to delete them!  I am not very experienced with Itunes, please help me.

    On the iPod go to the Photo app and then to the Camera Roll. Tap on the the video yu want to delete and then tap on the trash can icon in the lower right.

  • Regarding how to delete the record in internal table

    Hi experts ,
    how to delete the record in intarnal table after validating the data,
    if record contains invalid fields?
    i am giving my code see this and give me the answer?
    loop at it_data into wa_data .
    Validate  Cost Center
        READ TABLE it_kostl INTO wa_kostl WITH KEY kostl = wa_data-kostl BINARY SEARCH.
        IF sy-subrc NE 0.
          PERFORM update_error_log USING wa_data
                                         text-004.
        ENDIF.
    Validate source file material ( material number )
    loop at it_mara into wa_mara .
      read table it_ausp into wa_ausp with key atwrt = wa_data-i_matnr .
               if sy-subrc NE 0 .
       PERFORM update_error_log USING wa_data
                                           text-002.
    delete it_data-objek .
         else.
      read table it_mara into wa_mara with key  matnr = wa_ausp-objek .
           if sy-subrc EQ 0 .
           wa_data-objek = wa_mara-matnr.
           wa_data-matkl = wa_mara-matkl.
         ENDIF.
         Modify it_data from wa_data  .
      endif.
    *endloop.
    Validate unit of measure (unit)
        READ TABLE it_t006 INTO wa_t006 WITH KEY msehi = wa_data-unit .
        IF sy-subrc NE 0.
          PERFORM update_error_log USING wa_data
                                         text-003.
        endif.
    Validate delivery location ( storage location )
        READ TABLE it_lgort INTO wa_lgort WITH KEY del_loc = wa_data-del_loc.
        IF sy-subrc NE 0.
          PERFORM update_error_log USING wa_data
                                         text-001.
             if wa_data-flag ='x' .
          delete it_data from  wa_data .
        endif.
        ENDIF.
    endloop.

    Hi Naren,
    First get the index number of the IT_data table and store it in one variable whose declaration like this.
    data: tabix type sy-tabix.
    while reading the internal table it_data set the tabix variable.
    tabix = sy-tabix.
    Instead of  the above use below one.
    Delete it_data-objek
    Use the Below statement it will delete  the row from the internal table.
    Delete it_data-objek index tabix
    Thanks,
    Chidanand

  • How to delete  the record  of saved HRA Details...

    Hi Experts,
    I have put the details of HRA Correctly.But while updating HRA In 0008 Infotype i wrongly updated the wagetype,How should i change the Wagetype.
    When i m trying to delete it is showing  RECORD CAN NOT BE DELETED (TIME CONSTRAINT 1).
    How can delete the record.
    Thanking u .
    Sai

    Hi
         Hope doing well ........ No need to delete any infotype but u can go to PA30 and in change mode their u can delete the wagetype which is wrongly entered
    Rajeshk

  • How to delete duplicate records in 10 G.

    how to delete duplicate records in 10 G.

    --Here is one way to do it using a second table 
    create table temp1
    (col1 char(1));
    --Table created.
    insert into temp1 (col1) values('A');
    insert into temp1 (col1) values('B');
    insert into temp1 (col1) values('B');
    --1 row created.
    --1 row created.
    --1 row created.
    create table temp2 as select distinct * from temp1;
    --Table created.
    --now you have a second table with no duplicates
    --truncate your old table
    truncate table temp1;
    --Table truncated.
    --and reload it with data from the new table
    insert into temp1 select * from temp2;
    --2 rows created.
    --then drop the temp2 table
    drop table temp2

  • How to delete a record from BSEG table

    Dear Experts,
    How to delete a record from BSEG table.
    If there possible to delete some records from transparent table ?
    Please help.
    Regards,
    Tan

    Hi,
    Deleting a record from a standard table can be done only if table maintenance exists - Cehck tcode - SM30.  But it is not advisable to delete records, coz the records may be dependent on many other tables.  If u delete in a single place, there may be chance that inconsistency in the data happens and hence will affect ur financial statements.
    Pls. assign points, if useful
    Regards,
    Sridevi

  • HT5858 HOW TO DELETE A RECORDING on i phone

    how to delete a recording on iphone5c

    Assuming you mean from the Voice Memo app... with the list of recordings showing, swipe right to left on the recording and tap the red Delete button.

  • How to delete the record in Table

    Hi Guru's,
    i have Table which contain no.of Records.
    i want to deleted one record. if i go to Table maint.Generator....from table itself..
    how to do that... when we deleting the record. can we create new TR for that?
    can anybody tell me.
    Thanks in Advance,
    venkat

    Hi,
    it is answered, here for my table there is no Table Maint.Generator.
    i just explained how i have done it.
    i just simply gone into Debug mode. there
    code = Dele.
    i have given. then i came out from debug mode to Table. there i just got Delete button on application tool bar.
    i selected the record then icliked on Delete button.
    it is got deleted.
    But it is not asking for any new Transport Request.
    Regards,
    Venkat

  • How to delete the record in the file present in the application server?

    Hi,
      I have two questions.
      i) How can I delete a record based on some condition in the recordx in the file that is present in the application server?
      ii) How can I lock the users whiel one user is accessing the file on the application server?
    Thanks in advance.
    Suvan

    Hi,
    If u want a frequent deletion this approach to delete a record from a file will havee unnecesary copy of records from one file to another and deletion of one file and renaming activities.
    Instead what u can do is Add and field del_flag to ur record structure.
    If u want to delete the record from a file just mark this del_flag as 'X'.
    While processing u can have a loop like
    loop at it_XXX where del_flag <> 'X'.
    endloop.
    This will logically delete the record.
    When u r to finish the application at that time only perform this copying / deleting / and renaing activity
    Hope this helps.
    Cheers,
    Nitin

  • HOW to delete the records in CO1P?

    Hi all:
    When i close the PO,i find the PO have CO1P records.However ,the PO has been settled. Then how can i  delete the records in CO1P for this PO.

    Dear,
    CO1P:
    Normally the Goods Movement errors are updated in Table AFFW - Goods Movements with Errors from Confirmations and in transaction COGI.
    If the table is locked during background using update control for the confirmation then the errors are recorded in CO1P.
    COFC:
    Used for Reprocessing of errors in confirmation related to actual cost calculations.
    Please run CORUPROC Program.
    Please check this link also for further help
    http://help.sap.com/saphelp_46c/helpdata/en/e3/7cd32396f611d1b5a60000e8359890/frameset.htm
    Regards,
    R.Brahmankar

  • How to delete the record in the table without using lead selection?

    hi,
    I have added the separate column "delete" to the table uielement and so for each record or row of the table the appropriate "delete" link to action will be there................the code below works when the particular row is selected through lead selection only.......
    help me how to delete without using lead selection.....
      DATA:
      NODE_MODULE                         TYPE REF TO IF_WD_CONTEXT_NODE,
      ELEM_MODULE                         TYPE REF TO IF_WD_CONTEXT_ELEMENT,
      STRU_MODULE                         TYPE IF_V_MODULE=>ELEMENT_MODULE .
       data itab TYPE TABLE OF zac_modules.
      navigate from <CONTEXT> to <MODULE> via lead selection
      NODE_MODULE = WD_CONTEXT->GET_CHILD_NODE( NAME = `MODULE` ).
      get element via lead selection
      ELEM_MODULE = NODE_MODULE->GET_ELEMENT(  ).
      get all declared attributes
      ELEM_MODULE->GET_STATIC_ATTRIBUTES(
        IMPORTING
          STATIC_ATTRIBUTES = STRU_MODULE ).
    NODE_MODULE->GET_STATIC_ATTRIBUTES_TABLE(
        IMPORTING
         TABLE  = itab )
    DELETE itab WHERE zmodule_id = STRU_MODULE-zmodule_id.
    CALL METHOD NODE_MODULE->BIND_TABLE
        EXPORTING
          NEW_ITEMS            = itab
       SET_INITIAL_ELEMENTS = ABAP_TRUE
       INDEX                =
    ENDMETHOD.

    Hi  ,
    The onclick event provides you with a standard paramater "CONTEXT_ELEMENT" which has the element from which the event is triggered.
    so you can declare this in the handler(if it is not there) and use it as follows.
    CONTEXT_ELEMENT  TYPE REF TO IF_WD_CONTEXT_ELEMENT  an importing paramater.
    DATA:
    NODE_MODULE TYPE REF TO IF_WD_CONTEXT_NODE,
    ELEM_MODULE TYPE REF TO IF_WD_CONTEXT_ELEMENT,
    STRU_MODULE TYPE IF_V_MODULE=>ELEMENT_MODULE .
    data itab TYPE TABLE OF zac_modules.
    CONTEXT_ELEMENT->GET_STATIC_ATTRIBUTES(
    IMPORTING
    STATIC_ATTRIBUTES = STRU_MODULE ). "Using the context_element paramater to get the static attributes.
    NODE_MODULE->GET_STATIC_ATTRIBUTES_TABLE(
    IMPORTING
    TABLE = itab )   "getting all the data.
    DELETE itab WHERE zmodule_id = STRU_MODULE-zmodule_id. "deleting the particular row from the table and binding it.
    CALL METHOD NODE_MODULE->BIND_TABLE
    EXPORTING
    NEW_ITEMS = itab
    * SET_INITIAL_ELEMENTS = ABAP_TRUE
    * INDEX =
    thanks,
    Aditya.

  • How to delete duplicate records in cube

    Hi,
    can u help me how to delete the duplicate records in my cube
    and tell me some predifined cubes and data sourcess for MM and SD modules

    Hi Anne,
    about "duplicate records" could you be more precise?.
    The must be at least one different Characteristic to distinguish one record from the other (at least Request ID). In order to delete Data from InfoCubes (selectively) use ABAP Report RSDRD_DELETE_FACTS (be carefull it does not request any confirmation as in RSA1 ...).
    About MM and SD Cubes see RSA1 -> Business Content -> InfoProvider by InfoAreas. See also for MetadataRepository about the same InfoProviders.
    About DataSources just execute TCode LBWE in you source sys: there you see all LO-Cockipt Extrators.
    Hope it helps (and if so remember reward points)
    GFV

  • How to delete data-records with BI-planning in BEx?

    Hi folks, masters and gurus,
    we just upgraded some of our functions from BPS to BI-Planning.
    Only one thing I could not resolve up to now:
    In BPS (web based) it was easily possible to delete data-records by choosing a radio-button beside the data-entry-field and click the "delete"-button (a red "-") on the top.
    When I tried to find a delete-function in RSPLAN now I only found one that deletes the data, but not the record itself.
    Does anyone know how to build a function that I can use to delete data-records?
    Thx in advance for your help,
    Thomas

    Oh yes ... it´s not necessary as it is easily possible to supress lines with only 0 in it with
    query-properties / rows/coloumns / supressing Zero / activ ...
    Edited by: Thomas Kejik on Jan 19, 2009 9:46 AM

  • How to delete a record in the target?

    Hi all,
    In my source i'm having three tables which are joined.My source and target is oracle.
    I'm using IKM incremental update oracle.For SCD-1.If i delete a record in any of my source tables i cannot able to delete that particular
    record in the target table.I tried by doing CDC(simple) to all my source tables.But still i cannot able to delete a record in the target table.
    How to resolve this issue? Please help me.
    Thanks in advance

    Open your interface, go to the "flow" tab and then, try to set the option "delete_all" to "Yes". Doing it, all records will be deleted in the target table and only the records that still exists at source will be loaded the next time you run the interface.
    I hope this will help with your issue.
    Regards,
    Daniel Hein

  • How to Delete Multiple Records using selectbox in jsf

    Hi!
    My Senario is I want to delete multiple records using checkbox. After selecting multiple records when i click the delete button the selected
    rows shuld be deleted.if am doing like this but the edit ,delete for each row functionality is not working.
    <h:selectBooleanCheckbox id ="bcb" value="#{item.empno}">
    </h:selectBooleanCheckbox>
    But other functionality is not wokring.
    Can any one plz tell how to select the multiple records and how to send the id to the serverside.
    I want code code for jsp and as well as backingBean how to accaess .
    Any Reply shuld be apreciated

    You may find this article useful as well: http://balusc.blogspot.com/2006/06/using-datatables.html
    Check the chapter "Select multiple rows" for two generic ways to select multiple rows in a datatable.

Maybe you are looking for