How to add the update statement in this procedure?

I have one table usersubscription (userid,newsletterid,deleted)
I got one string from user e.g. ('1,2,3') and userid = 14
I wrote proceduer that will insert this records in to usersubscription table;
userid     newsletterid     deleted
14     1          n
14     2          n
14     3          n
default value of deleted column is 'n'.
my procedure is as follows;
CREATE OR REPLACE PROCEDURE usersubscription_procd1 (vuserid in number, vnewsletterid IN VARCHAR2)
AS
I NUMBER;
J NUMBER;
VAL VARCHAR2(100);
BEGIN
     I := 1;
     J := 1;
     WHILE INSTR(vnewsletterid,',',I) != 0 LOOP
     VAL := SUBSTR(vnewsletterid,I,INSTR(vnewsletterid,',',I)-J);
     I := INSTR(vnewsletterid,',',I)+1;
     J := I;
     INSERT INTO usersubscription (usersubcriptionid,userid,newsletterid)
     VALUES (usersubscription_seq.nextval,vuserid,VAL);
     END LOOP;
     VAL := SUBSTR(vnewsletterid,I,LENGTH(vnewsletterid));
     INSERT INTO usersubscription (usersubcriptionid,userid,newsletterid)
     VALUES (usersubscription_seq.nextval,vuserid,VAL);
END;
Now one requirement is that when new string comes for same userid e.g.('1,4,5') userid = 14
then the deleted column for 1 and 2 newsletterid changes to 'y';
please tell me the solution.
Prathamesh.

Hi,
Before your loop, you can make something else like :
SQL> select * from test;
    USERID NEWSLETTERID D
        14            1 n
        14            2 n
        14            3 n
SQL> update test
  2  set deleted = 'y'
  3  where instr('1,4,5',newsletterid,1) = 0
  4  and userid = 14;
2 ligne(s) mise(s) à jour.
SQL> select * from test;
    USERID NEWSLETTERID D
        14            1 n
        14            2 y
        14            3 y
SQL> HTH,
Nicolas.

