How to Change  Numeric Value into Character Value in Reports at run-time?

Hi,
I am creating some reports, in which i am facing a problem.
i have an AMOUNT field of "NUMBER" data type in a table, I want to show the AMOUNT value in Character at run-rime.
For example, if AMOUNT is 12000 then it should be converted into Character like "Twelve Thosand".
Please help me to make it clear.
Thanking you in advance.

u can get decimal points through this function
FUNCTION amt_2_word(amt varchar2) RETURN Char IS
BEGIN
     declare
          --TYPE v_arr IS VARRAY(6) of varchar2(3);
          len number;
          i number;
          t_amt varchar2(100);
          t_word varchar2(20000);
          last_3rd varchar2(1);
          main varchar2(1000); -- number in format main.sub
          --v_main v_arr := v_arr('00','0','00','00','000');
          v_main1 varchar2(3) := '00';
          v_main2 varchar2(3) := '0';
          v_main3 varchar2(3) := '00';
          v_main4 varchar2(3) := '00';
          v_main5 varchar2(3) := '000';
          sub varchar2(1000);
          res_1 varchar2(32000);
          res_2 varchar2(32000);
          res_3 varchar2(32000);
          res_4 varchar2(32000);
          res_5 varchar2(32000);
          res varchar2(32000);
     begin
          t_amt := lpad(amt, 10, '0');
          len := length(amt);
          i := instr(amt, '.');
          if i = 0 then
               main := lpad(amt, 10, '0');
               sub := '';
          else
               main := lpad(left(amt, instr(amt, '.')-1), 10, '0');
               sub := rpad(right(amt, len - instr(amt, '.')), 2, '0');
          end if;
          v_main1 := right(main, 2);
          v_main2 := left(right(main, 3), 1);
          v_main3 := left(right(main, 5), 2);
          v_main4 := left(right(main, 7), 2);
          v_main5 := left(main, 3);
          if v_main1 <> '00' then
               res_1 :=getTwo(v_main1);
          end if;
          if v_main2 <> '0' then
               res_2 := getOne(v_main2) || ' Hundred ';
          end if;
          if v_main3 <> '00' then
               res_3 := getTwo(v_main3) || ' Thousand ';
          end if;
          if v_main4 <> '00' then
               res_4 := getTwo(v_main4) || ' Lac ';
          end if;
          if v_main5 <> '000' then
               last_3rd := left(right(v_main5, 3), 1);
               if last_3rd <> '0' then
                    res_5 := getOne(last_3rd) || ' Hundred ';
               end if;
               res_5 := res_5 || getTwo(right(v_main5, 2)) || ' Crore ';
          end if;
          res := 'Rupees ' || res_5 || res_4 || res_3 || res_2 || res_1 || ' ';
          if sub is null then
               res := res || 'Only';
          else
               res_1 := getTwo(sub);
               res := res || 'and Paise ' || res_1 || ' Only';
          end if;
          return res;
     end;
END;
u write this PL SQL in ur databse and u can use this function and get amount to word

