Modify Code

Hi Guys,
I need some help please. There is a note on Payment terms. Please see the link below
https://service.sap.com/sap/support/notes/1316578
Here the solution is to :-
In the message class FC, change the message text for message 116 to: "When entering days, only fixed date 31 is permitted for condition &"
In the program SAPLFHL2, enter the text symbols 028 "After &1 day" and 029 "After 1 day".
Implement the source code corrections.
Can someone walk me through how to do this please? Please bear in mind I am not an ABAP person.
Many thanks for your help.
Best Regards,
Noopers

Hi
- A) Trx SE91: change message
- insert message class FC and msg number 116
- press Change
- Insert the new text for 116: When entering days, only fixed date 31 is permitted for condition &
- Press save;
- B) Trx SE38: change text symbol
- Insert SAPLFHL2
- Check Text Elements
- Press Change
- Insert the new text symbols 028 (with text "After &1 day") and 029 (with text "After 1 day");
- C) Trx OBB8: new terms of payment
- D) Abap Correction Instruction
---> It should be better to use trx SNOTE in order to implement the note
Trx SNOTE:
Go Goto->Sap note download
Insert your note and after downloading it, place the curso on it and implement it
---> If SNOTE doesn't work, u need to implement it manually:
So go to SE37 in order to change fm FI_TERMS_OF_PAYMENT_PROPOSE and trx SE38 in order to change the include L0F30I01, LF061F01 and LFHL2F00.
In this case u need to obtain the access key by your OSS
Max

