New help writing a function

I am refreshing this an open a new case to see if I get more help( I do apologize, but I do need to move this to production). I am providing scripts:
The Problem: I want to write a procedure to update a column in a table (rprawrt_paid_amt) the amount can not be greater than what is in the RPRAWRt_ACCEPT_AMT, the process is run every payroll period, the payroll table is PHREART (provide a script)
The amount can not exceed the RPRAWRD_ACCEPT_AMT, The procedure is updating the RPRAWRT_PAID_AMT, it is going to be update every pay period, there are going to be cases when SUM(NVL(A.PHREARN_AMT,0)) is going to be greater than the RPRAWRD_ACCEPT_AMT, BUT the update CAN'T exceed the amount in RPRAWRT_ACCEPT_AMT (this value never change, it is set up at the begining of the payroll period(fiscal year).
Please, see more explanation at the end..
SELECT * FROM V$VERSION
results
racle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
PL/SQL Release 10.2.0.3.0 - Production
CORE     10.2.0.3.0     Production
Payroll table, I am just using the columns I need there are more columns in the table(s)
CREATE TABLE PHREART
PHREART_YEAR VARCHAR2(4),
PHREART_PAYNO NUMBER(3),
PHREART_PIDM NUMBER(8),
PHREART_AMT NUMBER(12,2),
PHREART_ACTIVITY_DATE DATE
CREATE TABLE RPRAWRT
RPRAWRT_AIDY_CODE VARCHAR2(4),
RPRAWRT_PIDM NUMBER(8),
RPRAWRT_FUND_CODE VARCHAR2(6),
RPRAWRT_ACCEPT_AMT NUMBER(11,2),
RPRAWRT_PAID_AMT NUMBER(11,2)
I am only inserting one record but you can manipulate the data or insert more records(explain later)
INSERT INTO RPRAWRT
RPRAWRT_AIDY_CODE ,
RPRAWRT_PIDM ,
RPRAWRT_FUND_CODE ,
RPRAWRT_ACCEPT_AMT ,
RPRAWRT_PAID_AMT
SELECT
0910,
2285428,
'CFWS',
60,
45
FROM DUAL
I am inserting to payrolls PHREART_PAYNO  = 20 for the same PHREART_PIDM (PK)
INSERT INTO PHREART
PHREART_YEAR ,
PHREART_PAYNO ,
PHREART_PIDM ,
PHREART_AMT ,
PHREART_ACTIVITY_DATE
SELECT
2009,
20,
2285428,
20,
TO_DATE('9/28/2009','MM/DD/RRRR')
FROM DUAL
I am inserting to payrolls PHREART_PAYNO  = 21
INSERT INTO PHREART
PHREART_YEAR ,
PHREART_PAYNO ,
PHREART_PIDM ,
PHREART_AMT ,
PHREART_ACTIVITY_DATE
SELECT
2009,
21,
2285428,
25,
TO_DATE('10/28/2009','MM/DD/RRRR')
FROM DUAL
Here is the query that I want to use in my cursor, I do want to do this in a pl\sql function
query 1
SELECT rprawrt_aidy_code, rprawrt_pidm, rprawrt_fund_code,
NVL (rprawrt_accept_amt, 0),
NVL (rprawrt_paid_amt, 0) paid_amt,
NVL (rprawrt_paid_amt, 0) pay_amt_sf,
SUM (NVL (a.phreart_amt, 0))
FROM phreart a, rprawrt b
WHERE
rprawrt_pidm = a.phreart_pidm
AND rprawrt_fund_code = 'CFWS'
AND rprawrt_pidm = 2285428
AND rprawrt_aidy_code = 0910
AND a.phreart_year = 2009
AND (rprawrt_accept_amt IS NOT NULL AND rprawrt_accept_amt > 0
GROUP BY rprawrt_pidm,
rprawrt_aidy_code,
rprawrt_fund_code,
rprawrt_accept_amt,
rprawrt_paid_amt,
rprawrt_accept_amt;
I am giving this example for just one pidm the
AND rprawrt_pidm = 2285428
AND rprawrt_aidy_code = 0910
AND a.phreart_year = 2009
are parameters passing to the function p_pidm, p_aidy_code, p_year
Okay this is how my logic needs to work, if I run the query 1 I got this results
RPRAWRT_AIDY_CODE = 0910
RPRAWRT_PIDM = 2285428
RPRAWRT_FUND_CODE = 'CWS'
NVL(RPRAWRT_ACCEPT_AMT,0) = 60
PAID_AMT = 45
PAY_AMT_SF = 45
SUM(NVL(A.PHREART_AMT,0)) = 45
{code)
ok this is the result for the pay period 20 and 21, let's say that for the period 22 the sum amout is 100.
so, if we run the query 1 (that I am going to use in the cursor, I got) SUM(NVL(A.PHREART_AMT,0)) = 100
BUT
the RPRAWRT_ACCEPT_AMT is 60, so I can not update the accept amount for more than 60 that is the limit, this amount never change, it is set up in the begining of the period, the person said I accept 60, but lots of times they do made more than the accept amount (over time), we need to report to the government what they said in the begining in this case, 60
so for the run of the PHREART_PAYNO 22, I should update this record on RPRAWRT_PAID_AMT = 60, so I need to substract the 15 dollars that are needed to get to 60..right 20 + 25 + 15 (forget about the rest, they will get pay, but my report don't need the rest the 85).
Now when the next pay period comes this records should not be update again, it reaches the top (60) the RPRAWRT_ACCEPT_AMT is now 60... ]
here is the insert
INSERT INTO PHREART
PHREART_YEAR   ,
PHREART_PAYNO  ,
PHREART_PIDM  ,
PHREART_AMT   , 
PHREART_ACTIVITY_DATE  
SELECT
2009,
22,
2285428,
55,
TO_DATE('10/28/2009','MM/DD/RRRR')
FROM DUAL
The person made 55 dollars on the PHREART_PAYNO 22, so now we have
PHREART_PAYNO   20  20 dollars
PHREART_PAYNO    21  25 dollars
PHREART_PAYNO    22  55 dollars
I would like to do this in a pl\sql function
something like this
Fetch the results from the cursor in variables the use if statements to do the updates, what I got it works but sometimes does not...
rprawrd the equilant of prawrt, I just created the T tables with the columns I need.
BEGIN
      IF update_rprawrd_cur%ISOPEN
      THEN
         CLOSE update_rprawrd_cur;
      END IF;
      OPEN update_rprawrd_cur;
      LOOP
         FETCH update_rprawrd_cur
          INTO v_aidy_code, v_pidm, v_fund_code, v_accept_amt, v_paid_amt,
               v_need_to_upd, v_pay_amt_sf,v_phrearn_amt;
         ---amount to update
         --v_this_upd := NVL (v_paid_amt, 0) + NVL (v_need_to_upd, 0);
         --- v_this_upd := NVL (v_phrearn_amt, 0) - NVL (v_paid_amt, 0) + NVL(v_pay_amt_sf,0);
         EXIT WHEN update_rprawrd_cur%NOTFOUND;
         IF
             v_accept_amt > v_phrearn_amt
         THEN
            LOCK TABLE faismgr.rprawrd IN SHARE UPDATE MODE;
          UPDATE faismgr.rprawrd
                    SET rprawrd_activity_date = SYSDATE,
                   rprawrd_paid_amt = v_phrearn_amt,
                   rprawrd_paid_date = SYSDATE,
                   rprawrd_data_origin = 'rz_upd_pkg',
                   rprawrd_user_id = p_user
             WHERE rprawrd_pidm = v_pidm
               AND rprawrd_fund_code = 'CFWS'
               AND rprawrd_aidy_code = v_aidy_code;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Thank you, I certainly will look at your recommendations, and I agree with not locking the table, that is something I learned from a piece of code and I saw but I always have question about it, I believe Oracle automaticly look the table when is doing an update, I will never use again.
I don't have any expereience using bulk collector, I will look at your documenntation and I will try to learn it, but It will be helpful if someone can help with the following:
If you run the query 1 after you do the inserts(previous email) you will get
RPRAWRT_AIDY_CODE = 0910
RPRAWRT_PIDM = 2285428
RPRAWRT_FUND_CODE = 'CWS'
NVL(RPRAWRT_ACCEPT_AMT,0) = 60
PAID_AMT = 45
PAY_AMT_SF = 45
SUM(NVL(A.PHREART_AMT,0)) = 45
The RPRAWRT_ACCEPT_AMT is always 60, so I can not update the accept amount for more than 60 that is the limit, this amount never change, it is set up in the begining of the period, the person said I accept 60, but lots of times they do made more than the accept amount (over time), we need to report to the government what they said in the begining in this case, 60
so for the run of the PHREART_PAYNO 22, I should update this record on RPRAWRT_PAID_AMT = 60, so I need to substract the 15 dollars that are needed to get to 60..right 20 + 25 + 15 (forget about the rest, they will get pay, but my report don't need the rest the 85).
Now when the next pay period comes this records should not be update again, it reaches the top (60) the RPRAWRT_ACCEPT_AMT is now 60... ]
here is the insert
INSERT INTO PHREART
PHREART_YEAR ,
PHREART_PAYNO ,
PHREART_PIDM ,
PHREART_AMT ,
PHREART_ACTIVITY_DATE
SELECT
2009,
22,
2285428,
55,
TO_DATE('10/28/2009','MM/DD/RRRR')
FROM DUAL
The person made 55 dollars on the PHREART_PAYNO 22, so now we have
PHREART_PAYNO 20 20 dollars
PHREART_PAYNO 21 25 dollars
PHREART_PAYNO 22 55 dollars
Then for period 23 if the person make some money the table SHOULD not be update because it reaches the limit 60
Thank you
Edited by: peace4all on Feb 20, 2010 6:31 AM

Similar Messages

  • Help needed in writing a function.

    I am using Oracle 11g and SQL plus. I am a complete newbie, so I need some help here in writing a function. I guess my question is more about writing the trigonometric functions within the function.
    latA, longA latB, longB // these are the four input parameters,
    theta = longA - longB
    distX = sin( latA * PI / 180) * sin ( latB * PI /180) + cos ( latA * PI/180) * cos ( latB * PI/180) * cos ( theta * PI / 180)
    distY = acos(distX) // this is arc cosine
    distZ = distY * 180 / PI // PI refers to the mathematical PI
    distP = distZ * 60 * 1.1515; // this value should be returned. Of course the intermediate variable names don't matter.
    Please help. Thanks.

    CREATE OR REPLACE FUNCTION fucntion_name(latA IN NUMBER, longA IN NUMBER, latB IN NUMBER, longB IN NUMBER) RETURN NUMBER
    IS
    pi      CONSTANT NUMBER:=3.14159;
    theta NUMBER;
    distX  NUMBER;
    distY  NUMBER;
    distZ  NUMBER;
    distP  NUMBER;
    BEGIN
    theta :=longA - longB;
    distX :=sin( latA * PI /180) * sin ( latB * PI /180) + cos ( latA * PI/180) * cos ( latB * PI/180) * cos ( theta * PI / 180);
    distY :=acos(distX); --this is arc cosine
    distZ :=distY * 180/PI;  --PI refers to the mathematical PI
    distP :=distZ * 60 * 1.1515; --this value should be returned. Of course the intermediate variable names don't matter.
    RETURN distP;
    END;Edited by: Ora on May 3, 2011 11:46 PM

  • To upload a data into SAP Table with the help of RFC function in BODS

    Hi,
    Please provide me step-by-step solution to upload data into any SAP table with the help of RFC function in Data Services.
    I have created RFC function that upload data into SAP table. RFC Function contains one table that has same structure as my database table.
    In the data services how can i filled the table of RFC function, i am using this function in query transform of data services but it gives me error.
    I am also follow link http://wiki.sdn.sap.com/wiki/display/BOBJ/BusinessObjectsDataServicesTipsand+Tricks
    but it did not help me.
    Thanks,
    Abhishek

    Hi Abhishek,
    Did you import the function module in the SAP datastore first? When you open the SAP datastore, the function should be listed in the 'functions' section. If not, import it. Make sure your function is remote executable.
    Once the function is there, you can use it in a transformation. In 'Schema Out' right-click on 'Query' (top level) and choose 'New Function Call'. You can then select a datastore and a function in the datastore. The wizard will show you which output parameters are available. I believe you have to add at least one and can select as many as you like.
    After confirming your selection the function and the output parameters appear in Schema Out. You can then right-click on the function and choose 'Modify function call'. A popup will appear where you can specify the input parameters.
    I hope this helps.
    Jan.

  • Need help writing host program using LabView.

    Need help writing host program using LabView.
    Hello,
    I'm designing a HID device, and I want to write a host program using National Instrument's LabView. NI doesn't have any software support for USB, so I'm trying to write a few C dll files and link them to Call Library Functions. NI has some documentation on how to do this, but it's not exactly easy reading.
    I've written a few C console programs (running Win 2K) using the PC host software example for a HID device from John Hyde's book "USB by design", and they run ok. From Hyde's example program, I've written a few functions that use a few API functions each. This makes the main program more streamlined. The functions are; GetHIDPath, OpenHID, GetHIDInfo, Writ
    eHID, ReadHIC, and CloseHID. As I mentioned, my main program runs well with these functions.
    My strategy is to make dll files from these functions and load them into LabView Call Library Functions. However, I'm having a number of subtle problems in trying to do this. The big problem I'm having now are build errors when I try to build to a dll.
    I'm writing this post for a few reasons. First, I'm wondering if there are any LabView programmers who have already written USB HID host programs, and if they could give me some advice. Or, I would be grateful if a LabView or Visual C programmer could help me work out the programming problems that I'm having with my current program. If I get this LabView program working I would be happy to share it. I'm also wondering if there might already be any USB IHD LabView that I could download.
    Any help would be appreciated.
    Regards, George
    George Dorian
    Sutter Instruments
    51 Digital DR.
    Novato, CA 94949
    USA
    [email protected]
    m
    (415) 883-0128
    FAX (415) 883-0572

    George may not answer you.  He hasn't been online here for almost eight years.
    Jim
    You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice

  • To include a new link in the function area?

    Hi all,
    I need to include a new link in the function area of the masthead.  Could any of you please explain me how to do this?
    Also after clicking on this new link on the fucntion area of the masthead, the iview needs to be displayed in the innerpage or the content area of the portal...
    thank you
    regards
    Luke

    Hi Luke
    Hi
    You can modify the par file <b>com.sap.portal.navigation.masthead</b> to achieve this.
    Copy the
    com.sap.portal.navigation.masthead.par.bak file from
    <local_drive>usrsap<instance>JC00j2eecluster server0appssap.comirjservlet_jspirj
    ootWEB-INF deploymentpcd to a temporary folder.
    Rename the par file to some other namespace and import the new par file into your NWDS.
    you have 3 main files in the masthead namely HeaderiView.jsp, LogInRedirect.jsp, LogOffConfirmMsg.jsp.
    change the corresponding jsp file to make the changes as per your requirements.Upload and deploy the par file to the Enterprise Portal.
    Also go through these links.
    Customizing masthead in theme editor
    Removing Masthead Function Area
    Adding a background picture to masthead
    hope this helps.
    Regards
    Yoga

  • PLEASE help..class function not found..

    I am writing a simple email validation and I get a TON of errors.
    1) is Class function not found. on - function validateEmail();
    2) and 11 Undefined variable or class name: document .
    The code is listed below -
    <html>
    <head>
    <meta http-equiv="Content-Language" content="en-us">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <title>New Page 1</title>
    <%
    function validateEmail();
    if (document.forms[0].EMAIL_ADDRESS.value.length != 0)
    if ( (document.forms[0].EMAIL_ADDRESS.value.indexOf("@") == -1) ||
    (document.forms[0].EMAIL_ADDRESS.value.charAt(0) == ".") ||
    (document.forms[0].EMAIL_ADDRESS.value.charAt(0) == "@") ||
    (document.forms[0].EMAIL_ADDRESS.value.length < 6) ||
    (document.forms[0].EMAIL_ADDRESS.value.indexOf(".") == -1) ||
    (document.forms[0].EMAIL_ADDRESS.charAt(document.forms[0].EMAIL_ADDRESS.value.indexOf("@")+1) == ".") ||
    (document.forms[0].EMAIL_ADDRESS.value.charAt(document.forms[0].EMAIL_ADDRESS.value.indexOf("@")-1) == ".") ||
    (document.forms[0].EMAIL_ADDRESS.value.charAt(0) == ' ') )
    alert ("Please enter valid email address");
    document.forms[0].EMAIL_ADDRESS.focus();
    document.forms[0].EMAIL_ADDRESS.select();
    return false;
    else
    return true;
    %>
    </head>
    -- lots of input fields with the last being -
    <input type="text" name=EMAIL_ADDRESS onBlur="validateEmail();"></td>
    ????

    When I remove tags <% %> all of the function ends up in html and thus on my page.
    <html>
    <head>
    <meta http-equiv="Content-Language" content="en-us">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <title>New Page 1</title>
    <%
    function validateEmail();
    if (document.forms[0].EMAIL_ADDRESS.value.length != 0)
    if ( (document.forms[0].EMAIL_ADDRESS.value.indexOf("@") == -1) ||
    (document.forms[0].EMAIL_ADDRESS.value.charAt(0) == ".") ||
    (document.forms[0].EMAIL_ADDRESS.value.charAt(0) == "@") ||
    (document.forms[0].EMAIL_ADDRESS.value.length < 6) ||
    (document.forms[0].EMAIL_ADDRESS.value.indexOf(".") == -1) ||
    (document.forms[0].EMAIL_ADDRESS.charAt(document.forms[0].EMAIL_ADDRESS.value.indexOf("@")+1) == ".") ||
    (document.forms[0].EMAIL_ADDRESS.value.charAt(document.forms[0].EMAIL_ADDRESS.value.indexOf("@")-1) == ".") ||
    (document.forms[0].EMAIL_ADDRESS.value.charAt(0) == ' ') )
    alert ("Please enter valid email address");
    document.forms[0].EMAIL_ADDRESS.focus();
    document.forms[0].EMAIL_ADDRESS.select();
    return false;
    else
    return true;
    %>
    </head>
    <body bgcolor="powderblue">
    <Form Name="My Form" Action=userInfoInsert.jsp Method=Post>
    <table border="0" width="100%">
    <tr>
    <td width="100%">
    <table border="0" width="100%">
    <tr>
    <td width="41%">First Name     <input type="text" name=FIRST_NAME ></td>
    <td width="59%">Last Name
    <input type="text" name=LAST_NAME ></td>
    </tr>
    </table>
    </td>
    </tr>
    <tr>
    <td width="100%">Address         
    <input type="text" name=Address ></td>
    </tr>
    <tr>
    <td width="100%">Address         
    <input type="text" name=Address ></td>
    </tr>
    <tr>
    <td width="100%">
    <table border="0" width="100%">
    <tr>
    <td width="32%">City            
       <input type="text" name=CITY size=10></td>
    <td width="18%">State
    <input type="text" name=STATE size=5></td>
    <td width="50%">Zip Code
    <input type="text" name=ZIP_CODE size=10 ></td>
    </tr>
    </table>
    </td>
    </tr>
    <tr>
    <td width="100%">Phone #         
    <input type="text" name=PHONE size="15" ></td>
    </tr>
    <tr>
    <td width="100%">SSN              
    <input type="text" name=SSN size="17" ></td>
    </tr>
    <tr>
    <td width="100%">
    <table border="0" width="100%">
    <tr>
    <td width="41%">Hint Question <input type="text" name=FIRST_NAME ></td>
    <td width="59%">Hint Answer <input type="text" name=LAST_NAME ></td>
    </tr>
    </table>
    </tr>
    <tr>
    <td width="100%">User Name     <input type="text" name=USER_NAME ></td>
    </tr>
    <tr>
    <td width="100%">Password        <input type="text" name=PASSWORD ></td>
    </tr>
    <tr>
    <td width="100%">Re-Password  <input type="text" name=RE_PASSWORD ></td>
    </tr>
    <tr>
    <td width="100%">Email Address
    <input type="text" name=EMAIL_ADDRESS onBlur="validateEmail();"></td>
    </tr>
    </table>
    <INPUT type=Submit Value=Submit>
    </form>
    </body>
    </html>

  • Need help writing Java Code

    Hi everyone, I don't know if I am in the right forum, but I am new in writing Java coding and I am confuse on what to do and how to write the code.
    I have this question and I just dont know what to do:
    How can I write a java code in the following question?
    The question:
    40 hours normal salary
    After the 40 horas, you will pay an addition 1.5 hours
    Display the total salary.
    how to I write a code for this? Thank you in advance. I know this may be very simple to you but its very hard to me. Thanks again... :)

    hi i think this is what your looking for you didnt really make it to clear but here it is anyway hope it helps
    class Hours
    public static void main (String [] args)
    //declare variables
    double hours;
    double overtime;
    double totalhours;
    System.out.println ("Enter hours worked");
    hours = Console.readDouble ();
    overtime = 1.5;
    if (hours > 40)
    totalhours = overtime + hours;
    System.out.println("You are entitled to an additional 1.5 hours");
    System.out.println("Your total hours are" + totalhours);
    else
    System.out.println ("Total hours worked are " + hours);
    }//end main
    }// End hours

  • An install request for a new helper app appeared, I entered my system password to download the app.  Since then safari will not open.  It just comes up with a safari quit unexpectedly report.  I have tried logging on as a Guest but it does the same.

    I have a MacBook Pro with OS X Yosemit.  MY safari will not open, it only comes up with a safari quit unexpectedly report.  A new helper app appeared requesting my system password to download the helper.  Stupidly I input the password, when I log off I can see the download icon for a split second still running asking to abort or continue.  How do I sort this?
    cheers

    Genieo Adware is installed.  Removing it will help.
    If you have another browser installed, use it.
    If not, launch App store and get another  browser for temporary use.
    Remove it afterwards.
    1. Use  free  AdwareMedic by clicking “Download ” from here
        http://www.adwaremedic.com/index.php
        Install , open,  and run it by clicking “Scan for Adware” button   to remove adware.
        Once done, quit AdwareMedic by clicking AdwareMedic in the menu bar and selecting
        “Quit AdwareMedic”.
                   or
        Remove the adware  manually  by following the “HowTo” from Apple.
        http://support.apple.com/en-us/HT203987
    2. Safari > Preferences > Extensions
         Turn those off and relaunch Safari to test .
         Turn those on one by one and test.
    3. Safari > Preferences >  Search > Search Engine :
        Select your preferred   search engine.
    4. Safari > Preferences > General > Homepage:
         Set your Homepage.

  • Help with stored function

    Hi...I was wondering if I could get help with this function. How do i write a function to return hours between a begin date and an end date for an employee. Thanks so much

    EdStevens wrote:
    AlexeyDev wrote:
    sb92075 wrote:
    select (date2-date1)*24 from dual;not as above but as below
    select (date2-date1)/24 from dual;date2-date1 is amount of days. Divide it by 24 and what? if you multiply it on 24 you will have a chance to know how many hours between these two dates. :-)Don't forget that a DATE type also includes a time component.I suppose it doesn't matter if you did a difference between two dates. The result is always number of days.

  • How to call a Search help in a function module?

    Hi Experts,
    I am a novice to ABAP, I am working on search helps. My requirement is to call a search help in a function module.
    Can anyone  please throw some light on this.
    Any inputs will be helpful.
    Thanks,
    Amita

    yes you can do that..
    in side the source code ..
    write the select statement according to requirement and pass the internal table to below function moduel and return field to yor help field..
    call the below fm inside the function module..
    'POPUP_WITH_TABLE_DISPLAY' or 'REUSE_ALV_POPUP_TO_SELECT'
    see the sample code...
    FUNCTION Z_MFG_PLANTS_F4 .
    "*"Local Interface:
    "  IMPORTING
    "     REFERENCE(W_WERKS) TYPE WERKS OPTIONAL
    "  IMPORTING
    "      REFERENCE(W_MATNR)    TYPE MANTR OPTIONAL
    Alv popup display
    DATA : gc_selfield     TYPE slis_selfield,
           gt_fieldcat_drd TYPE slis_t_fieldcat_alv WITH HEADER LINE.
    p_werks = W_WERKS.
    data : begin of t_marc occurs 0,
                werks type werks,
                matnr type matnr,
            end of t_marc
    select matnr werks from marc into table t_marc where werks = p_werks.
      IF t_disp[] IS NOT INITIAL.
      gt_fieldcat_drd-seltext_m = 'Material'.
      gt_fieldcat_drd-fieldname = 'MATNR'.
      APPEND gt_fieldcat_drd.
      CLEAR : gt_fieldcat_drd.
      gt_fieldcat_drd-seltext_m = 'WERKS'.
      gt_fieldcat_drd-fieldname = ''WERKS'.
      APPEND gt_fieldcat_drd.
      CLEAR : gt_fieldcat_drd.
    Allow the user to select the required plant
      CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
        EXPORTING
          i_title               = 'Material Selection for Plant'
          i_selection           = 'X'
          i_screen_start_column = 5
          i_screen_start_line   = 5
          i_screen_end_column   = 70
          i_screen_end_line     = 20
          i_tabname             = 'T_MARC'
          it_fieldcat           = gt_fieldcat_drd[]
        IMPORTING
          es_selfield           = gc_selfield
        TABLES
          t_outtab              = t_MARC
        EXCEPTIONS
          program_error         = 1
          OTHERS                = 2.
      IF sy-subrc  0.
      ENDIF.
      READ TABLE t_MARC INDEX gc_selfield-tabindex.
      IF sy-subrc = 0.
            w_matnr = t_matnr-matnr.
      ENDIF.
    ENDIF.
    ENDFUNCTION.
    rgrds,
    Shweta

  • How to optimize this sql by writing MINUS function.

    Hi all,
    how to optimize the sql by writing MINUS function.
    these are my tables
    1. CREATE TABLE POSTPAID
    RECORD VARCHAR2(2000 BYTE),
    FLAG NUMBER
    Record format:
    Mobile no in 1:10 of that length
    2. CREATE TABLE SUBSCRIBER
    PHONE_NO VARCHAR2(10 BYTE)
    My requirement is following sql need write using ‘minus’ as this one is very slow
    select record record from POSTPAID where substr(record,9,10) NOT in (select PHONE_NO from SUBSCRIBER)
    Thanks

    Why are you very particular about using "MINUS". You can optimize the sql by using "NOT EXISTS" instead of "NOT IN" as below:
    SELECT RECORD FROM POSTPAID A WHERE NOT EXISTS (SELECT 1 FROM SUBSCRIBER B WHERE SUBSTR(A.RECORD,9,10) = B.PHONE_NO)

  • Error when I open the new help in FCP7

    I get a error when I open the new help in FCP7:
    The Help Library requires JavaScript.
    If JavaScript is not enabled, you will not
    be able to view all the content.

    I have checked that Javascript was enabled in Safari (and it is).
    I can read the documentation in Safari online using this link: http://documentation.apple.com/en/finalcutpro/usermanual/
    I have now tried all the new/updated programs in the FCS3 suite they all have the same problem:
    The Help Library requires JavaScript.
    If JavaScript is not enabled, you will not
    be able to view all the content.
    Mikael

  • Where did webapp help go? there is no documentation to do with web apps in the new help pages???

    hi, when i login as a partner, when i click on the help and support, the new help pages have nothing referring to web apps.... even when you search,  i can find some old knowledge base pages on adobe, but why is web app help pages missing from the new help pages?
    what gives?
    there is topics on everything but web apps...

    Where would you get that idea?
    Web app's are not being dropped.
    The support change over has just been done badly thats all. Pushing to get this sorted myself so stay tuned.
    Web apps are not only staying but down the line will have a full revamp so you can do things like build your own custom blog with them if you wanted to. After that the ability to compile them and sell them on and a BC market place are all things that have been mentioned.
    Rosey futurue for web apps!

  • Need help writing a query for following scenario

    Hi all, I need some help writing a query for the following case:
    One Table : My_Table
    Row Count: App 5000
    Columns of Interest: AA and BB
    Scenario: AA contains some names of which BB contains the corresponding ID. Some
    names are appearing more than once with different IDs. For example,
    AA BB
    Dummy 10
    Me 20
    Me 30
    Me 40
    You 70
    Me 50
    Output needed: I need to write a query that will display only all the repeating names with their corresponding IDs excluding all other records.
    I would appreciate any input. Thanks

    Is it possible to have a records with the same values for AA and BB? Are you interested in these rows or do you only care about rows with the same value of AA and different BB?
    With a slight modification of a previous posting you can only select those rows that have distinct values of BB for the same value of AA
    WITH t AS (
    SELECT 'me' aa, 10 bb FROM dual
    UNION ALL
    SELECT 'me' aa, 20 bb FROM dual
    UNION ALL
    SELECT 'you' aa, 30 bb FROM dual
    UNION ALL
    SELECT 'you' aa, 30 bb FROM dual
    SELECT DISTINCT aa, bb
      FROM (SELECT aa, bb, COUNT(DISTINCT bb) OVER(PARTITION BY aa) cnt FROM t)
    WHERE cnt > 1;

  • Help writing a workflow rule

    Hello Experts!!!
    I need help writing a workflow rule condition to trigger the workflow. What I am aiming for is an email to be sent out when an opportunity is marked Closed/Won. But it can only be of a certain opportunity type (we use three options) and opportunity sub-type (we use two options) (these are custom fields we use)
    Below are the fields that need to be used:
    [<SalesStage>] = Closed/Won
    [<OpportunityType>] = Acute
    [<plOpportunity_SubType_ITAG>] = Tech
    Thanks Again!!

    Hi
    Try:
    [<SalesStage>] = Closed/Won AND [<OpportunityType>] = Acute AND [<plOpportunity_SubType_ITAG>] ='Tech'
    Note that in case of picklists it is recomended to use the lookup value and not static text like 'Tech', but both will work.
    Good luck
    Guy

Maybe you are looking for

  • Aka-aki not connecting (N97)

    Hi, I can not get this application to connect to the server. It used to work, but now I get this error. This is since my vacation abroad, where I generally answered no to all requests for data connections on my mobile. "error while logging in. 0x44 -

  • RFC function to return number of records in a table

    Hello, I am looking for a RFC function to return just the number of records in a SAP table. I don't want to use RFC_READ_TABLE since it takes too long when I query a big table. Any advices?

  • How2specify Amount in Doc Currency and Amnt in LOCL Curr4same item in FBB1?

    Hi Experts, I need to specify some amount (say, 100) in doc currency and some amount(say, 70) in Local currency for the same line item(say, 0001) of a acct doc in FBB1 transaction........so, let me know that, How proceed in FBB1 tx to meet above requ

  • 3D Bar "peaks and troughs"

    Hello I am designing a website for a health company and plan to make a hart monitor line with a 3D bar. Now I know how to make the 3D bar but how do I manipulate the 'peaks and troughs' (points) to make it look like one long line? instead of many 3D

  • Problem migrating sales orders

    Hi all, I have a problem with the migration of sales orders from one SAP system to other. Scenario: A SAP system with sales orders and with its own condition types (prices and discounts). The data of sales orders pending for billing have been extract