Similar Messages

  • How to change Number of test socket in Model option during run-time

    I wanna be able to change the the number of test sockets(in the Model Options menu) during runtime. I have overriden the Prebatch callback and used my own instead. I have a LabView program in my Prebatch where I would select the test script each time before running the batch. I wann be able to also modify the number of test sockets each time before I run the batch again. I tried setting the "Parameters.ModelData.ModelOptions.NumTestSockets" from the Labview program which is in my Prebatch before running each batch, but get into errors. Please help?

    Hello Kumar,
    The Batch process model shipped with TestStand does not handle this scenario, but you can still do this. Attached is a sequence file that utilizes the Batch Model's ProcessCleanup callback to reset the next execution point. It still uses the method of setting the Parameters.ModelOptions.NumTestSockets variable in the PreBatch callback. The change I added was three steps to a different callback (the ProcessCleanup callback):
    Message Popup - prompts Yes or No to continue testing with a new batch size.
    Statement 1 - based on the response to the message popup (via precondition), resets the Batch Model's next step to be executed and the ContinueTesting flag:
    RunState.Root.RunState.StepGroup = "Setup"
    RunState.Root.RunState.NextStepIndex = 0
    RunState.Root.Locals.ModelData.ContinueTesting = True
    Statement 2 - based on the response to the message popup (via precondition), loops to reset each TestSocket's ContinueTesting flag:
    RunState.Root.Locals.ModelData.TestSockets[RunState.LoopIndex].ContinueTesting = True
    These two statement steps force the next step to be executed in the Batch Process Model to be the first step in the "Setup" step group, and reset all necessary flags for the batch itself and the individual TestSockets. I discovered the flags that had to be reset by trial-and-error (that was the time-consuming part).
    You can run continuous batches of the same size you first chose (for as long as you like), but when stop the batch execution this new message popup will prompt (yes/no) whether you want to continue testing with a new batch size. If no, then processing terminates. If yes, then the next two statement steps are run and execution resumes back at the beginning of the Batch Process Model's Setup step group. This forces the ModelOptions callback to be executed again, so your VI (in my example here it's just a Message Popop) can then set NumTestSockets appropriately.
    Thanks for contacting National Instruments!
    David Mc.
    NI Applications Engineering
    Attachments:
    kumar.seq ‏27 KB

  • How to change 'z' key into 'A' key with key blinding?

    How to change 'z' key into 'A' key?
    Although txt.setText("A") can set the text field with 'a', but it is not original input from keyboard because it cant trigger the key listener.
    It is possible to perform key pressing more than a key in same time? Example, perform 'q' & 'w' keys pressing at the same time.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class Main
    {   public static void main(String[] args)
        {   JFrame f = new JFrame("Test");
            Test GUI = new Test();
            GUI.setOpaque(true);
            f.setContentPane(GUI);
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.pack();
            f.setVisible(true);
    class Test extends JPanel
    {   JTextArea txta = new JTextArea(10,20);
        JTextField txt = new JTextField(10);
        JScrollPane sp_txta = new JScrollPane(txta);
        public Test()
        {   this.setPreferredSize(new Dimension(400,300));
            setLayout(new BorderLayout());
            txta.setEditable(false);
            add(sp_txta, BorderLayout.CENTER);
            add(txt, BorderLayout.PAGE_END);
            Action testAction = new AbstractAction()
            {   public void actionPerformed(ActionEvent ae){ txt.setText("A"); }
            txt.getInputMap().put(KeyStroke.getKeyStroke('z'), "test");    //Change z into A
            txt.getActionMap().put("test", testAction);
            txt.addKeyListener
            (   new KeyListener()
                {   public void keyPressed(KeyEvent e){ txta.append(e.getKeyChar() + " key is pressed \n"); }
                    public void keyReleased(KeyEvent e){ txta.append(e.getKeyChar() + " key is released \n"); }
                    public void keyTyped(KeyEvent e){ txta.append(e.getKeyChar() + " key is typed \n"); }
    }Edited by: 835972 on Feb 11, 2011 8:11 AM

    It is possible to perform key pressing more than a key in same time? Example, perform 'q' & 'w' keys pressing at the same time.With r.keyPress method, it only can perform single key pressed at a time. Do you have any idea how to perform multiple key pressed at a time?The javadoc for Robot.keyPress suggests ( "+The key should be released using the keyRelease method+" ) that the key remains "pressed" until you keyRelease(...) it. So, press the keys sequentially:
    theRobot.keyPress(KeyEvent.VK_Q);
    theRobot.keyPress(KeyEvent.VK_W);
    // At this stage both Q and W are pressed "in same time"
    ... // do stuff
    theRobot.keyRelease(KeyEvent.VK_W);
    // At this stage, only Q is pressedI suspect that in real life, unless you're a very gifted musician, you don't really press keys "at the same time" (under the time resolution of a keyboard, which I imagine is around a few milliseconds).

  • I have just installed Illustrator CS6 yesterday, but I found it was in French. Could help me figure out how to change the language into English?

    I have just installed Illustrator CS6 yesterday, but I found it was in French. Could help me figure out how to change the language into English?
    I got my series number from my Institut (which is in Paris, FR). I do not use Creative Cloud.
    When I was installing the software, I cannot select a language.
    Could you help me with my problem? Do I have to get a different series number?

    lunc,
    You will have to get a new application in English, to replace the French one.
    You, or your Institute will have to get help from Adobe, I am afraid.
    You may try a chat here,
    Get help with orders, refunds, and exchanges (non-CC, chat open between 5AM and 7PM PST/PDT on workdays)
    http://helpx.adobe.com/x-productkb/global/service-b.html
    or (have your Institute) talk to Adobe in France
    http://helpx.adobe.com/adobe-connect/adobe-connect-phone-numbers.html
    If you fail to get any help, please report back here, and I will ask a special forum staff friend to try to find the right one at Adobe to have things sorted out.

  • How to change the folder name in the web report.

    hi experts,
    can anybody give me the solution, how to change the folder name in the web report. any help is appreciated.
    waiting for ur favourable response.
    thanks
    suri

    Hi Tony,
    Yes, the business requires, only to change in the webreport only not in bex and roles. any suggestions will be helpful to me.
    thanks
    surendra

  • How can I map the composite_dn name with a composite in run time

    Hi All,
    I want to craete a report on number of total business and system faults with the help of Information Publisher in OEM 12c Cloud Control. I am fetching data from the table composite_instance_fault present in SOAINFRA schema. Below os my SQL statement:-
    select error_category,count(error_category) from prefix_SOAINFRA.composite_instance_fault where composite_dn=??EMIP_BIND_TARGET_GUID?? group by error_category
    Now I want to know that how can I map the composite_dn name with a composite in run time. When we fetch data from the repository we used to map target in rumtime by using ??EMIP_BIND_TARGET_GUID?? but here as I am not fetching data from repository, how can I map target in run time.
    On executing the above SQL statement its returing an empty table without any data.
    Please guide!!
    Thanks in Advance!!

    Hi,
    try something like this.
    Mike
    Attachments:
    Unbenannt 5_LV80.vi ‏12 KB

  • HOW TO create a temp table or a record group at run time

    i have a a tabular form and i dont want to allow the user entering duplicate
    records while he is in insert mode and the inserted records are new and not exsisting in the database.
    so i want to know how to create a temp table or a record group at run time to hold the inserted valuse and compare if they are exsiting in previous rows or no.
    please help!

    As was stated above, there are better ways to do it. But if you still wish to create a temporary block to hold the inserted records, then you can do this:
    Create a non-database block with items that have the same data types as the database table. When the user creates a new record, insert the record in the non-database block. Then, before the commit, compare the records in the non-database block with those in the database block, one at a time, item by item. If the record is not a duplicate, copy the record to the database block. Commit the records, and delete the records in the non-database block.

  • Can we change [maximum number of records per page] property at run time

    can we change [maximum number of records per page] property at run time in report 6i

    Ravi,
    I hope you are already done with this. In the invoice there is a nice example you can use on the xml blogs.
    You limit the number of lines per page when you use the xsl commands like this in your template:
    <xsl:variable name="lpp" select="number(13)"/>
    <?for-each@section:LIST_G_INVOICE?>
    <xsl:variable xdofo:ctx="incontext" name="invLines" select=".//G_LINES[LINE_TYPE='LINE']"/>
    <?for-each:$invLines?> <?if:(position()-1) mod $lpp=0?> <xsl:variable name="start" xdofo:ctx="incontext" select="position()"/>
    and then you have the table where you have the data
    <?for-each:$invLines?><?if:position()>=$start and position()<$start+$lpp?>
    and all your lines
    and then
    <?end if?><?end for-each?>

  • How 2 convert numeric value to character value?

    Hi friends,
    I want to convert numeric value to the character value.
    Is there any FM available?
    Points rewared soon.
    Regards
    Ronn

    REPORT ZSPELL.
    TABLES SPELL.
    DATA : T_SPELL LIKE SPELL OCCURS 0 WITH HEADER LINE.
    DATA : PAMOUNT LIKE SPELL-NUMBER  VALUE '1234510'.
    SY-TITLE = 'SPELLING NUMBER'.
    PERFORM SPELL_AMOUNT USING PAMOUNT 'USD'.
    WRITE: 'NUMBERS', T_SPELL-WORD, 'DECIMALS ', T_SPELL-DECWORD.
    FORM SPELL_AMOUNT USING PWRBTR PWAERS.
      CALL FUNCTION 'SPELL_AMOUNT'
           EXPORTING
                AMOUNT    = PAMOUNT
                CURRENCY  = PWAERS
                FILLER    = SPACE
                LANGUAGE  = 'E'
           IMPORTING
                IN_WORDS  = T_SPELL
           EXCEPTIONS
                NOT_FOUND = 1
                TOO_LARGE = 2
                OTHERS    = 3.
    ENDFORM.                               " SPELL_AMOUNT

  • How can change numeric value to date format? example value 1070131(CYYMMDD)

    in the datatable can i change numeric value to date format . in database date value is like 1070131 (CYYMMDD). I want to see 31/01/07(DD/MM/YY) or 31 Jan 07 . Is it possible?
    Thanks,

    Did you solve your problem?

  • How to change the manual condition type value in change sales order BAPI

    Hi All,
    My scenario here is, i want to either add/change the manual condition type value during change of SO.
    When i'm trying to pass the  order_conditions_in and  order_conditions_inx tables in  'BAPI_SALESORDER_CHANGE'.
    Condition type is coming at item level but the value is setting to zero. Pls. help if anyone has any idea how to handle this.

    Siva,
       I guess you posted in Wrong Thread. You need to post in WAS section.
       check for any BAPI's available in CRM.
    Nagesh Ganisetti.

  • How to change color of text is value is equal to 0

    how to change color of text or background if value is equal to 0

    HI,
    In Template Builder,Insert the conditional region,there you select the column and give condition is equal to 0 and in advanced enter the following code
    <?if:XMLfield=0?><xsl:attribute xdofo:ctx="block" name="background-color">red</xsl:attribute><?end if?>
    try this it works.
    Regards
    Uday

  • How to change row background when the value was changed?

    hello expers!!
    i need your help...plz help me.
    i want my table row(specific) background changes when the user changed the value in a cell. I am able to know that a value in a cell was changed but the problem is i dont know how to change row color background. I've researched over the internet on how to solve this problem but nothing was found.
    please see the link to help you visualize what i mean. tnx!
    [http://www.flickr.com/photos/28686474@N04/2708299927/]
    tnx in advance!! code snippet will be a great help...
    Edited by: kagaw3000 on Jul 27, 2008 8:22 PM

    final JTable table = new JTable(data, columnNames) {
    int lastRowChanged = -1;
    @Override
    public void tableChanged(TableModelEvent e) {
         super.tableChanged(e);
         lastRowChanged = e.getFirstRow();
         repaint();         
    @Override
    public Component prepareRenderer(TableCellRenderer renderer,
                   int rowIndex, int vColIndex) {
    Component c = super.prepareRenderer(renderer, rowIndex, vColIndex);
         if (rowIndex == lastRowChanged) {
              c.setBackground(Color.RED);
         } else { 
              c.setBackground(getBackground());
         return c;        
    ...........this code will changed background color when data was changed BUT if i changed another data in another row the previous backgound color(RED) will be erase. To make it more clearer, it will only change background color of a row only to one row NOT to multiple rows(that is being edited).

  • How to convert analog scalar into digital value

    I have the DAQ connected to a system that sends a digital 0 or 1 through the analog BNC connector. If I use DAQ Express VI, I can convert the dynamic data type into a boolean (rather than scalar) array so it's easy to check if the value is 0 or 1. Because I'm running the VI in real-time, I can't use dynamic-to-boolean array conversion. The output I get is a 1-D waveform array which will give me scalar values. The task has a voltage range of -10 to 10 mV. How can I convert that into a 0 or a 1? Should I set the voltage range to 0-5V and simply have an if statement that checks if the value is, let's say, greater than 2.2V (which will mean it's a binary 1)? Is there a better method?
    Thanks. 

    Hi abdel2,
    It sounds like you are trying to measure digital data from your system. If that is the case, you should be able to connect to a digital input line if your DAQ card had them. Then you can set up a digital acquisition in LabVIEW that will interpret the signal as a boolean input.
    If you are not able to do this, you can approximate the digital behavior by reading analog data, and pragmatically determining a threshold (for example 2.2V), though this is a less efficient way to do it.
    Regards,
    Stephen S.
    National Instruments
    Applications Engineering

  • How to change stored procedure with Table Valued Parameter

    I am not sure how to change the normal stored procedure with Table Value Parameter.Do I have to create a separate Table or do I have to create a datatype. Can you please help me with this
    ALTER PROCEDURE [dbo].[uspInsertorUpdateINF]
    @dp_id char(32),
    @dv_id char(32),
    @em_number char(12),
    @email varchar(50),
    @emergency_relation char(32),
    @option1 char(16),
    @status char(20),
    @em_id char(35),
    @em_title varchar(64),
    @date_hired datetime
    AS
    BEGIN
    SET NOCOUNT ON;
    MERGE [dbo].[em] AS [Targ]
    USING (VALUES (@dp_id, @dv_id , @em_number, @email, @emergency_relation, @option1, @status, @em_id, @em_title, @date_hired))
    AS [Sourc] (dp_id, dv_id, em_number, email, emergency_relation, option1, status, em_id, em_title, date_hired)
    ON [Targ].em_id = [Sourc].em_id
    WHEN MATCHED THEN
    UPDATE
    SET dp_id = [Sourc].dp_id,
    dv_id = [Sourc].dv_id,
    em_number = [Sourc].em_number,
    email = [Sourc].email,
    emergency_relation = [Sourc].emergency_relation,
    option1 = [Sourc].option1,
    status = [Sourc].status,
    em_title = [Sourc].em_title,
    date_hired = [Sourc].date_hired
    WHEN NOT MATCHED BY TARGET THEN
    INSERT (dp_id, dv_id, em_number, email, emergency_relation, option1, status, em_id, em_title,date_hired)
    VALUES ([Sourc].dp_id, [Sourc].dv_id, [Sourc].em_number, [Sourc].email, [Sourc].emergency_relation, [Sourc].option1, [Sourc].status, [Sourc].em_id, [Sourc].em_title, [Sourc].date_hired);
    END;

    It's not clear how you would change the procedure. But assuming that you want to replace the existing scalar parameters with tabular input, this is how you would do it. You first create a table type:
    CREATE TYPE  Insertor_type AS TABLE
        (dp_id                char(32),
         dv_id                char(32),
        em_number            char(12),
        email                varchar(50),
        emergency_relation   char(32),
        option1              char(16),
        status               char(20),
        em_id                char(35),
        em_title             varchar(64),
        date_hired           datetime)
    Then you change the procedure header:
    ALTER PROCEDURE [dbo].[uspInsertorUpdateINF] @tvp Insertor_type READONLY AS
    And finally you change the USING clause:
       USING (SELECT dp_id, dv_id , em_number, email, emergency_relation, option1, status, em_id, em_title, date_hired
              FROM   @tvp) AS [Sourc] ON [Targ].em_id = [Sourc].em_id
    The rest is fine as it is.
    Erland Sommarskog, SQL Server MVP, [email protected]

Maybe you are looking for

  • How do you make editable entries in an Interactive Report?

    I have seen a feature in other Apex applications that I can't reproduce. There is an interactive report in which each row has an Edit icon (pen and pad) and clicking on it leads to a form page which displays the info, so you can edit it. I haven't be

  • Disaster of (almost) Biblical proportions -at least for me- restoring vault

    I had my RAID drive, which contains both my Aperture library and my images, ©®@p out on me this past weekend. My library is almost all referenced to the files on this RAID drive. Some files, like the TIFF that were created by Aperture for me to edit,

  • HT1349 how do I sync my ipod?

    I need someone to give me a simple answer.  Please help 

  • Problem with Custom ABAP Webservice

    Dear All, I have created a webservice on standard BAPI and activated the same. As we dont have Java stack on our development server, we are using Portal J2EE engine to test the webservice. I did the following steps: SOAMANAGER - Business administrati

  • Message PLACEHOLDERS

    Hi Freinds, Im using statement    'MESSAGE I002(ZMSG_PM) WITH 'ABCBMMMMM'. But the message displays the message stored in 002 in message class zmsd_pm andit does not show 'ABCBMMMMM'. I want to display message with the message defined in msg class wi