Similar Messages

  • Help in modifying codes.

    hi, im having a problem now, lets say i have a table which contain
    (NAME(pk), AGE, GENDER), from program A i will insert the NAME and Age, so in the table it will be like (Tzepin, 20, GENDER), and from program B i wan to insert Male GENDER to my tzepin line, so it will become (Tzepin, 20, Male) but the modifying codes seems to blank the age and the end result is
    (Tzepin, nil, Male). How can i do to let the modify code to only modify the selected fields.

    Hi,
    Try this,
    Modify table i_tab from wa_itab transporting gender.
    This will change only the gender for the matching key in the work area.
    Reward if useful.
    Thanks,
    Muthu.

  • Modify code to pull the time dependent master data

    I fully under stand the suggestion below for the requirement to add the time dependent attribute comp code
    thanks fo rthe help but please tell me if there is a way i can modify the abap code and make the user enter the value for the date on which he want to pull th emaster data for company code or keydate to and from and pull the master data, so how will i proceede should i create the variable on 0doc_date and how to modify the code. please help . i have opened another question with same desc as above to assign points
    thanks
    soniya
    The literal within <..> is supposed to be replaced by the actual field name (as I didn't know the fields). In this case, I am changing your code for costcenter/company-code.
    data : wa like /bi0/qcostcenter.
    select single * from /bi0/qcostcenter into wa
    where costcenter = comm_structure-costcenter
    and objvers = 'A'
    and datefrom le comm_structure-<keydatefield>
    and dateto ge comm_structure-<keydatefield>.
    if sy-subrc = 0.
    result = wa-comp_code.
    endif.
    abort = 0.
    You can use this code for update rule of company_code. You have to replace '<keydatefield>' with a field name that contains the date on which the company is to be derived. If there is a date in your comm_structure (eg aedat) which you can use, you can specify that field in place of this literal (instead of comm_structure-<keydatefld> use comm_structure-aedat). If you have no such field, and you wish to use current date for getting the company code from time-dependent master data, you can use sy-datum (ie replace comm_strucutre-<keydatefld> with sy-datum).
    And it should work.
    The 'master data attribute' option is one of the options when you create update rule (one of the radio button options).

    That the code is doing anyway.
    If your txn data in the cube doesn't have a date, how does it know it is Feb data, or, it is March data?
    If it has a date or month field, you should modify and use this code to update the company based on that date instead of system date.
    Other than that minor variation, it is already doing what you look for.

  • Please chek my modify code.

    Hi all
    My code for modifying the rows in my internal table is not working.
    **MODIFY STATEMENT
    *wa_scarr-carrid = 'RG1'.
    *wa_scarr-carrname = 'RG Airlines1'.
    *loop at it_scarr into wa_scarr.
    *wa_scarr-currcode = 'USD'.
    *modify it_scarr index 3 from wa_scarr transporting currcode.
    *endloop.
    *loop at it_scarr into wa_scarr.
    write: / wa_scarr-carrid,
              wa_scarr-carrname,
              wa_scarr-currcode.
    *endloop.
    Please help.
    Thanks in advance.

    **MODIFY STATEMENT
    *wa_scarr-carrid = 'RG1'.
    *wa_scarr-carrname = 'RG Airlines1'.
    *wa_scarr-currcode = 'USD'.
    *modify it_scarr index 3 from wa_scarr transporting currcode. " If  modifying 3rd record no loop is required
    *loop at it_scarr into wa_scarr.
    * write: / wa_scarr-carrid,
    * wa_scarr-carrname,
    * wa_scarr-currcode.
    *endloop.
    If you want to modify all the records use:
    **MODIFY STATEMENT
    *wa_scarr-carrid = 'RG1'.
    *wa_scarr-carrname = 'RG Airlines1'.
    *loop at it_scarr into wa_scarr.
    *wa_scarr-currcode = 'USD'.
    *modify table it_scarr from wa_scarr transporting currcode.
    *endloop.
    *loop at it_scarr into wa_scarr.
    * write: / wa_scarr-carrid,
    * wa_scarr-carrname,
    * wa_scarr-currcode.
    *endloop.
    Regards,
    Gurpreet

  • Modify code generated by Form Editor

    Hello,
    I'm wondering how I can add the methode
    setLocationRelativeTo()
    to the code generated by the Form Editor in JDeveloper12.
    Or what do I have to do, to create a Project with Swing GUI, using a visual editor, which let's me modify the code???
    Maybe this is a very odd question, but I'm just a little bit confused. I'm quite sure, that I was able to modify my code using the Visual Editor in JDeveloper10. Or am I on the wrong way and have to write the code by totaly by myself, if I want to have the possibility of modification?
    Thanks
    chrissy

    Hi Timo,
    that's the way I think it should work, but all code for components created with visual GUI Editor is blocked. What also makes sense, because the Form Editor will overwrite it, everytime I change something with the GUI Editor.
    My start up was to create a new Application (Java Desktop Application) with a project. I think it is just using NetBeans (with which I have never worked before). Creating now a JFrame Form is using the Form Editor for visual stuff. What's nice to have, because a lot of code is auto-generated, but I also need to do some modifications, like setting the window appear in the middle of the screen with setLocationRelativeTo(). Is there a chance to do it, or do I have to start up another way, i.e. just creating a Custom Application and writing all the code by myself and use no visual editor?
    Thanks
    chrissy

  • Modify code to open any extension file?

    Hi,
    The following code is working fine to open any .PDF file by clicking on a  DataGrid row. Instead I want to use this code to open any file that browser supports. How to modify the following code?
    myGrid.addEventListener(ListEvent.ITEM_CLICK , gridItemClick);
    function gridItemClick (e:ListEvent):void
    var urlR:URLRequest=new URLRequest(e.target.getItemAt(e.rowIndex).PDF)
        navigateToURL(urlR, "_blank");
    Please do help.
    Thanks.

    the same code with the appropriate string assigned to the corresponding object property will work.

  • Lost SCA and want to modify code ?

    Hi,
    I've read Guenter Schiele's blog on "How to Migrate Developed Software Components to a New Release in NWDI"
    <a href="/people/guenter.schiele/blog/2007/02/12/how-to-migrate-developed-software-components-to-a-new-release-in-nwdi:///people/guenter.schiele/blog/2007/02/12/how-to-migrate-developed-software-components-to-a-new-release-in-nwdi
    Now I'm a little bit confused : what do I do if I develop a software component and lose the SCA and delete the track. If I understand correctly, the SCA (with source code option) must be imported into the track so developers can modify the source.  If I deleted the track where I did the development, how can I create a new track and continue developing this software component since there is no track to transport the source from.
    I know this is a worst case scenario but I was hoping the DTR would be our main source code database. This database is what I would backup with great care. I wasn't planing to do file system backups.
    Thanks

    Hi Thierry,
    If you delete a track in CMS the workspaces in DTR are not automatically deleted, i.e. you will not automatically lose your sources. (You can delete DTR workspaces manually if you really need to.) If you then create a new track with the same ID in CMS the DTR workspaces should be "reused". In that way you can also recreate what was there.
    Regards,
    Marc

  • Modify code for MSS/ESS in MySAP ERP 2004

    Hi,
    I have ECC, mySAP ERP 2004, NW 2004 and need to modify standard MSS in compensation management. I imported the MSS sca into the development track but unable to get the code of ecm. Isnt this migrated in NW2004? If not how do I get the par files or source code for editting the ecm of MSS.
    Please help,
    Dhanya

    1 - Is it par files or WD in ERP 2004 for compensation Management ? Can you tell me where can I download the standard par file ?
    In ERP2004, we had par files. You can download the business package from - https://www.sdn.sap.com/irj/sdn/developerareas/contentportfolio. When you unzip the zip file, you can see the par files there.
    2 - whether it is a right approach to download the standard par file, change and export it to reflect the changes liek normal portal projects?
    You shouldn't be changing the standard code. Once changed, support from SAP becomes difficult. But anyways, once changed it can surely be exported like any other object.
    3 - I have new WD ESS and MSS also so can I do a SCA for both the WD components and pars of portal applications into the same SCA? What is the best practise ?
    Ideally, WD applications and Portal Applications should be bundled in different SCA files. The reason being, WD can be stand-alone applications running on J2EE engine (though in your case it is not) but Portal applications are meant to run in the Portal Runtime.
    Regards,
    Sunil

  • Modifying code so that JCheckBox can be used instead of JComboBox

    Hello.
    how can I modify the following code so that JCheckBox can be used instead of JComboBox?
    Thanks.
    import javax.swing.*;
    import java.sql.*;
    import java.awt.*;
    import java.awt.event.*;
    public class Exercise32_6 extends JApplet {
      private JComboBox jcboTableName = new JComboBox();
      private JTextArea jtaResult = new JTextArea();
      private JButton jbtShowContents = new JButton("Show Contents");
      private Statement stmt;
      public void init() {
        initializeDB();
        jbtShowContents.addActionListener(new java.awt.event.ActionListener() {
           public void actionPerformed(ActionEvent e) {
              jbtShowContents_actionPerformed(e);
        JPanel jPanel1 = new JPanel();
        jPanel1.add(new JLabel("Table Name"));
        jPanel1.add(jcboTableName);
        jPanel1.add(jbtShowContents);
        this.getContentPane().add(jPanel1, BorderLayout.NORTH);
        this.getContentPane().add(new JScrollPane(jtaResult), BorderLayout.CENTER);
      private void initializeDB() {
        try {
          Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
          System.out.println("Driver loaded");
          Connection connection = DriverManager.getConnection("jdbc:odbc:VideoLibrary");
          System.out.println("Database connected");
          stmt = connection.createStatement();
          DatabaseMetaData dbMetaData = connection.getMetaData();
          ResultSet rsTables = dbMetaData.getTables(null, null, null, new String[] {"TABLE"});
          System.out.print("User tables: ");
          while (rsTables.next()) {
            jcboTableName.addItem(rsTables.getString("TABLE_NAME"));
        catch (Exception ex) {
          ex.printStackTrace();
      private void jbtShowContents_actionPerformed(ActionEvent e) {
        String tableName = (String)jcboTableName.getSelectedItem();
        try {
          String queryString = "select * from " + tableName;
          ResultSet resultSet = stmt.executeQuery(queryString);
          ResultSetMetaData rsMetaData = resultSet.getMetaData();
          for (int i = 1; i <= rsMetaData.getColumnCount(); i++) {
            jtaResult.append(rsMetaData.getColumnName(i) + "    ");
          jtaResult.append("\n");
          while (resultSet.next()) {
            for (int i = 1; i <= rsMetaData.getColumnCount(); i++) {
              jtaResult.append(resultSet.getObject(i) + "     ");
            jtaResult.append("\n");
        catch (SQLException ex) {
          ex.printStackTrace();
      public static void main(String[] args) {
        Exercise32_6 applet = new Exercise32_6();
        JFrame frame = new JFrame();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setTitle("Exercise32_6");
        frame.getContentPane().add(applet, BorderLayout.CENTER);
        applet.init();
        applet.start();
        frame.setSize(380, 180);
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
    }

    hello.
    thanks for the reply. i want users of my video library system to be able to view CD/DVD/Game information by name, age category, type and year. Users should be able to click on a check box (e.g. view by name, age category, type or year) and press a button. What would happen then is that data from the Product table would appear in the text area.

  • Modify Code (Modem Communication)

    Hi everybody!
    I have this code for the purpose of dialing by modem. It works the dialing part. But I want to know where I could modify the code so the modem can send and receive information.
    Please help....
    Thanks in advance....
    import java.io.*;
    import java.util.*;
    import javax.comm.CommPortIdentifier;
    import javax.comm.PortInUseException;
    import javax.comm.SerialPort;
    import javax.comm.SerialPortEvent;
    import javax.comm.SerialPortEventListener;
    import javax.comm.UnsupportedCommOperationException;
    public class Dialup implements Runnable,SerialPortEventListener
    static CommPortIdentifier portId;
    static Enumeration portList;
    InputStream inputStream;
    OutputStream outputStream;
    SerialPort serialPort;
    Thread dialupThread;
    String telNo;
    String dialCommand;
    public static void main(String[] args)
    System.err.println("START THE MAIN ");
    if( args.length != 1 )
    System.err.println("Usage: Dialup ");
    return;
    System.err.println(" START THE MAIN ");
    portList = CommPortIdentifier.getPortIdentifiers();
    System.out.println(portList);
    while (portList.hasMoreElements())
    portId = (CommPortIdentifier) portList.nextElement();
    System.out.println(portId.getPortType());
    if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL)
    if (portId.getName().equals("COM2"))
    System.err.println("PORT FIND ");
    Dialup dialer = new Dialup(args[0]);
    System.out.println("NO MORE ELEMENTS ");
    public Dialup(String telNo)
    this.telNo = telNo;
    this.dialCommand = "ATDT"+telNo+"\r\n";
    System.err.println( telNo );
    try
    serialPort = (SerialPort) portId.open("DialUp", 2000);
    catch (PortInUseException e)
    try
    inputStream = serialPort.getInputStream();
    outputStream = serialPort.getOutputStream();
    catch (IOException e)
    try
    serialPort.addEventListener(this);
    catch (TooManyListenersException e)
    try
    serialPort.setSerialPortParams(9600,
    SerialPort.DATABITS_8,
    SerialPort.STOPBITS_1,
    SerialPort.PARITY_NONE);
    catch (UnsupportedCommOperationException e) {
    dialupThread = new Thread(this);
    dialupThread.start();
    public void run()
    System.err.println("Try to connect ...");
    while(true)
    try
    System.err.println("Try to connect ...");
    if( !serialPort.isCD() )
    System.err.println("Try to connect ...");
    outputStream.write(dialCommand.getBytes());
    Thread.sleep(60000);
    catch(Exception ex)
    System.err.println("Failed to write message");
    public void serialEvent(SerialPortEvent event)
    switch(event.getEventType())
    case SerialPortEvent.OE:
    case SerialPortEvent.FE:
    case SerialPortEvent.PE:
    case SerialPortEvent.DSR:
    case SerialPortEvent.OUTPUT_BUFFER_EMPTY:
    System.err.println("Ignored event");
    break;
    case SerialPortEvent.BI:
    System.err.println("Break Interrupt");
    break;
    case SerialPortEvent.CTS:
    System.err.println("Clear to send");
    break;
    case SerialPortEvent.RI:
    if( event.getNewValue() )
    System.err.println("Ring Indicator On");
    else
    System.err.println("Ring Indicator Off");
    break;
    case SerialPortEvent.CD:
    if( event.getNewValue() )
    System.err.println("Connected");
    else
    System.err.println("Disconnected");
    break;
    case SerialPortEvent.DATA_AVAILABLE:
    byte[] readBuffer = new byte[20];
    try
    while (inputStream.available() > 0)
    int numBytes = inputStream.read(readBuffer);
    String result = new String(readBuffer,0,numBytes);
    System.err.print(result);
    catch (IOException e)
    System.err.println("Failed to read");
    break;

    what do you think inputStream = serialPort.getInputStream();
    outputStream = serialPort.getOutputStream();stand for? :-)

  • Please Need to Modify code. Help please.

    Ok you see this code here, it works perfectly for just 1 budgie class but I edited the budgie class and made it an array list with more than one budgie. How would I change the simulator code so it can support more than one budgie?
    import java.util.Random;
    public class Simulator
        // Instance variables
        private Cage cage;
        private int numberOfDays = 0;
        private Random r;
         // To die in 3 days, budgie must lose 50g body weight overall.
        public static final int DAILY_EXERCISE = 18; //PR
         * Constructor for objects of class Simulator
         * @param budgieCage, the cage on which to run the simulation.
        public Simulator(Cage budgieCage)
            cage = budgieCage;
            r = new Random();
        public void simulateDay(int amtFeed)
            //a new Day
            numberOfDays++;
            System.out.println("**************************");
            System.out.println ("Day : " + numberOfDays);
            if(!cage.isEmpty())
                    // Ask the cage to supply its budgie object
                    Budgie theBudgie = cage.getBudgie();
                    /* Check there really is a Bird in the cage. null means that there is no
                     * bird object assigned to the myBudgie variable in class cage.
                    if(theBudgie != null)
                       // Code moved from below.  PR
                       // Budgie gets older because a day has gone by.                     
                       theBudgie.incAge();
                       // Budgie exercises every day PR
                       theBudgie.exercise(DAILY_EXERCISE);
                        // Feed the budgie
                        // To avoid feeding nothing, check that food is given PR
                        // Also rejects negative feed!
                        if(amtFeed > 0)
                            theBudgie.eat(amtFeed);
                            System.out.println("Just been fed " + amtFeed + " grams of bird seed");
                        // Check if the budgie is still alive
                       if(theBudgie.isDead())
                            System.out.println(theBudgie.getName() + " just died...sob");
                            System.out.println("Here lies " + theBudgie.getName() + " this budgie was much loved by its " +
                                                   theBudgie.getNumEggsLaid() + " eggy ofspring");
                            cage.removeBudgie();
                        // If alive is it overweight?
                        else if(theBudgie.isObese())
                            System.out.println(theBudgie.getName() + " is obese it needs some exercise");
                            theBudgie.exercise(10);
                        else // Budgie is alive and not overweight
                            System.out.println(theBudgie.toString());
                           // The budgie gets a day older
                           // theBudgie.incAge(); // Moved to above PR
                            // The budgie may lay an egg                   
                            if(theBudgie.layEgg(r))
                                System.out.println(theBudgie.getName() + " has just laid an egg ");
                                System.out.println("The egg has been removed from the cage for artificial incubation \n"
                                                      + "and will be adopted out after hatching");
                else  // No budgie in the cage
                   System.out.println("The cage is empty");
         * Simulate several days without food.
         * @param numDays, the length of the simulation
        public void simulateDays(int numDays)
            for(int i = 0; i < numDays; i++)
                simulateDay(0); // PR
         * Simulate several days with food.
         * @param numDays, the length of the simulation
         * @param amtFeed, the amount of budgie food in grammes
        public void simulateDays(int numDays, int gmsSeed)
            for(int i = 0; i < numDays; i++)
                simulateDay(gmsSeed);
    Please your help would be greatly appreciated. If you need more infor just ask
    Message was edited by:
    gggman

    As the requirements of your application increase you will end up with an messy bit of code that no one including you can read. The long term solution to this is to redesign application cleanly using proper design patterns (Do a google search and read about theses).
    A quick solution would be, in keeping with the current trend in your design is to introduce another method that would take multiple simulation objects and iterate through theme. It would be better if you introduce a new class to do this. Here is an example.
    class MultiSimulator{
        Collection<Simulator> sims;
        MultiSimulator(){
            sims = new HashSet<Simulator>();
        MultiSimulator(Collection<Simulator> sims){
           this.sims = sims;
        //other constructors as you need theme
        boolean addSim(Simulator sim){
            return sims.add(sim);
        boolean addSim(Cage budgieCage){
            return sims.add(new Simulator(budgieCage));
        boolean removeSim(Simulator sim){
            return sims.remove(sim);
          *Simiulate only one day
        void simulateAll(){
        void simulateAll(int days){
            //use for loop and iterator
        void simulate(Simulator sim){
        void simulate(Simulator sim,int days){
        // and any other methods you can think of
    }

  • Where to modify code to format data

    I am using BC4J and am pulling a date from the database. I want to just display the date in a custom format. Where do I do this at? This date will also be inputed by the user to insert into the database.
    I am using Data Tags, but would prefer to use something more like UseBean tags.
    TIA

    I would like to do the same a Gerald. Has anyone created a custom tag that returns custom date format from BC4J. I actually am only viewing the date not actually inserting it back to the DB.
    I know that this will be available in the next release but that is still a while away.
    The code I am using is as follows:
    <jbo:ShowValue datasource="TableName" dataitem="LastUpdTs" ></jbo:ShowValue>
    null

  • Modify code in include program of smartform function module

    Hi,
               Someone hardcoded breakpoint inside the smartform function code.
    I have to delete that breakpoint.But its asking access key.
    Can't we remove that line in any other way?.
    Thanks,
    Sri

    Hi,
    You can remove it from the smartform instead of trying in the smartform include program.
    Thanks
    Arul

  • Return Current month Data:Help needed in modifying this code of a Procedure

    Hello Folks i have this scenario where i need to modify this code so that it has to return data from the Current month First Day to the previous Day if its a daily report and previous month data if its a monthly report.
    I have no clue how to modify this code below. Currently the code is returning data for Monthly reports for the previous month. Does anyone have any idea how to modify so that the code meets the requirements of both daily and monthly reprts.
    BEGIN
    if v_lowdate is null or v_highdate is null then
    select to_number(to_char(sysdate, 'DD')) into v_cur_day from dual;
    if v_cur_day < 25 then
    -- this is for the previous month run
    Select Add_Months(trunc(sysdate, 'MONTH'), -1)
    INTO V_LOWDATE
    FROM DUAL;
    SELECT Last_Day(ADD_Months(Sysdate, -1)) INTO V_Highdate From Dual;
    else
    -- this is for the current month run
    Select trunc(sysdate, 'MONTH') INTO V_LOWDATE FROM DUAL;
    SELECT Last_Day(Sysdate) INTO V_Highdate From Dual;
    end if;
    end if;
    Thanks
    Edited by: user11961230 on Sep 30, 2009 8:34 PM

    Hi Frank, This is code till the "modifying Code" which we were working. I will post the code after the "modifying Code" in the next reply. Thanks
    CREATE OR REPLACE PROCEDURE "POPULATE_RECOVERY_ACTIVITYHN"(p_lowdate date,
    p_highdate date) IS
    v_lowdate date := p_lowdate;
    v_highdate date := p_highdate;
    v_error_code NUMBER(20);
    v_error_text VARCHAR2(300);
    v_recovery_id Recovery.Recovery_ID%type;
    v_loop_control Number(20);
    v_settlement_id recovery.settlement_id%type;
    V_Event_ID Event.Event_ID%Type;
    V_Event_Case_ID Event_Case.Event_Case_ID%Type;
    V_Recovery_Month Varchar2(100);
    V_Major_Company Major_Client.Major_Client_Name%Type;
    V_Company Client.Client_Name%Type;
    V_Client_Policy_Identifier Varchar2(100);
    V_Lan_ID Varchar2(10) := 'TROVERIS';
    V_Recovery_Account Client.Account_Number%Type;
    V_AccountA Number(2) := 0;
    V_AccountB Number(2) := 0;
    V_Unit Event_Client_Field.Client_Field_Data%Type;
    V_Market Event_Client_Field.Client_Field_Data%Type;
    V_case_open_date Event_case.Open_Date%type;
    V_Employer_Group_Code Employer_Group.Employer_Group_Code%Type;
    V_Unknown1 Number(2) := 0;
    V_Fee_Schedule_Code Event_Case.Fee_Schedule_Code%Type;
    V_Total_Fee_Percent Number(20, 2) := 0.00;
    V_Subrogation_Fee_Percent Number(20, 2) := 0.00;
    V_Unknown2 Number(2) := NULL;
    V_Unknown3 Number(2) := NULL;
    V_TOTAL_MEDICAL Number(20, 2) := 0.00;
    V_Recovery_Amount Number(20, 2) := 0.00;
    V_Total_Tax Number(20, 2) := 0.00;
    V_Administrative_Tax Number(20, 2) := 0.00;
    V_Total_NonCash_Fee Number(20, 2) := 0.00;
    V_Total_NonCash_Positive Number(20, 2) := 0.00;
    V_Total_NonCash_Negative Number(20, 2) := 0.00;
    V_Total_Recovery Number(20, 2) := 0.00;
    V_Total_NonCash_Fee_Positive Number(20, 2) := 0.00;
    V_Total_NonCash_Fee_Negative Number(20, 2) := 0.00;
    V_Total_Admin_Fee Number(20, 2) := 0.00;
    V_Total_Fee Number(20, 2) := 0.00;
    V_Total_NonCash_Tax_Positive Number(20, 2) := 0.00;
    V_Total_NonCash_Tax_Negative Number(20, 2) := 0.00;
    report_type                  Varchar2(2);
    v_gl_num client.gl_num%type; -- *002*
    v_net_billable client.net_billable%type; -- *003*
    vevent_id event.event_id%type; -- *006*
    v_prev_event event.event_id%type; -- *006*
    v_prev_case event_case.event_case_id%type; -- *006*
    v_tot_recovery recovery.amount%type; -- *006*
    v_rec_amount recovery.amount%type; -- *006*
    v_prev_rec_amt recovery.amount%type; -- *006*
    v_prev_rec_month recovery_activity.recovery_month%type; -- *006*
    v_tot_fee recovery_activity.total_fee%type; --*006*
    v_mth_rev unbundled_recoveries.monthly_revenue%type; -- *006*
    v_diff number(18, 2); -- *006*
    v_nc_count number := 0; -- *006*
    v_c_count number := 0; -- *006*
    v_nc_tot recovery.amount%type; -- *006*
    v_used_rev recovery_activity.total_fee%type; -- *006*
    v_use_mth_rev unbundled_recoveries.monthly_revenue%type := 0; -- *006*
    v_use_nc_mth_rev unbundled_recoveries.monthly_revenue%type := 0; -- *006*
    v_prev_netbill client.net_billable%type; -- *006*
    v_event_type event.event_type_code%type;
    v_date_typed event.date_typed%type;
    v_acc_client_id client.acc_client_id%Type;
    v_Recovery_Revenue_GL_Num client.recovery_revenue_gl_num%Type;
    v_Funds_Due_GL_num client.funds_due_gl_num%Type;
    v_lob Varchar2(20);
    v_nc_recovery_id recovery.recovery_id%Type;
    /*Changed the Client_Policy_Identifier to concatenate the Retlation to insured code instead of the description
    which was exceeding the column size in the table. SWL 09/03/02. Checked with the Design Doc.*/
    CURSOR RECOVERY_INFO IS
    SELECT Event.Event_ID,
    Event_Case.Event_Case_ID,
    TO_CHAR(Recovery.Recovery_Date, 'FMMONTHYYYY') As Recovery_Month,
    Major_Client.Major_Client_Name AS Major_Company,
    -- Client.Client_Name AS Company,
    -- nvl(client.legacy_client_id,'DC')||'-'||substr(Client.Client_Name,1,55) AS Company, -- SWL 04/01/04 52653
    substr(nvl(client.legacy_client_id,
    decode(client.client_id, 1, 'DC', client.client_code)) || '-' ||
    Client.Client_Name,
    1,
    60) AS Company,
    Event.Client_Policy_Identifier ||
    Event_Case.Relation_To_Insured_code as Client_Policy_Identifier,
    Client.Account_Number as Recovery_Account,
    Employer_Group.Employer_Group_Code,
    Event_Case.Fee_Schedule_Code,
    Recovery_ID,
    Event_case.Open_Date,
    '(' || recovery.recovery_transaction_internal || ')' ||
    l.recovery_transaction_descripti, --fml 110276
    recovery.settlement_id,
    trim(client.gl_num), -- *002*
    nvl(trim(client.net_billable), 'N'), -- *003*
    recovery.amount, -- *006*,
    event.event_type_code,
    event.date_typed,
    recovery_id,
    Client.ACC_CLIENT_ID,
    Recovery_Revenue_GL_Num,
    Funds_Due_GL_num
    FROM Recovery,
    Settlement,
    Event_Case,
    Event,
    Employer_Group,
    Client,
    Major_Client,
    recovery_transaction_lookup l
    Where to_date(Recovery.Recovery_Date, 'DD-MON-RR') between
    TO_DATE(v_lowdate, 'DD-MON-RR') and
    TO_DATE(v_highdate, 'DD-MON-RR')
    AND Settlement.Settlement_id = Recovery.Settlement_id
    AND Settlement.Event_Case_ID = Event_Case.Event_Case_id
    AND Event_Case.Event_ID = Event.Event_ID
    AND Event.Employer_Group_ID = Employer_Group.Employer_Group_ID(+)
    AND Event.Client_ID = Client.Client_ID
    AND Client.Major_Client_id = Major_Client.Major_Client_ID(+)
    and recovery.settlement_id not in
    (select settlement_id
    from recovery
    where to_date(Recovery.Recovery_Date, 'DD-MON-RR') between
    TO_DATE(v_lowdate, 'DD-MON-RR') and
    TO_DATE(v_highdate, 'DD-MON-RR')
    AND recovery_transaction_internal in
    ('05', '50', '52', '51'))
    --001
    and    client.invoice_flag = 'N'            *005* commenting
    -- SWL 05/03/05 #71231
    and event.event_id in
    (select event_id
    from event_end_user eeu
    where eeu.active_flag = 'Y'
    and eeu.owner_flag = 'Y'
    and eeu.end_user_id in
    (select end_user_id
    from end_user
    where end_user.research_internal_user = 'Y'))
    and recovery.recovery_transaction_internal =
    l.recovery_transaction_internal --fml 110276
    order by event.event_id, recovery.amount; -- *006*
    -- SWL 05/03/05 #71231
    -- end of 001
    -- SWL 11/10/03 # 52743
    -- *006*
    CURSOR get_recovery(vevent_id event.event_id%type) IS
    SELECT sum(r.amount)
    FROM Recovery r
    Where to_date(r.Recovery_Date, 'DD-MON-RR') between
    TO_DATE(v_lowdate, 'DD-MON-RR') and
    TO_DATE(v_highdate, 'DD-MON-RR')
    and r.event_id = vevent_id
    and r.settlement_id not in
    (select settlement_id
    from recovery
    where to_date(Recovery.Recovery_Date, 'DD-MON-RR') between
    TO_DATE(v_lowdate, 'DD-MON-RR') and
    TO_DATE(v_highdate, 'DD-MON-RR')
    AND recovery_transaction_internal in
    ('05', '50', '52', '51'))
    and r.event_id in
    (select event_id
    from event_end_user eeu
    where eeu.active_flag = 'Y'
    and eeu.owner_flag = 'Y'
    and eeu.end_user_id in
    (select end_user_id
    from end_user
    where end_user.research_internal_user = 'Y'));
    CURSOR RECOVERY_INFO_NC IS
    SELECT distinct Event.Event_ID,
    Event_Case.Event_Case_ID,
    TO_CHAR(Recovery.Recovery_Date, 'FMMONTHYYYY') As Recovery_Month,
    Major_Client.Major_Client_Name AS Major_Company,
    -- Client.Client_Name AS Company,
    -- nvl(client.legacy_client_id,'DC')||'-'||substr(Client.Client_Name,1,55) AS Company, /* SWL 04/01/04 52653 */
    substr(nvl(client.legacy_client_id,
    decode(client.client_id,
    1,
    'DC',
    client.client_code)) || '-' ||
    Client.Client_Name,
    1,
    60) AS Company,
    Event.Client_Policy_Identifier ||
    Event_Case.Relation_To_Insured_code as Client_Policy_Identifier,
    Client.Account_Number as Recovery_Account,
    Employer_Group.Employer_Group_Code,
    Event_Case.Fee_Schedule_Code,
    '(' || recovery.recovery_transaction_internal || ')' ||
    l.recovery_transaction_descripti, --fml 110276
    recovery.settlement_id,
    trim(client.gl_num), -- *002*
    nvl(trim(client.net_billable), 'N'), -- *003*
    recovery.amount,-- *006*
    recovery.recovery_id,
    event.event_type_code,
    event.date_typed,
    Client.ACC_CLIENT_ID,
    Recovery_Revenue_GL_Num,
    Funds_Due_GL_num
    FROM Recovery,
    Settlement,
    Event_Case,
    Event,
    Employer_Group,
    Client,
    Major_Client,
    recovery_transaction_lookup l
    Where to_date(Recovery.Recovery_Date, 'DD-MON-RR') between
    TO_DATE(v_lowdate, 'DD-MON-RR') and
    TO_DATE(v_highdate, 'DD-MON-RR')
    AND Settlement.Settlement_id = Recovery.Settlement_id
    AND Settlement.Event_Case_ID = Event_Case.Event_Case_id
    AND Event_Case.Event_ID = Event.Event_ID
    AND Event.Employer_Group_ID = Employer_Group.Employer_Group_ID(+)
    AND Event.Client_ID = Client.Client_ID
    AND Client.Major_Client_id = Major_Client.Major_Client_ID(+)
    and recovery.settlement_id in
    (select settlement_id
    from recovery
    where to_date(Recovery.Recovery_Date, 'DD-MON-RR') between
    TO_DATE(v_lowdate, 'DD-MON-RR') and
    TO_DATE(v_highdate, 'DD-MON-RR')
    --001
    AND recovery.recovery_transaction_internal in
    ('05', '50', '52', '51')
    and    client.invoice_flag = 'N'   *005* commenting
    /* SWL 05/03/05 #71231 */
    and event.event_id in
    (select event_id
    from event_end_user eeu
    where eeu.active_flag = 'Y'
    and eeu.owner_flag = 'Y'
    and eeu.end_user_id in
    (select end_user_id
    from end_user
    where end_user.research_internal_user = 'Y'))
    and recovery.recovery_transaction_internal =
    l.recovery_transaction_internal --fml 110276
    order by event.event_id, recovery.amount; -- *006*
    /* SWL 05/03/05 #71231 */
    --end of 001
    -- *006*
    CURSOR get_recovery_nc(vevent_id event.event_id%type) IS
    SELECT sum(r.amount)
    FROM Recovery r
    Where to_date(r.Recovery_Date, 'DD-MON-RR') between
    TO_DATE(v_lowdate, 'DD-MON-RR') and
    TO_DATE(v_highdate, 'DD-MON-RR')
    AND r.event_id = vevent_id
    and r.settlement_id in
    (select settlement_id
    from recovery
    where to_date(Recovery.Recovery_Date, 'DD-MON-RR') between
    TO_DATE(v_lowdate, 'DD-MON-RR') and
    TO_DATE(v_highdate, 'DD-MON-RR'))
    AND recovery_transaction_internal in ('05', '50', '52', '51')
    and r.event_id in
    (select event_id
    from event_end_user eeu
    where eeu.active_flag = 'Y'
    and eeu.owner_flag = 'Y'
    and eeu.end_user_id in
    (select end_user_id
    from end_user
    where end_user.research_internal_user = 'Y'));
    CURSOR Recovery_Totals_Nc IS
    Select Recovery_Detail.Recovery_Id, /* SWL 07/01/04 59016 */
    max(NVL(Recovery_Detail.Fees_Percent, 0) +
    NVL(Recovery_Detail.Admin_Percent, 0)) as Total_Fee_Percent,
    max(NVL(Recovery_Detail.Fees_Percent, 0)) as Subrogation_Fee_Percent,
    max(NVL(Recovery.Amount, 0)) as Recovery_Amount, /* SWL 04/01/04 52653 */
    Sum(NVL(Recovery_detail.Fees, 0) + NVL(Recovery_Detail.Admin, 0)) as Total_Fee,
    Sum(NVL(Recovery_Detail.Fees_Taxes, 0) +
    NVL(Recovery_Detail.Admin_Taxes, 0)) as Total_Tax,
    Sum(NVL(Recovery_Detail.Admin_Taxes, 0)) as Administrative_tax,
    Sum(NVL(Recovery_Detail.Admin, 0)) as Total_Admin_Fee,
    sum(recovery.retained_by_client) as Non_cash_fee, --fml 110276
    sum(recovery.allocation_check_amount) as cash --fml 110276
    From Settlement, Recovery, Recovery_Detail
    Where Recovery.settlement_id = v_settlement_id
    And recovery.recovery_id = v_recovery_id
    And Settlement.Settlement_id = Recovery.Settlement_id
    And Recovery.Recovery_id = Recovery_detail.Recovery_id(+)
    and to_date(Recovery.Recovery_Date, 'DD-MON-RR') between
    TO_DATE(v_lowdate, 'DD-MON-RR') and
    TO_DATE(v_highdate, 'DD-MON-RR') /*SWL 12/03/04 */
    -- Group by Recovery_Detail.Fees_Percent; /* SWL 04/01/04 52653 */
    Group by Recovery_Detail.recovery_id;
    v_cash_recovery recovery_activity.cash_recovery%type;
    CURSOR Recovery_Totals_Positive_Nc IS
    -- Select Sum(Recovery.Amount) as Total_NonCash_Positive, /* SWL 04/01/04 52653 */
    Select max(Recovery.Amount) as Total_NonCash_Positive,
    Sum(NVL(Recovery_Detail.Fees_Taxes, 0) +
    NVL(Recovery_Detail.Admin_Taxes, 0)) as Total_NonCash_Tax_Positive
    From Settlement, Recovery, Recovery_detail
    Where Recovery.settlement_id = v_settlement_id
    And Settlement.Settlement_id = Recovery.Settlement_id
    and recovery.recovery_id = v_recovery_id /* SWL 07/01/04 59016 */
    And Recovery.Amount >= 0
    And Recovery.Recovery_id = Recovery_detail.Recovery_id(+)
    And Recovery.Recovery_Transaction_Internal in
    ('05', '50', '52', '51')
    -- Group by Recovery_Detail.Fees_Percent; /* SWL 04/01/04 52653 */
    Group by Recovery_Detail.recovery_id;
    CURSOR Recovery_Totals_Negative_Nc IS
    -- Select Sum(Recovery.Amount) as Total_NonCash_Negative, /* SWL 04/01/04 52653 */
    Select max(Recovery.Amount) as Total_NonCash_Negative,
    Sum(NVL(Recovery_Detail.Fees_Taxes, 0) +
    NVL(Recovery_Detail.Admin_Taxes, 0)) as Total_NonCash_Tax_Negative
    From Settlement, Recovery, Recovery_Detail
    Where Recovery.settlement_id = v_settlement_id
    And Settlement.Settlement_id = Recovery.Settlement_id
    and recovery.recovery_id = v_recovery_id /* SWL 07/01/04 59016 */
    And Recovery.Amount < 0
    And Recovery.Recovery_id = Recovery_detail.Recovery_id(+)
    And Recovery.Recovery_Transaction_Internal in
    ('05', '50', '52', '51')
    Group by Recovery_Detail.recovery_id;
    -- Group by Recovery_Detail.Fees_Percent; /* SWL 04/01/04 52653 */
    /* SWL 11/10/03 # 52743 */
    CURSOR Event_Client_Unit IS
    Select e.Client_Field_Data as Unit
    From Event_Client_Field e, recovery r
    Where r.Event_ID = e.Event_ID
    AND r.Recovery_ID = V_Recovery_ID
    AND e.Client_Field_Name = 'UNIT';
    CURSOR Bill_totals IS
    Select mv_billdetail_case_sum.sum_paid as TOTAL_MEDICAL
    From mv_billdetail_case_sum
    where mv_billdetail_case_sum.event_id = V_Event_ID;
    CURSOR NonCash_Fee IS
    Select NVL(Sum(Recovery.Amount), 0) as Total_NonCash_Fee
    From Settlement, Recovery
    Where Recovery.Recovery_ID = V_Recovery_ID
    And Settlement.Settlement_id = Recovery.Settlement_id
    And Recovery.
    Recovery_Transaction_Internal in ('05', '50', '52', '51');
    /* SWL 04/01/04 52653 */
    CURSOR Recovery_Totals IS
    Select round(avg(NVL(Recovery_Detail.Fees_Percent, 0) +
    NVL(Recovery_Detail.Admin_Percent, 0)),
    2) as Total_Fee_Percent,
    round(avg(NVL(Recovery_Detail.Fees_Percent, 0)), 2) as Subrogation_Fee_Percent,
    max(NVL(Recovery.Amount, 0)) as Recovery_Amount,
    Sum(NVL(Recovery_detail.Fees, 0) + NVL(Recovery_Detail.Admin, 0)) as Total_Fee,
    Sum(NVL(Recovery_Detail.Fees_Taxes, 0) +
    NVL(Recovery_Detail.Admin_Taxes, 0)) as Total_Tax,
    Sum(NVL(Recovery_Detail.Admin_Taxes, 0)) as Administrative_tax,
    Sum(NVL(Recovery_Detail.Admin, 0)) as Total_Admin_Fee
    From Settlement, Recovery, Recovery_Detail
    Where Recovery.Recovery_ID = V_Recovery_ID
    And Settlement.Settlement_id = Recovery.Settlement_id
    And Recovery.Recovery_id = Recovery_detail.Recovery_id(+)
    Group by Recovery_Detail.recovery_id;
    CURSOR Recovery_Totals_Positive IS
    /* Select Sum(Recovery.Amount) as Total_NonCash_Positive,
    Sum(NVL(Recovery_Detail.Fees_Taxes,0)+ NVL(Recovery_Detail.Admin_Taxes,0)) as Total_NonCash_Tax_Positive
    */ /* SWL 04/01/04 52653 */
    Select max(Recovery.Amount) as Total_NonCash_Positive,
    Sum(NVL(Recovery_Detail.Fees_Taxes, 0) +
    NVL(Recovery_Detail.Admin_Taxes, 0)) as Total_NonCash_Tax_Positive
    From Settlement, Recovery, Recovery_detail
    Where Recovery.Recovery_ID = V_Recovery_ID
    And Settlement.Settlement_id = Recovery.Settlement_id
    And Recovery.Amount >= 0
    And Recovery.Recovery_id = Recovery_detail.Recovery_id(+)
    And Recovery.Recovery_Transaction_Internal in ('04', '17', '15') /*SWL 10/05/04 #63919*/--*009* added 15
    Group by Recovery_Detail.recovery_id;
    -- Group by Recovery_Detail.Fees_Percent; /* SWL 04/01/04 52653 */
    CURSOR Recovery_NonFEE_Positive IS
    Select Sum(NVL(Recovery_Detail.Fees, 0) + NVL(Recovery_Detail.Admin, 0)) as Total_NonCash_Fee_Positive
    From Settlement, Recovery, Recovery_detail
    Where Recovery.Recovery_ID = V_Recovery_ID
    And Settlement.Settlement_id = Recovery.Settlement_id
    And Recovery.Amount >= 0
    And Recovery.Recovery_id = Recovery_detail.Recovery_id(+)
    And Recovery.Recovery_Transaction_Internal in
    ('05', '50', '52', '51')
    Group by Recovery_Detail.recovery_id;
    -- Group by Recovery_Detail.Fees_Percent; /* SWL 04/01/04 52653 */
    CURSOR Recovery_Totals_Negative IS
    /* Select Sum(Recovery.Amount) as Total_NonCash_Negative,*/ /* SWL 04/01/04 52653 */
    Select max(Recovery.Amount) as Total_NonCash_Negative,
    Sum(NVL(Recovery_Detail.Fees_Taxes, 0) +
    NVL(Recovery_Detail.Admin_Taxes, 0)) as Total_NonCash_Tax_Negative
    From Settlement, Recovery, Recovery_Detail
    Where Recovery.Recovery_ID = V_Recovery_ID
    And Settlement.Settlement_id = Recovery.Settlement_id
    And Recovery.Amount < 0
    And Recovery.Recovery_id = Recovery_detail.Recovery_id(+)
    And Recovery.Recovery_Transaction_Internal in ('04', '17', '15') /*SWL 10/05/04 #63919*/--*009* added 15
    Group by Recovery_Detail.recovery_id;
    -- Group by Recovery_Detail.Fees_Percent; /* SWL 04/01/04 52653 */
    CURSOR Recovery_NonFEE_Negative IS
    Select Sum(NVL(Recovery_Detail.Fees, 0) + NVL(Recovery_Detail.Admin, 0)) as Total_NonCash_Fee_Negative
    From Settlement, Recovery, Recovery_Detail
    Where Recovery.Recovery_ID = V_Recovery_ID
    And Settlement.Settlement_id = Recovery.Settlement_id
    And Recovery.Amount < 0
    And Recovery.Recovery_id = Recovery_detail.Recovery_id(+)
    And Recovery.Recovery_Transaction_Internal in
    ('05', '50', '52', '51')
    Group by Recovery_Detail.recovery_id;
    -- Group by Recovery_Detail.Fees_Percent; /* SWL 04/01/04 52653 */
    --This is a generic cursor which will be used to control the number of rows inserted into the recovery_activity table
    --There has to be 1 row inserted into the recovery_activity table for each detail record in the recovery_detail table.
    --However, if no recovery_detail record exists there will be only 1 insert into the recovery_activity table.
    CURSOR Control_Detail_Loop
    IS
    Select 1
    FROM Recovery,
    Recovery_Detail
    Where Recovery.Recovery_ID = Recovery_Detail.Recovery_ID(+)
    And Recovery.Recovery_ID = V_Recovery_ID;
    /* SWL 04/01/04 Commented since the only time there were more entries in rd for a recovery is when there is a split fees */
    /* accounting does not want this to be displayed in detail. They need this aggregated as a single fee entry so the recovery */
    /* activity table will now have a single entry corresponding to each recovery in the recovery table. (#52653) */
    CURSOR Control_Detail_Loop IS
    Select 1 FROM Recovery where Recovery.Recovery_ID = V_Recovery_ID;
    /* DJ 10/25/04 # 64633 start*/
    CURSOR Event_Client_Market IS
    Select e.Client_Field_Data as Market
    From Event_Client_Field e, recovery r
    Where r.Event_ID = e.Event_ID
    AND r.Recovery_ID = V_Recovery_ID
    AND e.Client_Field_Name = 'MARKET';
    /* DJ 10/25/04 # 64633 end*/
    v_cur_day integer := 0;
    -----dj
    v_vendor_fee_wh number;
    v_total_vendor_fee_wh number;
    v_rec_itc recovery_activity.recovery_transaction_internal%type;
    --v_settlement_id settlement.settlement_id%type;
    --*004* start
    function unbundled_fee(pevent_id event.event_id%type,
    plowdate date,
    phighdate date) return number is
    -- function variables
    v_fee number(18, 2) := 0;
    v_month_revenue unbundled_recoveries.monthly_revenue%type := 0;
    v_cum_revenue unbundled_recoveries.cum_revenue%type := 0;
    v_contract_fee_per unbundled_recoveries.contractual_fee_per%type := 0;
    v_prev_cum_revenue unbundled_recoveries.cum_revenue%type := 0;
    v_cum_ub_rec unbundled_recoveries.cum_ub_recoveries%type := 0;
    v_cum_inv_paid unbundled_recoveries.cum_inv_paid%type := 0;
    v_month_rec unbundled_recoveries.monthly_recoveries%type := 0;
    v_cum_rec unbundled_recoveries.cum_recoveries%type := 0;
    v_event_id event.event_id%type;
    begin
    --v_month_rec and v_cum_inv_paid
    begin
    select event_id,
    (select sum(r.amount)
    from recovery r
    where r.event_id = e.event_id
    and trunc(r.recovery_date) between plowdate and phighdate) as monthly_recoveries,
    -- *006* added cum_rec
    (select nvl(sum(r.amount), 0)
    from recovery r
    where r.event_id = e.event_id
    and trunc(r.recovery_date) <= trunc(phighdate)) as cum_recoveries,
    (select sum(decode(nvl(ex.client_invoice_closed, 'N'),
    'N',
    ex.paid_amount,
    ex.client_invoice_received))
    from expense ex
    where ex.event_id = e.event_id
    and upper(ex.status) = 'PAID'
    and trunc(ex.check_date) <= phighdate
    and trim(ex.orig_client_invoice_date) is not null
    and nvl(ex.client_invoice_dispute, 'Y') = 'N') as cum_invoiced_paid
    into v_event_id, v_month_rec, v_cum_rec, v_cum_inv_paid
    from event e
    where e.event_id = pevent_id;
    exception
    when no_data_found then
    v_event_id := 0;
    v_month_rec := 0;
    v_cum_rec := 0;
    v_cum_inv_paid := 0;
    when others then
    v_event_id := 0;
    v_month_rec := 0;
    v_cum_rec := 0;
    v_cum_inv_paid := 0;
    end;
    -- *007* start
    -- if event previously written to table, get values from table
    begin
    select nvl(ub.cum_revenue, 0)
    into v_prev_cum_revenue
    from unbundled_recoveries ub
    where ub.event_id = pevent_id
    and ub.month_id =
    (select max(a.month_id)
    from unbundled_recoveries a
    where a.event_id = pevent_id
    and a.month_id < to_char(v_lowdate, 'YYYYMM'));
    exception
    when no_data_found then
    v_prev_cum_revenue := 0;
    when others then
    v_prev_cum_revenue := 0;
    end;
    -- *007* end
    --v_contract_fee_per
    begin
    select nvl(max(rd.fees_percent), 0)
    into v_contract_fee_per
    from recovery_detail rd
    where rd.recovery_id in
    (select r.recovery_id
    from recovery r,
    (select a.event_id, max(amount) as amount
    from recovery a
    where a.event_id = pevent_id
    and trunc(a.recovery_date) between plowdate and
    phighdate
    group by a.event_id) max_r
    where r.event_id = max_r.event_id
    and trunc(r.recovery_date) between plowdate and phighdate
    and r.amount = max_r.amount);
    exception
    when no_data_found then
    v_contract_fee_per := 0;
    when others then
    v_contract_fee_per := 0;
    end;
    v_cum_ub_rec := nvl(v_cum_rec, 0) - nvl(v_cum_inv_paid, 0);
    if ((nvl(v_cum_ub_rec, 0) > 0) and (nvl(v_month_rec, 0) <> 0)) then
    -- latest cumulative unbundled recoveries > 0
    v_cum_revenue := round(((v_contract_fee_per / 100) * v_cum_ub_rec),
    2);
    v_month_revenue := v_cum_revenue - v_prev_cum_revenue;
    end if;
    v_fee := v_month_revenue;
    return v_fee;
    exception
    when others then
    raise_application_error(-20106,
    substr('populate_recovery_activity.undebundled_fee: ' ||
    Sqlcode || Sqlerrm,
    1,
    500));
    return v_fee;
    end;

  • Getting Custom code error while deploying the report but in local(BI studio) when i preview its working,

    Hi,
    I Haven't used Vb.net, as I work on C#, But in SSRS it supports only VB.net code as custom coding, so i coded in c# and converted to VB.net from online converter. The code i got from online converter is working fine in local i.e when i preview in BI studio,
    but when i try to deploy the same i'm getting error 
    Error 3
    There is an error on line 12 of custom code: [BC30201] Expression expected.
    0 0
    Below is the code:
    ' -- Author        : Jai Anand
    ' -- Date            : 06-05-2014
    ' -- Discription : To split the given string of numbers and Assign the days for it,
    ' --                        example: if integer 1 - (Su) --> Sunday, 2 - (Mo) --> Monday
    public Function FindPlanDays(plandate As String) As String
    Dim planarray As String() = New String() {}
    Dim days As String = ""
    planarray = plandate.Split(","C)
    Dim i As Integer = 0
    While i < planarray.Length 
    Dim day As String = If(planarray(i) = "1", "Su,", If(planarray(i) = "2", "Mo,", 
     If(planarray(i) = "3", "Tu,", If(planarray(i) = "4", "We,", If(planarray(i) = "5", "Th,", If(planarray(i)="6","Fr,", If(planarray(i) = "7", "Sa,", String.Empty)))))))
    days = days & day
    i += 1
    End While
    days = If(days <> String.Empty, " (" + days.TrimEnd(","C) + ")", days)
    Return days
    End Function
    Kindly check the code, if any issue is there,give me the solution..Thank you

    Hi,
    I found the solution and the report is deployed . The issue was with If and we should suffix with space and underscore( _) at the end of the line break and continues in next line (i.e if the statement continues in next line).
    iif has always been available in VB, even in VB6.
    Dim day As String = Iif(planarray(i) = "1", "Su,","Mon")
    It is not a true operator, as such, but a function in the Microsoft.VisualBasic namespace.
    so the modified code which worked fine to deploy
    ' -- Author        : Jai Anand
    ' -- Date            : 06-05-2014
    ' -- Discription : To split the given string of numbers and Assign the days for it,
    ' --                        example: if integer 1 - (Su) --> Sunday, 2 - (Mo) --> Monday
    public Function FindPlanDays(plandate As String) As String
    Dim planarray As String() = New String() {}
    Dim days As String = ""
    planarray = plandate.Split(","C)
    Dim i As Integer = 0
    While i < planarray.Length 
    Dim day As String = Iif(planarray(i) = "1", "Su," ,Iif(planarray(i) = "2", "Mo,", _  
     Iif(planarray(i) = "3", "Tu,", Iif(planarray(i) = "4", "We,", Iif(planarray(i) = "5", "Th,", _
     Iif(planarray(i) ="6","Fr,", Iif(planarray(i) = "7", "Sa,", String.Empty)))))))
    days = days & day
    i += 1
    End While
    days = Iif(days <> String.Empty, " (" + days.TrimEnd(","C) + ")", days)
    Return days
    End Function

Maybe you are looking for

  • External hard drive disconnect--photos disappeared!

    My external hard drive (with my iphoto library stored on it) was disconnected when iphoto was open, and when i reconnected the drive and reopened iphoto, the display claimed there were no photos and didn't give me the window to find the library. All

  • Select-options values display

    Hi experts, I have three select-options in a selection-screen like s_vbeln for vbak-vbeln, I want to display the values entered in the select-options of the selection-screen on the report. eg!.. If user enters the multiple values in the select-option

  • HP Scanjet G4050 and Windows 7 Home Premium Ver 6.1

    I bought the G4050 photo scanner years ago and it worked fine with my old laptop windows XP operating system for the time I had it.  But shortly after, I upgraded my laptop to a Dell XPS with a Windows 7 Home Premium. I've never been able to use my s

  • My iphone and 3 ipad are sync together , one ipad is lost what to do next. help

    Hi, Couple of months ago i lost my ipad2 wifi 3g in texi. my ipad was sync with my iphone so i managed to put it on lost mode. last week notification came that somebody has changed ipads name and its in ethiopia. i purchased new ipad 4 last month and

  • How to format DVD-R so a movie will play in a DVD player

    How to format a DVD-R useing HP computor so it will play in any DVD player Bought movie from I tunes