Using standard node functions

Hi all, i am newbie
i want to knwo how can i convert following source message to target message
using standard node functions?
Source Message
<devices>
    <device>
        <sn>123</sn>
        <city>Berlin</city>
    </device>
    <device>
        <sn>345</sn>
        <city>Berlin</city>
    </device>
    <device>
        <sn>777</sn>
        <city>Bonn</city>
    </device>
</devices
Target Message
<cities>
    <city>
        <name>Berlin</name>
        <devices>
            <sn>123</sn>
            <sn>345</sn>
        </devices>
    </city>
    <city>
        <name>Bonn</name>
        <devices>
            <sn>777</sn>
        </devices>
    </city>
</cities>

Hi,
Since you are newbie i would suggest follow the stefan's blog. use formatbyexample for your requirement.
New functions in the Graphical Mapping Tool XI ... | SCN
Please read the comments also you will get more idea
Regards,
Muniyappan.

Similar Messages

  • How to use standard java functions in a XSLT mapping

    Hi All,
    I wish to use a standard java function in a XSLT mapping, The issue is either i am giving incorrect namespace which is used to invoke the function or the signature of the function call is incorrect, I have read all the links in http://help.sap.com, and i know <b> one can enhance a XSLT mapping by writing one's own java code and thereby using java standard functions </b>, but the requirement is such that i need to try and use java standard function in XSLT mapping itself.
    Please refer to the sample code below:
    <?xml version="1.0" encoding="UTF-8"?>
      <xsl:stylesheet version="1.0"  
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:javamap="java:java.lang.String">
    <xsl:output method="text"/>
    <xsl:template match="/">
    <xsl:variable name="input" select="Title">
    <xsl:if test="function-available('javamap:toUpperCase')">
    <xsl:value-of select="javamap:toUpperCase($input)"/>
    </xsl:if>
    Author:<xsl:value-of select="Author"/>
    </xsl:template>
    </xsl:stylesheet>
    error encountered is: Illegal number or type of arguments.
    please reply if you have tried a similar scenario in SAP XI.
    Thanks & Regards,
    Varun

    Hi Varun,
        First of all i want to tell you that as per the documentation you can only call the static function inside xslt mapping. Your toUpperCase method is a non static function.
    What i am getting is that you have an element called Author and you want to convert its value into uppercase.
    you can write your own user defined function which is static.
    Signature of your java method :
    public static string toUpperCase(String Author,Map inputparam)
    try this xslt map.
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="2.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:javamap="java:JavaProgram">
         <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
         <xsl:param name="Author">
                 <xsl:value-of select="//Author_name"/>
         </xsl:param>
         <xsl:param name="inputparam" />
         <xsl:template match="/">
         <Author>
                 <xsl:if test="function-available('javamap:toUpperCase')">
                  <xsl:value-of select="javamap:toUpperCase($Author,$inputparam)"/>
                 </xsl:if>
         </Author>
         </xsl:template>
    </xsl:stylesheet>
    Hope this will work.
    Thanks and Regards
    Vishal Kumar

  • Mapping issues while using MapwithDefault Node function for Idoc

    Hi Experts,
    We are facing issues while trying to generate nodes at reciver side even though it does not exist at sender side.
    we are using the matmas05 and we want the nodes E1marcm and e1mardm to generated at target structure.
    the structure is like this
    Matmas05
    idoc
    E1maram
    segment
          E1marcm
            segment
              msgfn
              .....other fields
              E1mardm (can be many segments)
                segment 
                  lgort
                  ..other fields
              E1mpgdm
                 segment
                 ...e1mpgdm fields
    the mapping has been done like:
    e1marcm -mapwithdefault-e1marcm
    constant -segment
    werks-mapwithdefault-werks
    other fields(one to one mapping)
    e1mardm-mapwith default-e1mardm
    lgort-mapwithdefault(value 1000)-lgort
    other fields -one to one mapping
    now the problem we are facing is when e1mardm is not existing in source structure the values from the other node of e1mardm(which exists) are getting overwritten into it.
    we want only the lgort to be 1000 and the segment should populate at target side.
    like
    e1mardm
    segment
    lgort value 1000
    Could you please assist in solving this issue and give your valuable suggestions as how could we handle it.
    Thanks and regards,
    jyoti

    U will achieve this using UDF function. Map the below Like.
    e1mardm-mapwith default(Value Constant)-e1mardm
                                                            lgort (A) ---
    e1mardm-mapwith default(Value Exit)u2014(EqualsS) (B)- (UDF1)- lgort
                                Constant(Value Exit)---   
                                              Constant(Value 1000)(C)---   
    Other one to one mapping fields also you should use one more UDF.
                        Other one to one fields (A) ---
    e1mardm-mapwith default(Value Exit)u2014(EqualsS)    (B) - (UDF2)- Target
                                 Constant(Value Exit)---   
    UDF1:
    Argument A,B,C and select queue.
       //write your code here
    int j = 0;
    for(int i=0;i<a.length;i++)
    if (b[j].equals("true"))
    result.addValue(c[0]);
    i--;
    result.addValue(ResultList.CC);
    else
    result.addValue(a<i>);
    j++;
    UDF2:
       Argument A,B and select queue.
        //write your code here
    int j = 0;
    for(int i=0;i<a.length;i++)
    if (b[j].equals("true"))
    i--;
    result.addValue(ResultList.CC);
    else
    result.addValue(a<i>);
    j++;

  • How Useful, Effective and Stable is the Node Function

    Please note my current MacPro below.
    I'm seriously thinking about purchasing a used ("Refurbished") MacPro similar to the one below to help share the sequencing workload. Of course, there are a number of ways to setup the the second MacPro computer to share the workload. One of them is to use the Node Function.
    The manual states that utilizing the Node function will help with the CPU workload of software synths. If I understand the manual correctly, all that needs to be done is to initialize the node function after connected the second Apple computer to the first via the Ethernet cable. I have a number of instrumental libraries that uses Native-Instrument's Kontakt 2 sampler software (GPO, JABB, Kirk Hunter "Diamond" orchestral libraries, Chris Hein Guitars, etc., etc.) I like ALL of these libraries but they do definitely put a drain on the computer's CPU resources.
    So. . . Here are my questions.
    How effective is using the Node function to help "share the workload"?
    Putting into consideration that the second MacPro computer will be similar to the one noted below, how many more orchestral instruments (using the Kontakt 2 software) can I expect to load within a project using the Node function?
    It looks like the purchased second "refurbished" MacPro will have the Leopard operating system loaded on it. (I plan on purchasing it from Apple.) I am reluctant to "upgrade" my current computer from Tiger to Leopard. What problems/issues, if any, might one expect if the primary computer runs with the Tiger operating system and the secondary computer runs with the Leopard operating system???
    Please share your trouble or success story regarding your usage of the Node function.
    Thank you!
    Ted

    I'm able to communicate between the MacPro and the Dell workstation using Music Lab's MidiOverLan 3 software. It looks like I'll be using a similar setup for that second MacPro.
    Yes, a solution like that is what I would recommend in your situation, and pipe the audio back in via an audio interface (you can go the networked audio route if you wish, but I haven't found it a particular stable or workable solution so far - it's a bit random - going via digital or even analog on a second audio interface to bring in the remote audio is more solid, although obviously your limited in the number of channels to independently bring over (you'll probably need to submix at least).
    Bee Jay, thank you very much for the reply and the muchly needed "head's up"!
    You're welcome!

  • How to acheive IF elseif elseif else  condition using std mapping functions

    How to perform the following mapping using standard graphical functions:
    if (a = 1)
    result.addValue("3");
    else if (a = 2)
    result.addValue("6");
    else if (a = 5)
    result.addvalue("7");
    else if (a = 10)
    result.addValue("11");
    else
    result.addValue(a);
    can this requirement be acheived without using a UDF?
    Regards
    bhasker

    UDF is better way to get this done.
    you try like this using Standard function:
                                               Const 3    /THEN     
                                      (A equals 1)   IF              (output of ifThenElse) ->TragetFiled
                                                            \ELSE
                                                  /THEN     /(output of IfThenElse input to else of first If)
                                              IF               /
                                                 \ELSE
    Like wise for other conditions....
    In else part of ifThenElse, give the output of second ifThenElse. here in ths case you need four ifThenElse.
    CodeGenerated:
    /ns0:MT_/targetFIELD = iF(const([value=3]), stringEquals(/ns0:MT_XML_OB/A=, const([value=1])),
    iF(const([value=6]), stringEquals(/ns0:MT_XML_OB/A=, const([value=2])),
    iF(const([value=7]), stringEquals(/ns0:MT_XML_OB/A=, const([value=5])),
    iF(const([value=11]), stringEquals(/ns0:MT_XML_OB/A=, const[value=10])), /ns0:MT_XML_OB/A=))))
    Ritu
    Edited by: Ritu Sinha on Apr 13, 2009 2:48 PM

  • Check Focus Of An Image With Standard LABVIEW Functions

    Hi,
    I would like to determine the best focus quality of a series of color images using standard LABVIEW functions, an example my images would be a 1mm x 2mm ROI of a copper coin or similar sample. I do not have the IMAQ vision toolkit so that will not be an option. Could somebody give me an example of this or point me in the direction I need to go. Is it better to check focus quality on the color image or a black and white image, or perhaps an intensity representation of the image? I have heard that checking the Standard Deviation of a line of pixels within the image would give a good indication of the focus quality by looking for the highest SD value of all the images?
    Any help is greatly appreciated!
    Solved!
    Go to Solution.

    Hi Jimmy01,
    I found this example which shows a couple ways to determine the best focus for your system: http://www.ni.com/example/28506/en/
    I also found this example, although it uses the IMAQdx drivers.  So you'll have to modify it a bit to work with the IMAQ drivers, but it's doable: https://decibel.ni.com/content/docs/DOC-11090
    It looks like these examples detect the best focus by measuring the sharpness of the edges.  A stronger edge means the camera is more in focus.  This is also what I was thinking before I found these.  I haven't been able to find anything about using the standard deviation of line pixels, as you mentioned.
    Julian R.
    Applications Engineer
    National Instruments

  • SAP and standard email function in Adobe form

    In SAP, we're using lifecycle designer 9, We're using standard email function (with a big pushbutton in our form). Ours issues are :
    - we're not abble to change dynamically the mail object and body.
    - we're not abble to add some secondary receivers in the mail.
    Thanks a lot for any solution or idea.
    We 've already try with a javascript but it produce a mix objet ...
    Best regards,
    Pierre PRUVOST

    Hi Pruvost,
    Have you tried the event.target object.. using mailDoc function?
    var oDoc = event.target;
    oDoc.mailDoc({
         bUI: false,
         cTo: "[email protected]",
         cCC: "",
         cSubject: "Here is the Subject of the email.",
         cMsg: "Here is the Message of the email."

  • Create BW datasource on standard ECC function module MCEX02_02_SCL_GR

    Hello Experts,
    I plan to use standard ECC function module MCEX02_02_SCL_GR to get the GR dates for the PO Schedule Lines. I copied this function module with the BW function group and tried to create a datasource in RSO2. However I receive the following error
    ZMM_PO_GR: TABLES-paramter E_T_DATA for extractor MCEX02_02_SCL_GR is missing
    I understand that the template for BW function modules is RSAX_BIW_GET_DATA_SIMPLE. However is there any way I can use the standard ECC function module OR else how would I incorporate the code in MCEX02_02_SCL_GR into the RSAX_BIW_GET_DATA_SIMPLE template.
    Thanks for your help.
    Alnick

    create a DS based on FM and call MCEX02_02_SCL_GR into that FM using call funcation XXX destination.
    or
    create a table in BW with fields Client, Source system and FM..and then do select statement toa take source system and give in palce of destination.

  • Remove context node function

    Hi
    I know the use of remove context node function. Even I have gone through couple of weblogs that are available on the sdn. But I would like to know.........whether remove context node function is mandatory in any case ?? I believe even we can directly map the source and target fields which are in different contexts. If it is the case ......if we can do it without remove context node function.......what is the importance of remove context node function ?? Is there any performance issue ......to use this node function ??
    thanks
    kumar

    Hi palnati
    <i>if we can do it without remove context node</i>
    ---> Yes you can avoid remove context. This can be done by changing the context of source field to one parent above. This will collect all the source values in same context.
    for example, consider following mapping
    Amount -
    > (removeContext)--> sum--
    > target field
    will be same as
    Amount(change context to parent of parent)-->sum-----> target field.
    Hope this helps.
    Regards

  • Use of Call Function Node vi, with char type pointer

    I want to be able to use a certain function from C++ DLL, and I followed the TOOLS>>IMPORT>>SHARED LIBRARY(.dll) wizard.  Where I located my header file and the dll file.
    However i am getting an error (1097).  This is the function with the paramaters:
    void Function_Name(unsigned char *L, unsigned char *H, unsigned in Len, unsigned char Adr);
    I don't think, that I configured my Call Function Node, correctly.  How should i set the paramaters settings of the first 2?  I have tried Numeric, unsigned (and signed) Int (32, 16), pass pointer value.  to accomodate the first two varaibles. 
    Please someone help, what should I do to accomodate the unsigned char pointers, so that I can used the function in labVIEW?

    Hi Safe,
    The error you're encountering has the following description (I'm sure you've already looked this up-posting here for clarity for other readers):
    LabVIEW:  An exception occurred within the external code called by a Call Library Function Node. This might have corrupted LabVIEW's memory. Save any work to a new location and restart LabVIEW.
    Typically, this happens for one of just a few reasons:
    Memory was overwritten (e.g. you passed a buffer of N bytes, but N+X bytes were modified, and an exception was thrown.
    A bad pointer was passed. (This is probably not the case.)
    Arguments were not passed to the function properly. (Calling conventions)
    Function wasn't called from the proper thread.
    Some other reason (only can be determined by inspecting in a debugger).
    I've attached some pictures of how I'd configure the dialog, but there are two critical things you have to know: calling conventions and thread safety. Those are things defined by the DLL. In Windows, C vs. 'Standard' (a.k.a. Pascal) calling conventions MUST be correct, as they affect how arguments are passed on the stack. If this is wrong, then, for example, where arg1 is expected to be an unsigned char *, you may actually only pass an unsigned char. Dereferencing that number as a pointer will at best crash, at worst appear to be a valid address and silently corrupt memory.
    I suggest double-checking the calling conventions. 'stdcall' is still quite common, but not the default setting in the Call Library Function dialog.
    Best regards,
    intvstefve
    intvsteve
    LabVIEW R&D
    Attachments:
    dllconfig11.JPG ‏40 KB
    dllconfig21.JPG ‏41 KB

  • How to use standard function keys as custom keys

    how to use standard function keys as custom keys.
    i have encountered that problem while developing a screen, there i'm supposed to use standard function key F2 ( which actually meant for choose) for clearing the screen fields where the cursor is present and f1 for saving data that entered in screen fields, etc...
    kindly help me out.

    Hi ,
    Solution to use SAP reserve function keys F1 .. F4 (mostly this requirement comes up for RF screens) can be acheived by assigning your new Function code using the Menu path Utilities --> F key Consistency in the Menu Painter (SE41) . Once you assign your cutom function code to the standard Fn keys the only remaining step is to make sure that you set a curson on any of the field on sceen by using the Key Word "SET CURSOR" .
    If you dont use the key word SET CURSOR in the PBO of the screen then you might not see any response for F4.
    Thanks

  • Using Standard SAP Tables in SAP Tables, clusters or functions connections

    Hi Gurus,
    I am trying to use Standard SAP table like MARA, MAKT.. etc. in my crystal designer. When i make a new connection using SAP tables, Cluster or Functions, these tables are not listed.
    Any configuration i have to maintain to list those standard table.?
    With Regards,
    Balachander.S

    Due to performance reasons there is  a limitation regarding the number of the dispplayed table names. Once you are in the connection/table browser select a table and invoke the context menu by pressing the right mouse button. Select Options and in the options panel you can use wildcards in order to limit the results to the desired range (eg. use MA% to get a list of tables starting with MA). After you close the options panel press F5 and expand the connection entry again.
    Regards,
    Stratos

  • Use standard Function kyes as custom in PF ststus

    Hi all,
    I want to use standard Function kyes(such as F1 & F3) as custom in PF ststus so that I will perform my code by these function keys. Is it possible.
    Thanks
    Sanket sethi

    Yes it is possible.

  • Handling date to ADD or Substract fixed # of days using standard function

    Hi ,
    Using the standard functions in XI, is it possible to add or subtract a fixed number of days from the date i get from the input file.
    Like, from file I get the date as 25/06/2009.My output should be 05/07/2009 after adding 10 days .
    can some one guide how to handle this.
    Thanks,
    Ven..

    Hi Ven,
    Here is a  UDF code,which takes date(format:yyyyMMdd) as input and does addition or subtraction operations based on <field 1> value,return the result date(format:yyyyMMdd) as string value.
    public String GenerateDate(String date_input, String field1,Container container){
    //Here "date_input" and "field1" are inputs for this UDF
    int date = Integer.parseInt(date_input);
    Calendar cal;
    int day = date % 100;
    int month = (date/100) % 100 - 1;
    int year = date / 10000;
    cal = Calendar.getInstance();
    cal.set(year, month, day);
    /implement addition or subtraction logic here as your needs/
    if (field1 == "A")
    cal.add(Calendar.DATE, 10);
    else if(field == "B")
    cal.add(Calendar.DATE, -5);
    day = cal.get(Calendar.DATE);
    month = cal.get(Calendar.MONTH)+ 1;
    year = cal.get(Calendar.YEAR);
    date = year * 10000 + month * 100 + day;
    return (""+date);
    You can use Standard Funtion DateTrans to convert date from your format to the format used in the UDF and vice versa.
    Regards
    Pravesh

  • How to use node functions in Message mapping !!

    Hi  Gurus,
    I have got one issue in message mapping, please can any one put some ideas on this !!
    Source Structure
    <Group_ZA>  0..unbound
         <D02_ZA>           0.. unbound
             ZA_01             0..1   - QA
             ZA_02             0..1      20
             ZA_03             0..1
             ZA_04             0..1
         </D02_ZA>
         <D02_ZA>          
             ZA_01             0..1     QD
             ZA_02             0..1     40
             ZA_03             0..1
             ZA_04             0..1
         </D02_ZA>
         <D02_ZA>          
             ZA_01             0..1    QN
             ZA_02             0..1     12
             ZA_03             0..1
             ZA_04             0..1
         </D02_ZA>
         <D02_ZA>          
             ZA_01             0..1    QP
             ZA_02             0..1    60
             ZA_03             0..1
             ZA_04             0..1
         </D02_ZA>
          iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
         <D02_ZA>          
             ZA_01             0..1     QA
             ZA_02             0..1      20
             ZA_03             0..1
             ZA_04             0..1
         </D02_ZA>
         <D02_ZA>          
             ZA_01             0..1     QD
             ZA_02             0..1     40
             ZA_03             0..1
             ZA_04             0..1
         </D02_ZA>
         <D02_ZA>          
             ZA_01             0..1    QN
             ZA_02             0..1     12
             ZA_03             0..1
             ZA_04             0..1
         </D02_ZA>
         <D02_ZA>          
             ZA_01             0..1    QP
             ZA_02             0..1    60
             ZA_03             0..1
             ZA_04             0..1
         </D02_ZA>
    iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
    <D02_ZA>          
             ZA_01             0..1    QN
             ZA_02             0..1     12
             ZA_03             0..1
             ZA_04             0..1
         </D02_ZA>
         <D02_ZA>          
             ZA_01             0..1    QP
             ZA_02             0..1    60
             ZA_03             0..1
             ZA_04             0..1
         </D02_ZA>
    iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
    <D02_ZA>          
             ZA_01             0..1     QA
             ZA_02             0..1      20
             ZA_03             0..1
             ZA_04             0..1
         </D02_ZA>
         <D02_ZA>          
             ZA_01             0..1     QD
             ZA_02             0..1     40
             ZA_03             0..1
             ZA_04             0..1
         </D02_ZA>
         <D02_ZA>          
             ZA_01             0..1    QN
             ZA_02             0..1     12
             ZA_03             0..1
             ZA_04             0..1
         </D02_ZA>
         <D02_ZA>          
             ZA_01             0..1    QP
             ZA_02             0..1    60
             ZA_03             0..1
             ZA_04             0..1
         </D02_ZA>
    </Group_ZA>
    Target Structure
    ProductActivityNotification                                                       0..unbound
                          ProductActivity                                                             1..1
                                        Item                                                                 1..unbound
                                              Inventory                                                   0..1
                                                     UnrestrictedUseQuantity                    0..1
    The Group_ZA comes 'n' number of times and D02_ZA comes sometimes 5 times and sometimes 6 times etc.,
    ZA_01 field can come with 5 to 6 different values like 'QA','QD','QN' etc., sometimes ZA_01 comes only 3 times QA,QD,QN.
    if ZA_01 = 'QA' then only  we need to pass   ZA_02 value on to ''UnrestictedUseQuantity'' (target side),
    I mapped the fields, the vlaue ZA_02  passing properly on to 'UnrestictedUseQuantity' when D02_ZA comes 5 or 6 times, all the times 'QA'  value comes into ZA_01 field. In case if QA value missed or doesn't come from source, the Target side ' 'UnrestictedUseQuantity' field last value comes into last but one.
    Ex: QA value is in 3 times, but I have 4 source message on top. values comes into target side like
    20
    20
    20
    suppose to come like
    20
    20
    -- (Space)
    20
    Please required your valuable inputs in bit urget !!
    how to map field level please?
    Many Thanks in Advance
    Kind Regards
    San

    Petre:
    If you want to use standard functions then you try this:
    If-->currentdate -OR- Constant(01.02)
    currentdate -OR- Constant(02.02)   --> OR -->
    currentdate -OR- Constant(03.02)
    Then give some output
    Else give some output
    So give the output for the first two conditions to another OR and the result of the third to the same OR. So whenever the condition is true in any of the condition you will get the THEN value else you will get the ELSE value.
    ---Satish

Maybe you are looking for

  • FRM-41211 Integration Error SSL - Oracle Forms 10g

    Hi all. I have FRM-41211 Integration Error SSL Failure Running Another Product error while calling a report from web form in oracleAS 10g. I have problem with RUN_REPORT_OBJECT in web forms in this code: ==============================================

  • Ratings won't update from iPod to iTunes

    I know these sorts of questions have been posted before, but all the answers I can find simply seem to say "it should work if you set update to automatic"... Well, it doesn't. Experimentally I've been putting a few unrated songs from my iTunes onto m

  • Printing problem with Epson R290

    I am running CS2 on Leopard and have recently purchased an Epson R290. The first time I used it with Illustrator and InDesign it worked fine but now whenever I print anything it prints a tiny version (about a sixth of the real size) of the design in

  • Sync/Async bridge timeout?

    Hi, a ccBPM process produces some timeouts during the last week and i dont know why. The process produces the timeout in the third step: Step 1: Receive synchronous message via HTTP, open sync/async bridge Step 2: Mapping STep 3: Send back response f

  • Problem inserting data into database (increment problem)

    I have a servlet page that gets various data from a bean and executes multiple SQL statements to store this data. Beacuase i want to insert data into a number of tables that are related with a one to many relationship I am not using the auto incremen