Message Mapping : conversion of source value 2,520,926.08 to 2,520,926

Hi,
The value coming from Idoc at source side is 6,999,432.08.
I want the value to be passed at target side as 6,999,432
I do not want .08
How i will do the message mapping. Can someone help me out.
Thanks,

Ashish,
I have tested this and all works as you expect.  I have also provided two examples due to confusion as to whether you want the decimal places.  You stated in an earlier post 'I do not want .08, i want .00' but in your last post that 'Source Value be 22345.45 or 22345.78 or 22345.99.........target value should be 22345'
Two decimal places .00
LHS field_in --> floor (arithmetic function) to give you the integer value required (rounded down) --> format number (second arithmetic function and indicate a format of 0.00 to represent two decimal places) --> RHS field_out
Source       Target
22345.45    22345.00 
22345.78    22345.00
22345.99    22345.00
No decimal places (integer)
LHS field_in --> floor (arithmetic function) to give you the integer value required (rounded down) --> RHS field_out
Source       Target
22345.45    22345 
22345.78    22345
22345.99    22345
I hope this clears up your issue
Regards,
Mike

Similar Messages

  • Mapping conversion of source value 4448601.75 to target value 448601

    Mapping conversion of source value 4448601.75 to target value 4448601 or source value 999999.99 to target value 999999
    Here standard functions like round, floor, ceil..etc, will not work because they will convert source value 4448601.75 to 4448602 and source value 999999.99 to 1000000.
    Also i may have blank or white spaces coming in front of the source value from R/3 side like _____999999.99 and i want the value at the target side as _____999999. Here _____ representing blank or white spaces.
    How i will do the mapping, can someone help me out.
    Thanks,
    Ashish
    Edited by: Ashish Soni on Sep 6, 2008 9:53 PM

    >>Here standard functions like round, floor, ceil..etc, will not work because they will convert source value 4448601.75 to 4448602 and source value 999999.99 to 1000000.
    No....! The floor function can be used. It returns the largest integer that is not greater than the passed value. However this will also trim the spaces.
    So u can write a UDF that accept the number and substring till the decimal point and returns it.
    Try this.. It works..
    public String converv(String a,Container container)
    return a.substring(0,a.indexOf('.'));
    Thanks
    SaNv...

  • Message Mapping Conversions

    Hi All,
            This is a question related to the message mapping.
    I am working on a File to Proxy interface which is using a standard graphical mapping provided by SAP. The mapping between the fields are one to one.
    A particular field in the Source structure has possiblility of 5 values (lets say A,B,C,D,E) .
    Post the mapping this values have to be converted to (101,102,103,104,105 Respectively).
    So if the source system sends A, after the mapping the value at the target field should be 101.
    How to achieve this?
    Guidance appreciated....
    KInd rgds,
    Raggy

    Hi,
    It is simple to do.. just use standard function Conversions ---> FixValues table in your message mapping. e.g.
    Double click on FixValues table and maintain the values.
    Key-----Value
    A -
    105
    B----
    110
    C----
    112
    Regards,
    Sarvesh

  • Message Mapping, First and last values in a CSV file

    I'm having problems with a Message Mapping that requires me to take the values from the first line in a CSV and the last line to calculate other values...
    The source message type in my mapping is as follow
    <MT_Message>
        <Header>                  1..1
             <ID>
             <StartDate>
             <EndDate>
       <Records>                 1...unbounded
               <Interval>
               <Number>
    I need to take the first row/occurence of Records and use this to calculate the Startime. I also need to take the last occurence of Records to calculate the stop time
    This is my CSV file content
    H     FORECASTS      20080101     20081231     17568
    D     20080101     1     1     66.29283
    D     20080101     1     2     61.1344
    D     20080101     2     1     61.1344
    In this case I need to take  the values 1     1 for the StartTime and 2    1 for the StopTime.
    How can this be done?

    Damien,
    Do  u have problem with mapping or content conversion. According to my understanding the problem is with content coversion. U can't take the first and last values in CSV file. Probably u can import all the values and during mapping u can seggregate the required structure alone.
    Best regards,
    raj.

  • Message Mapping activation error-Source code has syntax errors in UDF

    Hi all,
    I wrote a small UDF for sum of 2 numbers:
    import
    udf.*
    public String getsum(String a, String b, Container container) throws StreamTransformationException{
    int c = Integer.parseInt(a);
    int d = Integer.parseInt(b);
    int e = packageDemo.getSum(c,d);
    return e+"";}
    In imported archives, i imported pack.jar
    In D:\udf , I have packageDemo.java, packageDemo.class, aii_map_api.jar, pack.jar(has the other 3)
    packageDemo.java :-
    package udf;
    public class packageDemo{   
        public static int getSum(int a,int b)
            int c= a+b;
            return c;
    Did i miss anything?? Icant activate message mapping for 2 errors:-
    1.package udf does not exist
    2.Function getsum, Line 3:
    cannot find symbol symbol : variable packageDemo location: class com.sap.xi.tf._xml_mm_int e = packageDemo.getSum(c,d); ^Note: /usr/sap/P7R/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Mapd4214d3099dc11dd9470001d090e4bbe/source/com/sap/xi/tf/_xml_mm_.java uses or overrides a deprecated API.Note: Recompile with -Xlint:deprecation for details.Note: /usr/sap/P7R/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Mapd4214d3099dc11dd9470001d090e4bbe/source/com/sap/xi/tf/_xml_mm_.java uses unchecked or unsafe operations.Note: Recompile with -Xlint:unchecked for details.2 errors
    Edited by: NagaDurga Nannapaneni on Oct 16, 2008 1:07 PM

    Hi ,
    Think the error is coming because the content in imported archive is not being taken into message mapping at all...so package, class, method ..nothing is identified.
    Can anyone suggest the solution..
    Thanks,
    Durga

  • Message Mapping of Recursive Source Structure?

    Hello,
    a mapping needs to be implemented from a custom source structure to an IDoc. An XSD has been provided for the source structures which contains recursive elements --> an element of a specific type contains another element with the same type.
    If I import the XSD then the type of the recursive element is displayed in "red", but I still can expand it. If I want to use the source structure in the message mapping I cannot expand the recursive elements anymore. Does anyone of you have an idea how to handle this? I want to avoid XSLT if possible.
    Thank you!

    Hi again Florian,
    please have a look at [Structure Overview in Message Mappings on SAP help|http://help.sap.com/saphelp_nwpi71/helpdata/en/e3/92be7c6cd34fd485c967144e302fb6/content.htm]. There is a paragraph on Recursive Structures:
    ...It is possible to map these elements in the mapping editor in a rudimentary fashion by using the context menu to expand a specific number of subnodes and then use them in target-field mappings...
    That works for both source and target message.

  • Message mapping with dynamic node

    Hi,
    I am doing message mapping where my source structure is
    <root>
         <EmpCount>2</EmpCount>
         <Emp>
              <item>
                   <code>1</code>
                   <name>ABC</name>
              </item>
                                     <item>
                   <code>2</code>
                   <name>PQR</name>
              </item>
         </Emp>
    <root>
    If EmpCount is having value 2 then Emp node will have only 2 items
    Target structure is flat structure like (something like fix file format)
    <root>
         <EmpData>EmpDetails</EmpData>      occurrences 0...unbounded
    </root>
    With above sources data following is expected target sturcure…
    <root>
         <EmpData>2ABC</EmpData>
         <EmpData>3PQR</EmpData>
    </root>
    Here my query is how I can create more than one node to target structure with employee details.
    I already tried with following Re: how to create target node a constant number of times
    This help to get all 2 nodes of EmpData in target structure but it is showing only First value in both nodes. Following is output I am getting…
    <root>
         <EmpData>2ABC</EmpData>
         <EmpData>2ABC</EmpData>
    </root>

    Sunil,
    Please see the sample i/p and o/p payload. Also please let me know , is this the same u are looking for
    I/P
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_Check xmlns:ns0="urn:hdmc:samplescenarios">
       <EmpCount>2</EmpCount>
       <Emp>
          <Item>
             <Code>1</Code>
             <Name>A</Name>
          </Item>
          <Item>
             <Code>1</Code>
             <Name>B</Name>
          </Item>
       </Emp>
    </ns0:MT_Check>
    O/P
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_Check_Out xmlns:ns0="urn:hdmc:samplescenarios">
       <Root>
          <EmpData>2A</EmpData>
          <EmpData>2B</EmpData>
       </Root>
    </ns0:MT_Check_Out>
    Best regards,
    raj.

  • Problem in Graphical message mapping

    Hi all,
                I am doing an HR file to file interface.I am struck in message mapping.Actually my source message type contain four structures i.e infotype00 ;infotype01;infotype02;infotype05;every infotype has one PERNNO,BEGDA&ENDDA along with other fields.in target i have to extact employee recors from these 4infotypes.Target structre is :EMPLOYEE
                                     fields...
    Now I had to generate as many employee as many unique PERNNO i.e if all four infotype has same PERNN then it is considered detail of one employee if any infotype has diff.PERNNO then we have to create one more employee record for that infotype.I used a custom functionUNIQUE and get all unique infotype then on the basis i was creating employee.i.e if 3 unique PERNNO then 3 employee record has to be created.It was working fine,But one new requirement came that I have to compare BEGDA of all infotype and if any infotype has BEGDA more than current date then for that PERNNO i dont have to create Employee records.i.e suppose for PERNNO 8 infotype0 has BEGDA more than current date then i dont have to create employeerecord for PERNO 8.This new requirement i am unable to implement.please guide me how to proceed further i.e after getting the unique PERNO.Please do the needful as its very urgent.
    regards,
    Saurabh

    Hey saurabh,
           once you are able to obtain unique PERNNO,
        you need to use two date functions.
    CurrentDate: It will return the system date(todays date).
    CompareDate: It will take as input two values(as dates) and gives output based on their values.
    output of comparedate funtion will be:
    -1 if second value is greater than 1st value.
    0 if second value is equal to the first.
    1 if second value is less than the first value.
    what you can do is take currentdate function as first input for comparedate.
    BEGDA as second input for comparedate.
    if the value is -1(i.e BEGDA is greater than current date SUPPRESS the node or else create the node)
    make sure the format of current date and BEGDA are same.

  • Message Mapping Logical Problem

    Hi there I have an issue with my message mapping. My source structure looks like this.
    IDOC
    -Seg1
    ---Element1
    ---Element2
    ---Seg2
    ElementA
    ElementB
    Ok so I have to map the IDOC to a flat file. Seg 1 is the Header and Seg2 is the Details. For each flat file there will only be 1 Seg1 but there can be X amount of Seg2s' in the flat file. My problem is mapping Element 1 to Element A. Element A has the value of Element 1 and 2 combined. It appears I cannot map a lower hierarchy to an higher hierarchy? I tried changing the context but with no luck.
    Any idea?
    Thanx,
    Jan

    My problem is mapping Element 1 to Element A.
    What do you mean by this? I guess you want the Element1 to appear with each Segment occurrence. If yes, you may use standard function useOneAsMany as shown.
    /people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii
    Regards,
    Prateek

  • Message Mapping for multiple item levels

    Hi,
    My query is regarding message mapping
    Example of source data structure & Target data structure
    Source data Structure
    <item>
          --<no>1</no>
          --<address/>
          --<ITEMS>
            ----<item>
              ------<Name>a</Name>
            ----<item>
              ------<Name>b</Name>
    <item>
          --<no>2</no>
          --<address/>
          --<ITEMS>
            ----<item>
              ------<Name>c</Name>
            ----<item>
              ------<Name>d</Name>
    Expected  Target data structure
    <Item>
      -- <no>1</no>
      -- <name>a</name>
    <Item>
      -- <no>1</no>
      -- <name>b</name>
    <Item>
      -- <no>2</no>
      -- <name>c</name>
    <Item>
      -- <no>2</no>
      -- <name>d</name>
    How I can map the '<no>' field to target '<no>' field to repeat value until to second sub item level occurance complete ?
    Thank you
    Sateesh

    Hi Sateesh,
    Please see the solution below.
    The are 2 contect changes you need to do on field level. Right click and go to context and select your context you need.
    Context on ITEMS - Should be on Root Structure(In my mapping it is MT_Multiple_Item_Level_Source)
    Context on Name - Should be on Item (The first Item Tag)
    Good Luck.
    Regards,
    Jannus Botha

  • Run Time Message Mapping error

    Hello Experts,
    I am working on JDBC to IDOC scenario. I am getting mapping error at SXMB_MONI and the error message is as below:
    com.sap.aii.mappingtool.tf7.IllegalInstanceException: Cannot create target element /ZABCD01. Values missing in queue context. Target XSD requires a value for this element, but the target-field mapping does not create one. Check whether the XML instance is valid for the source XSD, and whether the target-field mapping fulfils the requirement of the target XSD at  and so on.....
    I tested in Message Mapping by entering the values and I am able to see the target structure with out any Mapping errors..
    But when JDBC real time it got Runtime mapping error as above:
    Source
    tablename.Set -
    1.1
    row--
    0.Unbound
    a----
    0.1
    b----
    0.1
    Target
    ZABCD01-----1.1
    IDOC--
    1.1
    -Begin-----Required
    XYZ--
    0.1
    a----
    0.1
    b----
    0.1
    Dont know where is the problem is: I tried with payload its giving the same error as runtime....
    Payload looks as :
    <?xml version="1.0" encoding="utf-8" ?>
    - <set>
    - <row>
      <a>value</a>
      <b>value</b>
    </row>
    </set>
    Can any one faced same issue?
    Thanks
    Rajeev

    HI Satish,
    I created a new Datatype and tested wtih payload still the same..I am unable to create target node as IDOC segment is 0..unbound and below all fields are not not creating stilll they are mapped to source fileds.. what would be the reason?
    IDOC structure is:
    ZIDOC........................1....1
    ...IDOC........................1....1
    .....BEGIN.....................Requied (I disabled this filed)
    .....SEGMENT1.............1....1
    .....SEGMENT2..............0...1
    .........SUBSEGMENT1...0...99
    ..............FIELD1.............0....1
    ..............FIELD2..............0...1
    ..............FIELD3..............0...1
    ..........SUBSEGMENT2....0...1
    ..............FIELD4..............0...1
    ..............FIELD5..............0...1
    JDBC strucute is
    MT_XYZ
    ....set.................1...1
    .....row...............0...unbound
    ......field1............0...1
    ......field2............0...1
    ......field3............0...1
    ......field4............0...1
    I am not mapping all fields to respective fileds of source to target ...if I dont map ZIDOC and IDOC then mapping executing successful but I am not getting SUBSEGMENT1 and SUBSEGMENT2 with there fields values..
    If I do test by entering values manually it populate all fields values with subsegments but when i copy the payload from SXMB_MONI then I am getting error and If I remove target node mappings I am unable to get subsegment and fileds populated..
    How can I make FIELDS of IDOC to get populated??
    Thanks
    Rajeev
    Edited by: rajeev raj on Aug 25, 2009 9:26 PM

  • Creation of CDATA with message mapping

    Hello all,
    Is everyone absolutely sure that a cdata string cannot be created in the middle of an xml file using message mapping? 
    I have tried doing the XSL map in other blogs I even tried writing a whole XSL map in xml spy - yet xi complains about not finding this class file and that class file.  I'm having a hard time believing that this is so hard to do in XI - especially when Microsoft web service implementation seem to long for data crammed into a string ( in my experience ).
    Any help is GREATLY appreciated.
    Thank you!!!
    Scott

    Hi Scott,
             Pls follow the following steps to insert XML string into a single element:
    Create a xsl file with the following data:
    <?xml version='1.0' ?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" <i><b>NSpace</b></i>>
    <xsl:template match="/">
    <namespace:name1>
    <xsl:text disable-output-escaping="yes"><![CDATA[<![CDATA[]]></xsl:text><xsl:copy-of select="<b>//namespace:name</b>"/><xsl:text disable-output-escaping="yes"><![CDATA[]]]]></xsl:text><xsl:text disable-output-escaping="yes"><![CDATA[>]]></xsl:text>
    </namespace:name1>
    </xsl:template>
    </xsl:stylesheet>
    In the above code I have removed xmlns:p2="http://frik.bcc.com.pl" which is not needed.
    Also you have to put '<b>//</b>' before the target element from where you want to start creating XML string over here it is <b>name</b>. And <b>name1</b> is the element you want to store the XML string in.
    So anything in the element <b>name</b> will be stored in <b>name1</b>
    Regarding the <b>namespace:</b> To find out the namespace test your message mapping between the source and the target without adding XSLT mapping. After testing click on <b>'SCR'</b> tab present on top of the target window. There you will see <b>ns1: or ns2:</b> attached to each element. Replace <b>namespace</b> in the above code with <b>ns1: or ns2:</b>.  And replace <b>NSpace</b> in the above XSL Header with the namespace in the SCR of test map.
    So the final XSL file will look like that:
    <?xml version='1.0' ?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" <i><b>xmlns:ns1="http://sap.com/xi/HR"</b></i>>
    <xsl:template match="/">
    <<b>ns1:</b>name1>
    <xsl:text disable-output-escaping="yes"><![CDATA[<![CDATA[]]></xsl:text><xsl:copy-of select="<b>//ns1:name</b>"/><xsl:text disable-output-escaping="yes"><![CDATA[]]]]></xsl:text><xsl:text disable-output-escaping="yes"><![CDATA[>]]></xsl:text>
    </<b>ns1:</b>name1>
    </xsl:template>
    </xsl:stylesheet>
    Dont forget to put '//' before the target element.
    This should work. Or pls put the source and target xml struct and we will assist you further.
    Regards,
    Ashish

  • RuntimeException in Message-Mapping transformation

    Hi all,
              I am doing a soap2rfc scenario in that i have 2 message mappings are there
        there are SUM1_MM  and SUM2_MM
    Message mapping test(SUM1_MM)
    Source test
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:SUMOUT_MT xmlns:ns0="urn://web2rfcsum">
       <NUM1>12</NUM1>
       <NUM2>13</NUM2>
    </ns0:SUMOUT_MT>
    target result
    <?xml version="1.0" encoding="UTF-8"?>
    <ns1:ZSUM2NUMBERS xmlns:ns1="urn:sap-com:document:sap:rfc:functions"><NUM1>12</NUM1><NUM2>13</NUM2></ns1:ZSUM2NUMBERS>
    But i have seen an error  in sxmb_moni
    <SAP:Category>Application</SAP:Category>
      <SAP:Code area="MAPPING">EXCEPTION_DURING_EXECUTE</SAP:Code>
      <SAP:P1>com/sap/xi/tf/_SUM1_MM_</SAP:P1>
      <SAP:P2>com.sap.aii.utilxi.misc.api.BaseRuntimeException</SAP:P2>
      <SAP:P3>RuntimeException in Message-Mapping transformatio~</SAP:P3>
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>During the application mapping com/sap/xi/tf/_SUM1_MM_ a com.sap.aii.utilxi.misc.api.BaseRuntimeException was thrown: RuntimeException in Message-Mapping transformatio~</SAP:Stack>
    Please solve the problem your help is memorable

    Hi Deviprasad,
    It looks like a mapping error, test your mapping in IR with the payload from SXMB_MONI. You can refer michal's weblog on <a href="/people/michal.krawczyk2/blog/2005/09/16/xi-how-to-test-your-mapping-in-real-life-scenarios to test your mapping (in real life scenarios)</a>
    In other words you copy the XML message from monitoring and exectute the mapping in Integration Builder with maximal trace to get the reason.
    Regards,
    Abhy

  • RFC lookUp during Message mapping

    All
       I want to get soem values from SAP table during message mapping.After getting the values am going  to do 2:1 mapping by using BPM.
      Could you please let me know the basic and fundamental things about RFC look up during mapping and RFC settings in XI as well in R3?
    Please explain

    Hi Rajesh,
    Pl post this in XI Forums to get quick replies.
    Regards
    Ayyapparaj

  • Message Mapping - Turn Off dtd validation

    Hi,
    I would like to know how to turn off dtd validation in a message map.
    The source message type is based on dtd. When testing, I get the following error
    java.io.IOException: Failed to load resource from the context classloader of the current thread! Loading from classloader was caused by: java.io.FileNotFoundException: D:\usr\sap\XYZ\DVEBMGS01\j2ee\cluster\server0\abc.dtd (The system cannot find the file specified)
    I understand that the map requires the dtd to be present in the application folder. But, can I change some setting not to look up this file.
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE MessageContainer SYSTEM "abc.dtd">

    Sorry Arvind. Not able to understand your question.
    The problem we are facing is, when the input xml file contains DocType declaration with reference to a dtd, we get an error stating the dtd is not found in the j2ee application folder.
    It works fine if the dtd is saved in the location. Also, it works fine if the DocType declaration is removed from the xml file. However, we are exploring an option where declaration is used but dtd is not available.
    Is there any way to achieve this?
    Thanks!

Maybe you are looking for

  • Lost all Apple App's in Upgrade from G5 Dual 2.5GHz to the G5 Quad

    I just got the new G5 Quad and did the Firewire rehost of all my data. Interstingly enough, all my app's like Reason, PhotoShop, Premier, Poser, Bryce, Maya, even MS Office and ZBrush moved right over with their respective serial numbers however Shak

  • X3-02 problem

    Had nothing but praise for my X3-02 for the 3 months ive had it.... Until today. having lunch i turned my phone off as i always do, turned it back on after lunch to find it wasnt accessing the phone memory and therefore the favourites bar, contacts,

  • How to compare content of two text file using StreamTokenizer

    hi.... i have two text files...containg field like(name,number,scheme) and(number,date,value)... i want to create a third file containg field like (name,number,date,scheme,value) by using these two table. how to create

  • Font Problems: Installed fonts are showing as un-installed in CS6 and are not avaliable to use.

    Hi, Installed fonts in the Windows folder(which have been installed for agaes), are now not showing up in Illustrator CS6 since we have installed the suite. The font name shows in the box, but it has an astericks next to it. It is getting annoying no

  • Powerpoint Slideshow Resolution on Retina Display

    I have a 13" Macbook Pro with retina display, and I'm using Office 2011. When I edit my slides I get the full retina experience, but when I enter slideshow mode (with no external monitor or projector connected) I get poor resolution and blurry/aliase