Similar Messages

  • How to add the delete statement in this procedure.

    I got a string from user e.g. ‘1,2,3’ and userid =14 from user;
    I wrote a procedure that will insert the record as follows;
    Userid newsletterid
    14     1
    14 2
    14 3
    The procedure is
    CREATE OR REPLACE PROCEDURE usersubscription_procd (vuserid in number, vnewsletterid IN VARCHAR2)
    AS
    I NUMBER;
    J NUMBER;
    VAL VARCHAR2(100);
    BEGIN
         I := 1;
         J := 1;
         WHILE INSTR(vnewsletterid,',',I) != 0 LOOP
         VAL := SUBSTR(vnewsletterid,I,INSTR(vnewsletterid,',',I)-J);
         I := INSTR(vnewsletterid,',',I)+1;
         J := I;
         INSERT INTO usersubscription (usersubcriptionid,userid,newsletterid)
         VALUES (usersubscription_seq.nextval,vuserid,VAL);
         END LOOP;
         VAL := SUBSTR(vnewsletterid,I,LENGTH(vnewsletterid));
         INSERT INTO usersubscription (usersubcriptionid,userid,newsletterid)
         VALUES (usersubscription_seq.nextval,vuserid,VAL);
    END;
    Now one requirement is that
    When next string comes like ‘1,4’ for same user
    Then I want to delete the 2 and 3 and insert the 4 .
    Please tell me solution.

    Hi,
    Try to delete all record from ther current user :
    CREATE OR REPLACE PROCEDURE usersubscription_procd (vuserid in number, vnewsletterid IN VARCHAR2)
    AS
    I NUMBER;
    J NUMBER;
    VAL VARCHAR2(100);
    BEGIN
         begin
              delete usersubscription where userid = vuserid;
         exception when others then null;
         end;
         I := 1;
         J := 1;
         WHILE INSTR(vnewsletterid,',',I) != 0 LOOP
              VAL := SUBSTR(vnewsletterid,I,INSTR(vnewsletterid,',',I)-J);
              I := INSTR(vnewsletterid,',',I)+1;
              J := I;
              INSERT INTO usersubscription (usersubcriptionid,userid,newsletterid)
              VALUES (usersubscription_seq.nextval,vuserid,VAL);
         END LOOP;
         VAL := SUBSTR(vnewsletterid,I,LENGTH(vnewsletterid));
         INSERT INTO usersubscription (usersubcriptionid,userid,newsletterid)
         VALUES (usersubscription_seq.nextval,vuserid,VAL);
    END;
    /Nicolas.

  • How to add the Assignment column on this post outgoing payment in f-53

    Hi all,
    how to add the Assignment column on this post outgoing payment in f-53?
    thanks.
    Joo

    Hi ,
    If you want to see the assignment column in f-53 process open item screen
    1. First in O7V3 check for t.code FBz2 which line layout ( 2 digit code is assigned)
    2. Then in t.code O7z4s check in the line layout and if assignment field is not there then insert the field.
    then check in F-53.
    Hopw it will solve your problem.
    Assign points if useful
    Regards
    Prabhat

  • How to tune the Update statement for 20 million rows

    Hi,
    I want to update 20 million rows of a table. I wrote the PL/SQL code like this:
    DECLARE
    v1
    v2
    cursor C1 is
    select ....
    BEGIN
    Open C1;
    loop
    fetch C1 bulk collect into v1,v2 LIMIT 1000
    exit when C1%NOTFOUND;
    forall i in v1.first..v1.last
    update /*+INDEX(tab indx)*/....
    end loop;
    commit;
    close C1;
    END;
    The above code took 24 mins to update 100k records, so for around 20 million records it will take 4800 mins (80 hrs).
    How can I tune the code further ? Will a simple Update statement, instead of PL/SQL make the update faster ?
    Will adding few more hints help ?
    Thanks for your suggestions.
    Regards,
    Yogini Joshi

    Hello
    You have implemented this update in the slowest possible way. Cursor FOR loops should be absolute last resort. If you post the SQL in your cursor there is a very good chance we can re-code it to be a single update statement with a subquery which will be the fastest possible way to run this. Please remember to use the {noformat}{noformat} tags before and after your code so the formatting is preserved.
    David                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to test the update statement in SQLJ - Im lost and cant figure it out!

    Hi Im wondering on the sytax of this logic.
    //Execute an update on a table
    #sql {update mytable set name = :test where today = sysdate };
    //This is where im lost. how to test if the record is not found
    if (record not found for update){
    #sql {insert mytable set name = :test where today = sysdate };
    I dont want to do a select count(*) and based on the value go to update or insert.
    Does anyone know how to do it?
    Thanks so much

    If Software Update is offering the update then it would be compatible with your model.  Unfortunately, you haven't provided us with any information on your hardware that would enable us to determine if it really is too old.
    If you really wish to disable the update alert then the next time Software Update opens, select the update in the list then select "Ignore update" from SU's Update menu.

  • How to use the updated value in the same update statement

    Hello,
    I just wonder how to use the updated new value of other column in the same udpate statement. I am using Oracle 11.2, and want to update the two columns with one update statement as following:
    create table tb_test (id number(5), tot number(5), mon_tot number(5));
    update tb_test set (tot = 15, mon_tot = tot *15) where id = 1;
    ...I would like to update both tot and mon_tot column, the value of mon_tot shall be determinted by the new value of tot.
    Thanks,
    Edited by: 939569 on 1-Feb-2013 7:00 AM

    Edit: example added
    SQL> create table tb_test
      2  ( id number(5)
      3  , tot number(5)
      4  , mon_tot number generated always as (tot*15) virtual
      5  );
    Table created.
    SQL> insert into tb_test (id, tot) values (1, 5);
    1 row created.
    SQL> select * from tb_test;
            ID        TOT    MON_TOT
             1          5         75
    1 row selected.
    SQL> update tb_test
      2  set    tot = 15
      3  where  id = 1;
    1 row updated.
    SQL> select * from tb_test;
            ID        TOT    MON_TOT
             1         15        225
    1 row selected.

  • After getting an update from 10.6.8 many of my programs were no longer able to open. How can I undo the update or solve this problem another way?

    After getting an update from 10.6.8 many of my programs were no longer able to open. How can I undo the update or solve this problem another way?

    Do you have a bootable clone from prior to the update? If so, roll back with that.
    Are your apps that won't open PPC and do they need Rosetta? Do you need to activate Rosetta?
    Have you considered reinstalling 10.6 from your install disc and then coming forward with the 10.6.8 Combo Updater, then doing software update and not including whatever it was you installed that caused this propblem?
    By the way - what update was it that caused this problem?

  • I have Elements 10 and a Nikon D7100. PSE10  CR 6.7 does not support the 7100 NEF. How can I get the updates to do this?

    I have Elements 10 and a Nikon D7100. PSE10  CR 6.7 does not support the 7100 NEF. How can I get the updates to do this?

    The D7100 requires camera raw 7.4 which is not compatible with Photoshop Elements 10.
    Your two main options are
    1) Buy a newer version of Photoshop Elements
    2) Use the Adobe DNG converter to convert the NEF files to DNG files which can then be used by Photoshop Elements 10.
    DNG  Converter 8.8
    Win – http://www.adobe.com/support/downloads/detail.jsp?ftpID=5888
    Mac – http://www.adobe.com/support/downloads/detail.jsp?ftpID=5887
    Useful Tutorial
    http://www.youtube.com/watch?v=0bqGovpuihw
    Brian

  • Hi, I use two email addresses within one account with gmx.  I created one account with the first email address now. How do I add the second one to this account? Now it looks like this. One account was opened with address A. I receive in this account email

    Hi, I use two email addresses within one account with gmx.
    I created one account with the first email address now. How do I add the second one to this account?
    Now it looks like this.
    One account was opened with address A.
    I receive in this account emails for address A and B.
    But I can only write and answer with address A.

    Hi Rudegar,
    Sorry for my late reply.
    It s not the amount of accounts I'm struggling with.
    When I create now for both email addresses one account, then I receive the same emails two times.
    That is not what I want.
    Because on gmx the two email addresses have the same inbox and outbox.
    E.g. I can login to my gmx account either with email A or B. It doesn't matter.
    Now I want to have the same on my ipad.
    One account with both email addresses.

  • How to add the entries and how to delete the entries from custom Z-table?

    Hi Experts,
    My requirement is I need to add the entries from program to three custom z-tables . Assume as zabc1,zabc2,zabc3.
    Here how to add the entries from program to Z-table.???
    And one more requirement is I want to provide a deletion checkbox in selection screen . Initial it was unchecked. If I am giving tick mark then the entries should be deleted from above custom Z-tables. this all will done in backgroung job?
    Could you please guide me the logic how to crack this???
    Let me know if you need more Info
    Thanks
    Sanju

    Hi Sanjana,
    What you can do is to use the ABAP keyword INSERT or MODIFY to add or modify records to a given database table. Here are the syntax taken from SAP documentation:
    *Insert Statement
    INSERT dbtab
    Syntax
    INSERT { {INTO target VALUES source }
           | {     target FROM   source } }.
    Effect
    The INSERT statement inserts one or more rows specified in source in the database table specified in target. The two variants with INTO and VALUES or without INTO with FROM behave identically, with the exception that you cannot specify any internal tables in source after VALUES.
    System Fields
    The INSERT statement sets the values of the system fields sy-subrc and sy-dbcnt.
    sy-subrc Meaning
    0 At least one row was inserted.
    4 At least one row could not be inserted, because the database table already contains a row with the same primary key or a unique secondary index.
    The INSERT statement sets sy-dbcnt to the number of rows inserted.
    Note
    The inserted rows are finally included in the table in the next database commit. Up until this point, they can still be removed by a database rollback.
    *Modify Statement
    MODIFY dbtab
    Syntax
    MODIFY target FROM source.
    Effect
    The MODIFY statement inserts one or several lines specified in source in the database table specified in target, or overwrites existing lines.
    System fields
    The MODIFY statement sets the values of the sy-subrc and sy-dbcnt system fields.
    sy-subrc Meaning
    0 At least one line is inserted or changed.
    4 At least one line could not be processed since there is already a line with the same unique name secondary index in the database table.
    The MODIFY statement sets sy-dbcnt to the number of processed lines.
    Note
    The changes are transferred finally to the database table with the next database commit. Up to that point, they can be reversed using a database rollback.
    Hope it helps...
    P.S. Please award points if it helps...

  • How to display the updated data from db to user interface in sruts framewor

    A beginner in this area, I have been able to read a record from a
    MySQL database and populate in jsp form . Now, my goal is to
    allow the user to edit the contents of the form and then update the
    record in MySQL and then display the same in jsp. page
    The scenario in detail
    1)the data is fetched from db and displayed in non-editable format
    2)Next button is clicked
    3)Now in the same jsp page I view the same data from db in editable format
    4)The user is allowed to change the information
    5)Now update button is clicked
    6)the records are updated in the db -Finished doing till this step
    7)But the updated info in non - editable format to be displayed in jsp page is left pending.
    Here is my code for jsp,i want know how to write an action for this,tried doing the same in java and I'm successful.but what I need is how to fetch the updated information in the user interface.
    I've made both editable as well as non editable info in the same page with different actions.
    pl help me,I'm a newbie
    <%@ taglib uri="/WEB-INF/struts-bean" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-html" prefix="html" %>
    <%@ taglib uri="/WEB-INF/struts-logic" prefix="logic" %>
    <%@ page language="java" %>
    <%@ page import="java.util.ArrayList,java.util.Iterator" %>
    <%@ page import="com.finocus.common.container.CustomerDetailsTest;" %>
    <html:html>
    <head>
         <title>CUSTOMER DISPLAY</title>
    </head>
    <body>
         <table width="100%" bgcolor="darkkhaki">
         <tr>
              <td><table width="100%" bgcolor="indigo">
                   <tr>
                        <td><font color="white">Display</font></td>
                        <td><font color="white">Update</font></td>
                        <td><font color="white">Verify</font></td>
                        <td><font color="white">Confirm</font></td>
                   </tr>
                   </table>
              </td>
         </tr>
    <%
              //Container for holding data
              ArrayList list = (ArrayList)session.getAttribute("CUSTOMERDETAILS");
              Iterator itr=list.iterator();
              while(itr.hasNext())
              CustomerDetailsTest cust = (CustomerDetailsTest) itr.next();
              System.out.println("testGetCustomerDetails()-successed. retrieved CustomerDetailsTest="+cust.toString());
    %>
    <%
              //Session for checking whether edit or non-edit mode
              String pageMode = (String)session.getAttribute("CUSTOMER_PAGE_MODE");
              session.removeAttribute("CUSTOMER_PAGE_MODE");
              if(null==pageMode)
                   pageMode = "EDIT";
              if(pageMode.equals("EDIT"))
                   //display data in the form
                   System.out.println("Editable mode");
    %>
              <html:form action="/nonedit">
                   <tr>
              <td><table width="100%" bgcolor="darkkhaki">
              <tr>
                        <td><b><bean:message key="label.id"/></b></td>
                        <td><font color="red"><%=cust.getCusId()%></font></td>
         </tr><br>
         <td>
                             <font color="brown" face="Courier New"><b>
                        <bean:message key="label.Company"/></b>
                        </td><br>
                        <tr>
                   <td><bean:message key="label.cname"/></td>
                   <td><font color="blue"><html:text property="name" value="<%=cust.getCname()%>"/></font></td>
                        <td><bean:message key="label.cphone"/></td>
                        <td><font color="blue"><html:text property="phone" value="<%=cust.getCphone()%>"/></font></td>
              </tr><br>
         <tr>
                   <td><bean:message key="label.caddr1"/></td>
                   <td><font color="blue"><html:text property="address1" value="<%=cust.getCaddress1()%>"/></font></td>
                        <td><bean:message key="label.cemail"/></td>
                        <td><font color="blue"><html:text property="email" value="<%=cust.getCemail()%>"/></font></td>
              </tr><br>
         <tr>
                   <td><bean:message key="label.caddr2"/></td>
                   <td><font color="blue"><html:text property="address2" value="<%=cust.getCaddress2()%>"/></font></td>
                        <td><bean:message key="label.cfax"/></td>
                        <td><font color="blue"><html:text property="fax" value="<%=cust.getCfax()%>"/></font></td>
              </tr><br>
         <tr>
                   <td><bean:message key="label.ccity"/></td>
                   <td><font color="blue"><html:text property="city" value="<%=cust.getCcity()%>"/></font></td>
                        <td><bean:message key="label.czip"/></td>
                        <td><font color="blue"><html:text property="zip" value="<%=cust.getZip()%>"/></font></td>
              </tr><br>
         <tr>
                   <td><b><bean:message key="label.cstate"/></b></td>
                   <td><font color="red"><html:text property="state" value="<%=cust.getCstate()%>"/></font></td>
         </tr><br>
         <td>
                             <font color="brown" face="Courier New"><b>
                        <bean:message key="label.Admin"/></b>
                        </td><br>
         <tr>
                   <td><b><bean:message key="label.AAname"/></b></td>
                   <td><font color="red"><html:text property="adminname" value="<%=cust.getAname()%>"/></font></td>
         </tr><br>
         <tr>
                   <td><b><bean:message key="label.AAemail"/></b></td>
                   <td><font color="red"><html:text property="adminemail" value="<%=cust.getAemail()%>"/></font></td>
         </tr><br>
         <tr>
                   <td><b><bean:message key="label.AAphone"/></b></td>
                   <td><font color="red"><html:text property="adminphone" value="<%=cust.getAphone()%>"/></font></td>
         </tr><br>
         <td>
                             <font color="brown" face="Courier New"><b>
                        <bean:message key="label.User"/></b>
                        </td><br>
         <tr>
                   <td><b><bean:message key="label.AUname"/></b></td>
                   <td><font color="red"><html:text property="adminusername" value="<%=cust.getUname()%>"/></font></td>
         </tr><br>
         <tr>
                   <td><b><bean:message key="label.AUemail"/></b></td>
                   <td><font color="red"><html:text property="adminuseremail" value="<%=cust.getUemail()%>"/></font></td>
         </tr><br>
              <tr align="center">
                        <td><html:cancel value="Cancel"/>
                        <html:submit value="Next"/></td>
              </tr>
              </html:form>
    <%               
              }else
                   //display data in the text
                   System.out.println("Non-Editable mode");
    %>
              <html:form action="/edit">
              <tr>
              <td><table width="100%" bgcolor="darkkhaki">
                   <tr>
                        <td><b><bean:message key="label.id"/></b></td>
                        <td><font color="red"><%=cust.getCusId()%></font></td>
                        <td><b><bean:message key="label.status"/></b></td>
                        <td><font color="red"><%=cust.getStatus() %></font></td>
         </tr><br>
         <td>
                             <font color="brown" face="Courier New"><b>
                        <bean:message key="label.Company"/></b>
                        </td><br>
                        <tr>
                   <td><bean:message key="label.cname"/></td>
                   <td><font color="blue"><%=cust.getCname()%></font></td>
                        <td><bean:message key="label.cphone"/></td>
                        <td><font color="blue"><%=cust.getCphone()%></font></td>
              </tr><br>
         <tr>
                   <td><bean:message key="label.caddr1"/></td>
                   <td><font color="blue"><%=cust.getCaddress1()%></font></td>
                        <td><bean:message key="label.cemail"/></td>
                        <td><font color="blue"><%=cust.getCemail()%></font></td>
              </tr><br>
         <tr>
                   <td><bean:message key="label.caddr2"/></td>
                   <td><font color="blue"><%=cust.getCaddress2()%></font></td>
                        <td><bean:message key="label.cfax"/></td>
                        <td><font color="blue"><%=cust.getCfax()%></font></td>
              </tr><br>
         <tr>
                   <td><bean:message key="label.ccity"/></td>
                   <td><font color="blue"><%=cust.getCcity()%></font></td>
                        <td><bean:message key="label.czip"/></td>
                        <td><font color="blue"><%=cust.getZip()%></font></td>
              </tr><br>
         <tr>
                   <td><b><bean:message key="label.cstate"/></b></td>
                   <td><font color="red"><%=cust.getCstate()%></font></td>
         </tr><br>
         <td>
                             <font color="brown" face="Courier New"><b>
                        <bean:message key="label.Admin"/></b>
                        </td><br>
         <tr>
                   <td><b><bean:message key="label.AAname"/></b></td>
                   <td><font color="red"><%=cust.getAname()%></font></td>
         </tr><br>
         <tr>
                   <td><b><bean:message key="label.AAemail"/></b></td>
                   <td><font color="red"><%=cust.getAemail()%></font></td>
         </tr><br>
         <tr>
                   <td><b><bean:message key="label.AAphone"/></b></td>
                   <td><font color="red"><%=cust.getAphone()%></font></td>
         </tr><br>
         <td>
                             <font color="brown" face="Courier New"><b>
                        <bean:message key="label.User"/></b>
                        </td><br>
         <tr>
                   <td><b><bean:message key="label.AUname"/></b></td>
                   <td><font color="red"><%=cust.getUname()%></font></td>
         </tr><br>
         <tr>
                   <td><b><bean:message key="label.AUemail"/></b></td>
                   <td><font color="red"><%=cust.getUemail()%></font></td>
         </tr><br>
         <tr align="center">
                        <td><html:submit value="Update"/></td>
              </tr>
              </html:form>
    <%
    %>
    <%
    %>
                   </table>
              </td>
              </tr>
         </table>
    </body>
    </html:html>

    u r using action classes. so after calling the insert method in Action Class to a dao... the next statement should be retrieve statement. so at the time of updating first it will get updated.. the next statement it will execute is retrieve and then set these details in VO or FORM and show it on JSP
    Message was edited by:
    leo_michael

  • How to get the previous state of my data after issuing coomit method

    How to get the previous state of some date after issuing commit method in entity bean (It should not use any offline storage )

    >
    Is there any way to get the state apart from using
    offline storage ?As I said the caller keeps a copy in memory.
    Naturally if it is no longer in memory then that is a problem.
    >
    and also what do you mean by auditlog?
    You keep track of every change to the database by keeping the old data. There are three ways:
    1. Each table has a version number/delete flag for each record. A record is never updated nor deleted. Instead a new record is created with a new version number and with the new data.
    2. Each table has a duplicate table which has all of the same columns. When the first table is modified the old data is moved to the duplicate table.
    3. A single table is used which has columns for 'table', 'field', 'data' and 'activity' (update, delete). When a change is made in any table then this table is updated. This is generally of limited useability due to the difficulty in recovering the data.
    All of the above can have a user id, timestamp, and/or additional information which is relevant to the data being changed.
    Note that ALL of this is persisted storage.
    I am not sure what this really has to do with "offline storage" unless you are using that term to refer to backed up data which is not readily available.

  • How to add the Social Network share buttons (that work!) to share INDIVIDUAL post from the same page

    How to add the Social Network share buttons like Facebook and Twitter (that work!) to share INDIVIDUAL post on the same web address in Dreamweaver? I have searched on google and youtube tutorials, but most of them are "Blogger" and  "Wordpress" users.. The only Dreamweaver tutorial is the one that share THE WHOLE page (not individual post on a page). There is Facebook Integration on Dreamweaver (29 Dollar download from Adobe) but so far no review about it so  I don't want to spend money for something I don't know.  There is also Sharrre but they say there is a bug. It seems like everyone out there use these buttons but I start to get crazy since it seems easy but it's actually complicated to get the html or js script to paste on! Any help would be very much appreciated. Thanks.

    Cool,
    Here is my test site. I have made at least 3 articles (Fashion, Sport, and Art) with thumbnail images on it.
    http://andiratih.free.fr/
    On each article I add the share buttons from "AddThis".
    However, if I want to ONLY share the "Sport article" on Facebook by clicking share-->Facebook, then the feed is scrambling my images on other articles too and it eventually just share the whole page instead of one particular article.
    It is now fine since I only build 3 articles, but as you see when the page is getting long with at least 20 articles it will not be ok.
    I don't want to make individual page for each article either, since they are just short article each, and I intend to use this page as a welcome page to update the latest activity every half year.
    I have seen many bloggers or pages where even if they have many article on ONE page, they are able to share one particular article to Facebook, and when we click (via Facebook) it will redirect us to exactly that particular article even if the article is on the bottom of the page, and not just bring me to the top of the page only and have to search by myself by scrolling to the bottom of the page to see the article.
    Infact, Bloggers and Wordpress seems to have the tool for that so that we can just click and add. I am not a Blogger or Wordpress users but I saw youtube tutorials on that.
    I have heard about Dreamweaver behavior, and does this will help to achieve what I want (sorry I'm a beginner)? I also heard about meta tags but I don't know how and where to get them to paste to my html source code.
    I have found several sites where the person show how to do this, but when I tried it didn't work, and in fact some other discussions about this are never solved.
    Thanks for your input.

  • How to add the delete button

    Hello Guru's and Experts.
    I am working on a change request , the change request is as follows
    Once a cost simulation is run for a maintenance item and the data transferred to BI, it cannot be deleted from BI, only overwritten with an updated cost simulation. In the instance where the such items are no longer required to be included in the simulation, it must be made possible to delete the simulation costs in BI.
    The current design in my project significantly increases the effort required to identify unwanted cost simulations and greatly increases the potential for incorrect data to be used in Budgeting and forecasting.
    My question is how to add the delete functionality in the report. is it acheavable through the portal or WAD,
    iam new to SAP BI , if possible can anyone kindly suggest me the steps to do this functionality.
    Appreciate your quick response..
    Thanks
    Ravi.

    Hi Guru
    Thanks for your valuable information.
    We got the requirment changed now from the users , the delete button should display in the report, i mean in protal, Now the user wants to delete with the selection criteria, for example, once the user hits the row in the report, that means if he selects the Main work center, and selects the delete button , he wants all the data related to that main work center to be deleted.  and another senario is what ever row the user selects  the characteristics in the row, for example, if the user select  for any row, i mean it can be any cost center or fiscal year, maintaiance item, cost elements, ..etc.  
    Once the user  selects the row and hit the delete button,  and he wants to hit the save save button in the report to make sure it deleted, the other way around , if the dont want to hit save, then he wants the data to be in the report.
    In the above  scenario's  can  you please suggest me with the steps how can we acheive it.
    Please reply back if you need any other info., Apprieciate your quick response. its very urgent requirment which we have to start...
    sorry to bother u..
    Thanks
    Ravi.

  • SSRS 2008 Work order report , in sub total donot want to add the 0 level in ( how to add the expression )

    working in Work order report, this report has different level , for example
    0 level transaction
    1 level transaction
    in subtotal don't want to add 0 level transaction,
    when I did the sub total it added all the level , so in sub total amount double up because of that
    how to add the expression so I can the level 0 take out from sub total , so it does not include in sub total
    can some one please help me with this
    thanks in advance

    Hi Simon_ Hou
    I tried the expr the way you suggested , it did not work  getting  error message,  the exp I added is below
    this the expression I added on sub total where is highlighted in Yellow,  under Cost amount column,
    I really appreciate the help
    =Sum(IIF(Fields!COLLECTREFLEVEL.Value=
    "0",0,Fields!CostAMOUNT.Value),"DataSet1")
    please see below my QUERY, can you please help and let me know what I did wrong in my exp
    SELECT        PRODTABLE.PRODID, PRODCALCTRANS.COSTGROUPID, PRODTABLE.QTYCALC, PRODTABLE.PRODSTATUS, PRODCALCTRANS.COSTAMOUNT,
                             PRODCALCTRANS.COSTMARKUP, PRODCALCTRANS.REALCOSTAMOUNT, PRODCALCTRANS.CALCTYPE, PRODTABLE.DATAAREAID, PRODCALCTRANS.KEY3,
                             PRODCALCTRANS.CONSUMPVARIABLE, PRODCALCTRANS.REALCONSUMP, PRODTABLE.ITEMID, PRODTABLE.SCHEDDATE, PRODTABLE.FINISHEDDATE,
                             PRODCALCTRANS.KEY1, PRODCALCTRANS.TRANSDATE, PRODCALCTRANS.QTY, PRODCALCTRANS.KEY2, PRODCALCTRANS.COLLECTREFLEVEL,
                             PRODCALCTRANS.LINENUM
    FROM            PRODTABLE INNER JOIN
                             PRODCALCTRANS ON PRODTABLE.PRODID = PRODCALCTRANS.PRODID AND PRODTABLE.DATAAREAID = PRODCALCTRANS.DATAAREAID
    WHERE        (PRODTABLE.PRODSTATUS = 7) AND (PRODTABLE.DATAAREAID = N'AR1') AND (PRODTABLE.ITEMID = @itemid) AND
                             (PRODTABLE.FINISHEDDATE >= @Paramfromdate) AND (PRODTABLE.FINISHEDDATE <= @Paramtodate)

Maybe you are looking for

  • Can I connect an external hard drive to Time Capsule for off site back up?

    I like having a copy of everything at another site in case of a house fire. Can I connect an external hard drive to Time Capsule to make a duplicate of what is on Time Capsule? I would store that hard drive at work and bring it home monthly or someth

  • My charger for my MacBook Pro is not working

    The charger cord for my MacBook Pro is not working. This happened before but I do not remember what the tech guy had me do. It was a simple fix....

  • Logisim not loading correctly in Xmonad

    I am having a bit of trouble trying to get logisim running in Xmonad. It's a jar file, so I open it with java -jar logisim. The loading screen shows up correctly, and the window is made, but it is completely filled in with white. If I randomly click

  • JAVASCRIPT AND JSF PROBLEM REFRESHING PAGE PROBLEM

    Hello everyone, I am currently using visual JSF and javascript to to disable a fileupload component when a radio button is clicked. I don't have any problems getting it to work if I need to disable a button, a textfield or other visual JSF components

  • Software for controlling internet access with Airport Exreme

    I'd like to find software that let's me control what pc's in the house have internet access at certain times. My iMac is my main computer, and I use Airport Extreme as my router.