How to get values after decimal point

Hi,
source value is 12345.678 i wana the target side in 12345  in field and 678 in one field.
the source value its not fixed  before decimal point value pass to one field and after decimal point value pass to other field
please help to me how to do this one.

Hi Swathip,
You dont need to create 2 UDFs. You just need to create 1 simple UDF which takes one string array as input as usual and it has 2 Resultlist outputs. You need to map this 2 outputs from the UDF to the respective 2 target side fields where the values are to be mapped, one containing the portion before the decimal, and one after the decimal.
I HAVE TESTED THE UDF AND IT WORKS ABSOLUTELY FINE.
THE CODE FOR THE UDF IS AS FOLLOWS:
public void sepDec(String[] num,ResultList wholeNum,ResultList afterDec,Container c)
  String part1=null;  // Stores the part before the decimal point
  String part2=null;  //Stores the part after the decimal point
                        if(num[0]!=null && num[0]!=""){
               int index = num[0].indexOf(".");
               part1 = num[0].substring(0,index);
               part2=num[0].substring(index+1, num[0].length());
                     wholeNum.addValue(part1);
               afterDec.addValue(part2);
THIS UDF IS A CLASSIC EXAMPLE WHERE AN UDF HAS 2 OUTPUTS, WHICH IS VERY RARELY SEEN BUT VERY MUCH CORRECT
PLEASE LET ME KNOW IF THIS CODE WAS HELPFUL TO YOU
CHEERS,
BISWAJIT
Edited by: 007biswa on Feb 8, 2011 5:02 PM

Similar Messages

  • How to remove zero after decimal point.

    hi friends
    how to remove the zero after decimal points.
    example :
    123.450 -- if print only 123.45
    45.600  - 45.6
    any body help me.
    thanks
    pauldhama

    go through this example
    it may help u
    DATA: T(14) VALUE ' abcdefghij',
    STRING LIKE T,
    STR(6) VALUE 'ghijkl'.
    STRING = T.
    WRITE STRING.
    SHIFT STRING LEFT DELETING LEADING SPACE (or use 0 to detete 0).
    WRITE / STRING.
    STRING = T.
    SHIFT STRING RIGHT DELETING TRAILING STR or 0.
    WRITE / STRING.
    Output:
        abcdefghij
    abcdefghij
            abcdef

  • No Value after decimal points

    Hi Gurus,
    Our client does not the condition values in decimal points in pricing.
    They want it to be scaled up always to next round figure.
    Eg. 12.25 should be converted to 13.00
    Please suggest.
    Thanks,
    Raheel

    Dear Raheel
    For the net value field, you need to give Routine 16 in the Alt. Cal. Type in the pricing procedure and also add Routine 17 to Netvalue in your Pricing Procedure. Additionally, in table T001R such rounding data should be maintained. For this goto SPRO - SAP NetWeaver - General Settings - Currencies - Define rounding rules for currencies here maintain: Company Code + Currency = 100
    thanks
    G. Lakshmipathi

  • Urgent :How to get values after parsing

    Hi ..
    I am using SAX parser for parsing a xml document.
    After parsing i want to get the valuse to make a jsp page. how do i get the Values after parsing.
    the code i am working on is:
    import java.util.*;
    import java.lang.*;
    import java.io.*;
    import java.io.IOException;
    import org.apache.xerces.parsers.SAXParser;
    import org.xml.sax.Attributes;
    import org.xml.sax.ContentHandler;
    import org.xml.sax.ErrorHandler;
    import org.xml.sax.Locator;
    import org.xml.sax.SAXException;
    import org.xml.sax.SAXParseException;
    import org.xml.sax.XMLReader;
    import org.xml.sax.helpers.XMLReaderFactory;
    public class performDemo
    public static void main(String args[]) throws Exception
         performDemo p =new performDemo();
         p.performDemo(args[0]);
    public void performDemo(String uri)
    System.out.println("Parsing XML File: " + uri + "\n\n");
    try {
    XMLReader parser = new SAXParser();
    ContentHandler contentHandler = new MyContentHandler();
    parser.setContentHandler(contentHandler);
    parser.parse(uri);
    } //try ends here
    catch (IOException e)
    System.out.println("Error reading URI: " + e.getMessage());
         } //catch ends here
    catch (SAXException e)
    System.out.println("Error in parsing: " + e.getMessage());
    } //catch ends here
    } //function ends here
    class MyContentHandler implements ContentHandler {
    private Locator locator;
    public void setDocumentLocator(Locator locator) {
    System.out.println(" * setDocumentLocator() called");
    this.locator = locator;
    public void startDocument() throws SAXException {
    System.out.println("Parsing begins...");
    public void endDocument() throws SAXException {
    System.out.println("...Parsing ends.");
    public void processingInstruction(String target, String data)
    throws SAXException {
    System.out.println("PI: Target:" + target + " and Data:" + data);
    public void startPrefixMapping(String prefix, String uri) {
    System.out.println("Mapping starts for prefix " + prefix +
    " mapped to URI " + uri);
    public void endPrefixMapping(String prefix) {
    System.out.println("Mapping ends for prefix " + prefix);
    public void startElement(String namespaceURI, String localName,
    String rawName, Attributes atts)
    throws SAXException {
    System.out.print("startElement: " + localName);
    if (!namespaceURI.equals("")) {
    System.out.println(" in namespace " + namespaceURI +
    " (" + rawName + ")");
    } else {
    System.out.println(" has no associated namespace");
    for (int i=0; i<atts.getLength(); i++)
    System.out.println(" Attribute: " + atts.getLocalName(i) +
    "=" + atts.getValue(i));
    public void endElement(String namespaceURI, String localName,
    String rawName)
    throws SAXException {
    System.out.println("endElement: " + localName + "\n");
    public void characters(char[] ch, int start, int end)
    throws SAXException {
    String s = new String(ch, start, end);
    System.out.println("characters: " + s);
    public void ignorableWhitespace(char[] ch, int start, int end)
    throws SAXException {
    String s = new String(ch, start, end);
    System.out.println("ignorableWhitespace: [" + s + "]");
    public void skippedEntity(String name) throws SAXException {
    System.out.println("Skipping entity " + name);
    PLese suggests.

    Dear Gaurav
    Please consider the blow JSP CODE:
    <%@ page import="sax.*,java.io.*,java.util.*,java.lang.*,java.text.*;" autoFlush="true" session="true" buffer="8kb"%>
    <HTML>
    <HEAD>
    <TITLE> SAX PARSER BEAN</TITLE>
    </HEAD>
    <BODY>
    <jsp:useBean id="p" class="sax.performDemo" scope="page"/>
    <%
    String file = request.getParameter("loc");
    String xpath = request.getParameter("xpath");
    %>
    <br> In <%=file%> and for <%=xpath%> is <br> <%=p.performDemo(file,xpath)%>
    <br><br>Node Names: <%=p.getNodes()%>
    <br><br>AttNames: <%=p.getAttNames()%>
    <br><br>AttValues: <%=p.getAttValues()%>
    <br><br><%=p.clearAll()%>
    </BODY>
    </HTML>
    THIS IS CORRESPONDING SAX BEAN TO THE ABOVE JSP CODE
    I am using "sax" package. PLease make changes accordingly.
    package sax;
    import java.util.*;
    import java.lang.*;
    import java.io.*;
    import java.io.IOException;
    import org.apache.xerces.parsers.SAXParser;
    import org.xml.sax.Attributes;
    import org.xml.sax.ContentHandler;
    import org.xml.sax.ErrorHandler;
    import org.xml.sax.Locator;
    import org.xml.sax.SAXException;
    import org.xml.sax.SAXParseException;
    import org.xml.sax.XMLReader;
    import org.xml.sax.helpers.XMLReaderFactory;
    public class performDemo
    public static ArrayList NodeNames = new ArrayList();
    public static ArrayList attNames = new ArrayList();
    public static ArrayList attValues = new ArrayList();
    public static String QueryString="",QString1="", QString2="",start="",end="";
    public static boolean start_collecting=false;
    public static void main(String args[]) throws Exception
    performDemo p =new performDemo();
    System.out.println("\nResult: "+p.performDemo(args[0],args[1]));
    System.out.println("\nNodes "+p.getNodes());
    System.out.println("\nAttNames "+p.getAttNames());
    System.out.println("\nAttValues "+p.getAttValues());
    public String performDemo(String uri,String xpath)
    //System.out.println("Parsing XML File: " + uri + "\n\n");
    QueryString=xpath;
    StringTokenizer QueryString_ST = new StringTokenizer(QueryString,"/");
    if(QueryString_ST!=null)
         int stLen = QueryString_ST.countTokens();
         while(QueryString_ST.hasMoreTokens())
              if((QueryString_ST.countTokens())>1)
              QString1 = QueryString_ST.nextToken();
    else if((QueryString_ST.countTokens())>0)
                   QString2 = QueryString_ST.nextToken();
    try
    XMLReader parser = new SAXParser();
    ContentHandler contentHandler = new MyContentHandler();
    parser.setContentHandler(contentHandler);
    parser.parse(uri);
    return("Given File Parsed Successfully!");
    } //try ends here
    catch (IOException e)
    //System.out.println("Error reading URI: " + e.getMessage());
    return("IO Exception Occured!! \n \n Check the file name and path");
    } //catch ends here
    catch (SAXException e)
    //System.out.println("Error in parsing: " + e.getMessage());
    return("SAX Exception Occured!!! \n \n Check the xpath ");
    } //catch ends here
    } //function ends here
    public ArrayList getNodes()
    return NodeNames;
    public ArrayList getAttNames()
    return attNames;
    public ArrayList getAttValues()
    return attValues;
    public String clearAll()
    NodeNames.clear();
    attNames.clear();
    attValues.clear();
    return("Cleared!!");
    class MyContentHandler extends performDemo implements ContentHandler {
    private Locator locator;
    public void setDocumentLocator(Locator locator) {
    //System.out.println(" * setDocumentLocator() called");
    this.locator = locator;
    public void startDocument() throws SAXException {
    //System.out.println("Parsing begins...");
    public void endDocument() throws SAXException {
    //System.out.println("...Parsing ends.");
    public void processingInstruction(String target, String data)
    throws SAXException {
    //System.out.println("PI: Target:" + target + " and Data:" + data);
    public void startPrefixMapping(String prefix, String uri) {
    //System.out.println("Mapping starts for prefix " + prefix + " mapped to URI " + uri);
    public void endPrefixMapping(String prefix) {
    //System.out.println("Mapping ends for prefix " + prefix);
    public void startElement(String namespaceURI, String localName,String rawName, Attributes atts)throws SAXException
    start=localName;
    if(start.equals(QString2))
    start_collecting=true; //start collecting nodes
                   if(start_collecting)
    if((atts.getLength())>1)
                   NodeNames.add(localName);
                   for(int i=0;i<=(atts.getLength()-1);i++)
              attNames.add((String)atts.getLocalName(i));
              attValues.add((String)atts.getValue(i));
    //System.out.print("startElement: " + localName);
    //if (!namespaceURI.equals("")) {
    ////System.out.println(" in namespace " + namespaceURI + " (" + rawName + ")");
    //} else {
    //System.out.println(" has no associated namespace");
    //for (int i=0; i<atts.getLength(); i++)
    //System.out.println(" Attribute: " + atts.getLocalName(i) +"=" + atts.getValue(i));
    public void endElement(String namespaceURI, String localName,String rawName) throws SAXException
         end=localName;
         if(end.equals(QString2))
              start_collecting=false;
    //System.out.println("endElement: " + localName + "\n");
    public void characters(char[] ch, int start, int end)
    throws SAXException {
    String s = new String(ch, start, end);
    //System.out.println("characters: " + s);
    public void ignorableWhitespace(char[] ch, int start, int end)
    throws SAXException {
    String s = new String(ch, start, end);
    //System.out.println("ignorableWhitespace: [" + s + "]");
    public void skippedEntity(String name) throws SAXException
    //System.out.println("Skipping entity " + name);
    Cheers....!!
    Newton
    Bangalore, INDIA

  • How to enforce position after decimal point

    Hi,
    i need to enforce a position after the decimal point in an SAPScript Form.
    The Form is MEDRUCK_RV and the field ist RM06P-PRMG1.
    I tried to enforce it with RM06P-PRMG1(Z9.1) but it doesn't work.
    I need to cut the left-hand zeros and display one position after the decimal point.
    Can someone help?

    Hi,
    Try this.
    DATA : DFORMAT TYPE XUDCPFM,
           L TYPE I.
    SHIFT RM06P-PRMG1 LEFT  DELETING LEADING  '0'.
    SELECT SINGLE DCPFM FROM USR01
    INTO DFORMAT WHERE BNAME = SY-UNAME.
    IF SY-SUBRC EQ 0.
    IF DFORMAT EQ 'X'.
    SEARCH RM06P-PRMG1 FOR '...'.
    ELSE.
    SEARCH RM06P-PRMG1 FOR ','.
    ENDIF.
    ENDIF.
    IF SY-FDPOS NE 0.
    L = SY-FDPOS + 2.
    RM06P-PRMG1 = RM06P-PRMG1+0(L).
    ENDIF.
    Thank You,
    Saritha

  • How to get only two digits after decimal point of an expression

    i am doing simple multiplication between two float numbers.
    both the numbers have two digits after decimal point.
    so naturally the result will have 4 digits after decimal point.
    i want to get only two digits after decimal point.
    help me please...

    If you just want to limit the displayed decimal places, you can do the following...
    import java.text.*;
    public class Formatting {
        public static void main(String[] args) {
            NumberFormat format = NumberFormat.getNumberInstance();
            format.setMaximumFractionDigits(2); //what you seem to want
            format.setMinimumFractionDigits(2); //if you always want at least 2 digits displayed
            System.out.println(format.format(12.345));
            System.out.println(format.format(12.0));

  • How to get value of URL parameter

    Hi,
    If an ABAP Web Dynpro URL looks like this: http://<server>:<port>/sap/bc/webdynpro/sap/zny_test1?sap-client=100&sap-language=EN, how to get value of the URL parameter “sap-client” at runtime in the application?
    Thanks,
    Nancy

    The framework currently strips all the framework specific params.
    Perhaps the will be made available in a future release.  Thomas, any comments ?
    However, I dont understand the requriement to know the sap-client URL value.
    If your code is running, a user has successfully connected to system a therefore he has a session open and this session is associated with exactly 1 client at any point in time.
    See SYSTEM VARAIBLE   SY-MANDT.
    this represents the client in which the users session is running and negates the need to see
    sap-client URL value.
    regards
    Phil.

  • Process order confirm_Goods movement_Qty consum. after decimal point not al

    Sir,
    I am doing process order confirmation (COR6), In which go to "Goods Movement "....and consume actual consumption qty...but when i put figure after decimal point, system does not allow...e.g  3.524 KG...System rounded figure which i put in BOM...e.g in bom 3.524 KG, but when i confirm (COR6) the order shows 4 KG....
    Pl. help how to put decimal point...
    Pl. not that in BOM , system allows to put decimal point qty, but in confirmation it does not allow...
    Error message comes :
    Only 0 decimal places are permitted for unit of measure KG
    Message no. RU303
    Rajesh

    Sir,
    We check in CUNI,
    But in BOM, Decimal Point is allowed, but when we confirm the process order decimal place is not allowing...
    If seems that is it any setting in process order ?...Because if any error in CUNI then it does not allow at BOM creation level also....
    Rajesh Mehta

  • How to get value from list item

    Hi all,
    How to get value from list item?
    I have a problem with the List Item object
    in the Oracle forms.
    How can I retrieve the selected item from
    a list ?
    I didn't find any function like 'list.GET_
    SELECTED_ITEM()'...
    thanks
    Bala

    Hello,
    You get the value as for any other Forms item:
    :value := :block.list_tem ;Francois

  • How to get values/data stored in the database into a list-item.

    how to get values/data stored in the database into a list-item.
    i tried to make a list item without any values assigned to it...but i got the below error.
    FRM-30191: No list items defined for required poplist.
    or
    FRM-32082: Invalid value for given item type.
    List EMPNO
    Item: EMPNO
    Block: EMP
    Form: MODULE5
    FRM-30085: Unable to adjust form for output.
    then according to some docs, i tried the the following for the trigger
    when-new-form-instance
    declare
         rg_name varchar2(40) := 'emp_rec';
         status number;
         groupid recordgroup;
         it_id item;
    begin
         it_id := Find_Item('empno');
         groupid := create_group_from_query(rg_name, 'select empno from emp');
         status := populate_group(groupid);
         populate_list(it_id, groupid);
    end;
    but yet didnt work... :(
    so how the heck do i get values fetched from the database table into the list item?

    for list items you need to values in the record group, one is the shown value and one is the returned value.
    Check out the online help for the populate_list built-in.
    You'll need something like select ename,ename from emp as the record group query.

  • How to get value in showModalDialog()

    Hi,
    I would like to know how to get value pass into showModalDialog() to be used by the server (using request.getParameter())
    TQ

    please try out this kind of code
    <script language="javascript">
         function trial(){
              var retVal = new Object();
              retVal = ShowModalDialog("ur JSp");
    </script>
    <script>
    <form >
    <input type="hidden" name ="mylink "value= javascript:trial();>
    </form>
    <%
         String str=request.getParameter("mylink");
    %>
    and plz let me know .. if it works

  • How to get value in a web page automatically  and sava output in database

    how to get value this table output is
    row 1, cell 1
    row 1, cell 2
    row 2, cell 1
    row 2, cell 2
    <table border="1">
    <tr>
    <td>row 1, cell 1</td>
    <td>row 1, cell 2</td>
    </tr>
    <tr>
    <td>row 2, cell 1</td>
    <td>row 2, cell 2</td>
    </tr>
    </table>

    Note: This thread was originally posted in the [Java Technologies for Web Services|http://forums.sun.com/forum.jspa?forumID=331] forum, but moved to this forum for closer topic alignment.

  • How to get value in function insert table test ?

    Hi
    I use function insert table test in order to get value in table for use in code page but i don't know how to get value in table.If somebody have any idea.Please give me some advice.
    Thank you,
    Waruja

    You will need to grab the contents with VBA
    Table test is user interface only.
    This thread may help
    http://qazone.empirix.com/thread.jspa?threadID=748&tstart=0

  • How to get ProcessInstanceId after Workflow KickOff. Am able to get the InvocationId

    How to get ProcessInstanceId after Workflow KickOff. Am able to get the InvocationId.
    This is the Snippet :
    InvocationResponse response = myServiceClient.invoke(request);
    invocationId = response.getInvocationId();
    System.out.println("ClientParams="+response.getClientParameters());
    System.out.println("OutputParams="+response.getOutputParameters());
    System.out.println("invocationId="+invocationId);
    JobManager jobManager = new JobManager(myFactory);
    JobStatus jobStatus = null;
    JobId myJobId = new JobId(invocationId);
    jobStatus = jobManager.getStatus(myJobId);
    System.out.println("Job Status: " + jobStatus.getStatusCode());
    if (jobStatus.getStatusCode()==JobStatus.JOB_STATUS_COMPLETED)
    System.out.println("INVOCATION COMPLETED SUCCESSFULLY!");
    InvocationResponse jobResponse = jobManager.getResponse(myJobId);
    jobManager.terminateJob(myJobId);
    jobResponse.getInvocationId();
    Process id need to be fetched after Workflow Kickoff
    Can anyone please help me..?

    There are 5 process level variables that get populated when you invoke a process. They are
    /process_data/create_time
    /process_data/creator_id
    /process_data/id
    /process_data/status
    /process_data/update_time
    Within the xPath builder you can differentiate them from other process variable because they are italicized.
    Now you can create your own process variable - let's say called pid - and have it contain the process id which is stored in /process_data/id.
    The xPath would look something like
    /process_data/@pid = /process_data/@id
    If the pid variable is marked as an 'output' variable, then it will be returned as part of the InvocationResponse.
    Jasmin

  • How to get value of html combo box (i.e select) in jsp?

    Hello,
    I was just wondering how to get value of html combo box in jsp page. My code for combo box is:
    <select name="combo" size="1">
    <%
    List<Project> projects = mgr.getProjects();
    for(Project project : projects){
    %>
    <option value="<%= project.getId()%>"><%= project.getName()%></option>
    <%
    %>
    </select>
    I thought combo.value might give me the value, but it throws exception.
    Any help is appreciated.
    Thanks.

    The combo does not exists in Java, but only in HTML. You have to submit the form containing the combo and then use request.getParameter("combo") to get it's value ;-)

Maybe you are looking for