Sequnce Number generation in Message Mapping..

Hello All,
I am using this thread as a reference for declaring a Counter for unique sequence number generation...
Sequence Number in XI Mapping
-> define a global variable by clicking the JAVA_SECTION_TOOLTIP icon on the design tab of source message type of ur message mapping.
enter the following in the GlobalVariables Section
Integer counter =0;
-> define a user defined function (SeqGen let's say)
write the following code in it.
Integer seq = 0;
GlobalContainer globalContainer = container.getGlobalContainer();
a = globalContainer.getParameter("counter");
seq = globalContainer.getParameter("counter");
seq = seq + 1;
globalContainer.setParameter("counter",seq);
return a;
now use this user defined function (SeqGen)in all ur mappings to the sequence no of ur line items.
If u could just elaborate on creation of UDF.. on what are we goin to pass in the variable 'a'...  while creating the UDF. ??
Harpreet..!!

Hi harpeet,
A UDF can be of two types a  Simple UDF and Adavnced UDF.
This is a case of a simple UDF,
A simple UDF returns only 1 element  as  an output. 
here 'a' is such an generated output.   you can assign this to any numeric filed of ur target stucture
This UDf does not require any input Field from the message. 
These functions are known as generating functions.
Hope this explains.
Reward points if useful.
Regards,
Abhishek

Similar Messages

  • CcBPM Process Number in the Message mapping

    Hi,
    I  have a requirement to map the ccBPM's process number in which the Mapping error has occured to be mapped to a specific field in the target.  I wanted to know how could I pass the BPM's process number to the message mapping ( this message mapping(Service mapping) is a part of the same BPM).  If we could get the MESSAGE_ID of the message in the message mapping, we should also be getting the BPM Process number.
    In other words, when an alert is triggered in BPM, we get the BPM process number in its subject, i need that BPM process number in to the message mapping where that message has to be stored in a table in ECC.
    I have searched in help and SDN to check if some system properties can help, but i couldnt.  Any help/inputs from you is highly appreciated.
    Regards,
    Kalpana.

    Hi Manuel,
    it is very easy to to get the <b>Message ID</b>, which is unique and useful for selecting a message in the monitoring
    <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/b3/9a2aeb24dc4ab6b1855c99157529e4/content.htm">Special Access to Mapping Runtime Constants</a>
    You send a mail from Java Mapping or, what would be the standard, (as additional) message from BPM or just as normal Message Receiver or only in Error case as Alert receiver.
    Regards,
    Udo

  • Number Formatting in Message Mapping

    Guys
    I am getting a decimal number like 30.22 from SAP. I am sending it to a flat file. Now I have a format for the flat file like 5S2 which means 5 total and the last two is decimal part. Also I dont want decimal point in the output. So my output should be 03022. But I am unable to fulfill this as my output? If I use "FormatNum" in airthmetic functions and if I specify it as 00000 then I am able to get 00030. But instead of this I should get 03022. Can any of you guys help me out?
    Regards,
    ---Satish

    > Christine
    >
    > I believe your solution would definitely work if I
    > have 2 decimal places only. But I may have 2 or 3 or
    > 4. So in this situation I think what you have told
    > will not work. Is there any process to how to resolve
    > this issue?
    >
    > ---Satish
    Satish,
    but if I understanded correctly, the 5S2 standard also only accepts 2 decimal positions, isn't it so? How does 3.457 is represented in 5S2? Isn't it 00345?
    If that's the case, then the answer that Christine provided satisfies your needs.

  • Export Parameters in Parameterized Message Mapping does not work.

    Hello, XI-Gurus!
    I have a question: how to use an EXPORT parameter in Parameterized Message Mapping? seems it does not work...
    (I use XI / PI 7.1)
    For example, I have a follow scenario: a large message comes to XI from one BS (message contains a lot of rows), then this large message splits to some small messages (something about 1000 rows in one small message), and send small messaeg one by one from XI to second BS. So, after receive step I use a transformation step with Parameterized Message Mapping to get a total amount of rows in large message (it needs for making condition for loop in IP, for example). I want to use an EXPORT parameter to pass this number from Parameterized Message Mapping to Integration Process. How can I do it?
    Of course, I know the way to how to make this scenario without any parameterizing, but I want to use exactly "Parameterized Message Mapping" like it writes in this help:
    http://help.sap.com/saphelp_nwpi71/helpdata/en/43/c3e1fa6c31599ee10000000a1553f6/frameset.htm
    This topic contains something about procedure how to use an EXPORT parameter, but this procedure does not work. I don't understand how to write this UserDefined Function, which I can set any export parameters.
    I read this blog:
    /people/jin.shin/blog/2008/02/14/sap-pi-71-mapping-enhancements-series-parameterized-message-mappings
    this blog has NO solutions about EXPORT parameters. about IMPORT parameters - everything OK.
    Some topics about how to use export parameters in MM in this forum marked as "answered", but this is not true.
    How to export parameters from Message Mapping
    Export parameter REALLY work in message mapping???????
    Export parameter in Message mapping UDF
    WBR,
    Vsevolod

    Hi Rudolf,
    It still does not works.
    Great thanks for all your answers! If your advice works on your PI-server, it means that my problem not in UDF.
    Step by step:
    1) I create in "Signature" tab two parameters: FILE_NAME, FILE_TYPE (of course, they both Export and xsd:string type)
    2) Then, I goes to "Functions" tab and create new function "testUDF" with one argument var1.
    3) In body of this UDF insert 2 strings:
       getOutputParameters.setString("FILE_NAME" , "Order");
       getOutputParameters.setString("FILE_TYPE" , "PDF");
    4) in "Definition" tab I bind function "Local.testUDF" with one field in my input message and goes to "Test" tab for testing.
    5) And then I have a message window "Problems While Testing":
    Source text of object Message Mapping: mm_ParamMap | urn:****.*.:****:TEST has syntax errors:
    Function testUDF, Line 1:
    cannot find symbol
    symbol  : variable getOutputParameters
    location: class com.sap.xi.tf._mm_ParamMap_
    getOutputParameters.setString("FILE_NAME" , "Order");
    ^
    Function testUDF, Line 2:
    cannot find symbol
    symbol  : variable getOutputParameters
    location: class com.sap.xi.tf._mm_ParamMap_
    getOutputParameters.setString("FILE_TYPE" , "PDF");
    ^
    Note: /usr/sap/PID/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Mapb1562570ca9e11deb3fe00237d301cd6/source/com/sap/xi/tf/_mm_ParamMap_.java uses or overrides a deprecated API.
    Note: Recompile with -Xlint:deprecation for details. Note: /usr/sap/PID/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Mapb1562570ca9e11deb3fe00237d301cd6/source/com/sap/xi/tf/_mm_ParamMap_.java uses unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    2 errors
    Look at this notes, first writes that I use a deprecated API, second - about unchecked or unsafe operations.
    And I have no idea what's wrong... Can you help me?
    Thanks!
    WBR,
    Vsevolod

  • Message mapping for checking hyphens (-) in material number

    Hi All,
    I have an interface in PI 7.1 for product change and product create coming from ORACLE to SAP
    Now, the reqmt is to take the ORACLE product which could have hyphens or without hyphens
    In SAP, the product can have upto 40 characters and if something without hyphens come in, then it adds leading zeros while creating and while changing, SAP expects a product with leading zeros
    So, how do I handle this? How do I check in message mapping, the product with hyphens or without and write a condition to it.
    Here is my idea
    Take the product, use a message mapping function to check for products without hyphens and if YES, add leading zeros upto 40 characters
    Can anyone let me know how this could be achieved using message mapping function
    I am sure this kind of reqmt especially leading zeros for products is very common in PI interface circle
    So, please let me know the details
    Thx
    mike

    Hi Mike,
                  your requirement can be solved without UDF too
    inputfield ---------------->
                                                 indexOf() ------------>  
    Constant(-)---------->                                                  less---->if ----->target field                                                                               
    constant(0)---------->
    inputfield  and contant (hyphen) are inputs to standard text function indexOf. Output of IndexOF and constant(zero) are inputs to standard arithmetic function less. Out put of less goes to boolean function if. The IF has two inputs then and else .
    For then part write this logic
    inputfield----> formatNumber()---->then
    in standard arithmetic function Formatnumber  specify number format with 40 zeroes, leave decimal separetor blank.
    Now for the else part of "IF" write this
    inputfield----->else
    Finally
    output of "IF" goes to target field
    IF------>target
    Regards
    Anupam

  • Message Mapping - NewLine generation  in the target field

    Hi ,
    This is a File to SOAP scenario, where text file is picked by XI and posted to target using webservice in the xml format.In the message mapping, I am supposed perform a logic where 3 fields in the source structured are to be concatenated and sent to the target structure. This fields at the target structure are to be displayed with a newline character.
    So if I am sending : abc, 123 and xyz as input and  the output should be in one field as follows :
    <ns3:OutputField xmlns:ns3=abc
                                                  123
                                                   xyz</ns3:StreetAddressLine>
    I have used this "&#x0D;&#x0A;" as the seperator in the concat function, hoping this would produce a new line but was hopeless.
    Any ideas are appreicated.
    Thanks,
    Rag

    Hi Raghav,
    XML will never show new line or space characters.
    Try to open the message in notepad or wordpad and then check if you can see the new line character.
    -Supriya.

  • Certification Exam content  clarification - Message mapping patterns

    I was going through the Exam content for  SAP NetWeaver´04 - Exchange Infrastructure & Integration  Dev.Cons.
    Link
    Check out this part -
    " 4. Mapping (++)
    Concepts / Overview
    Test / Debug Environment
    Standard functions
    User-defined Functions
    Message mapping patterns
    Multi-mapping
    ABAP, Java, XSLT mapping overview "+
    What does Message mapping patterns mean?
    I have cert docs but nothing verifies this.
    Thanks for your time,
    Priya.

    Hi,
    Mapping “patterns” are some of the common mapping requirements found in the past which XSLT was used, because we did not think that Message Mapping provided the functionality
    Summarization
    Sequence–Number Generation
    Duplicating Subtrees
    Table / Value Lookups
    Tree–Reversal
    <removed_by_moderator>
    Read the "Rules of Engagement"
    Nilesh
    Edited by: Juan Reyes on Apr 3, 2009 11:15 AM

  • Message Mapping error in UDF

    I am receiving errors when trying to activate my MM.  I believe the issues are in one of two UDF's.  These UDF's do work in another MM without error.  Below are the error's and UDF's.
    ERRORS:
    Activation of the change list canceled Check result for Message Mapping MM_WPDBBY_WPDBBY01_TO_POS_WAWAFILE | http://wawa.com/xi/erp/pos:  Starting compilation  Source code has syntax error:  /usr/sap/XID/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Map5420e070cabe11dcab4b00306ef38da9/source/com/sap/xi/tf/_MM_WPDBBY_WPDBBY01_TO_POS_WAWAFILE_.java:3291: cannot resolve symbol symbol : variable container location: class com.sap.xi.tf._MM_WPDBBY_WPDBBY01_TO_POS_WAWAFILE_ map = container.getTransformationParameters(); ^ /usr/sap/XID/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Map5420e070cabe11dcab4b00306ef38da9/source/com/sap/xi/tf/_MM_WPDBBY_WPDBBY01_TO_POS_WAWAFILE_.java:3293: cannot return a value from method whose result type is void return constant; ^ 2 errors
    UDF's:
    public String getSender(Container container){
    String constant;
    java.util.Map map;
    // get constant map
    map = container.getTransformationParameters();
    constant = (String) map.get (StreamTransformationConstants.SENDER_SERVICE);
    return constant;
    IMPORTS:  com.sap.xi.mapping.parse.dom.;javax.xml.parsers.;java.io.;com.sap.aii.mapping.lookup.;org.w3c.dom.*;
    public String getSeqNum(String fileType,String objNum,String Sender,Container container){
    String request = "<ns0:ZRFC_NUMBER_GET_NEXT xmlns:ns0=\"urn:sap-com:document:sap:rfc:functions\"><NR_RANGE_NR>" + fileType + "</NR_RANGE_NR><OBJECT>" + objNum + "</OBJECT><QUANTITY/></ns0:ZRFC_NUMBER_GET_NEXT>";
    InputStream isRequest = new ByteArrayInputStream(request.getBytes());
    SystemAccessor accessor = null;
    String num  = null;
    try{
         // 1. Determine a channel.
         Channel channel = LookupService.getChannel(Sender, "R_RFC_ERP");
         // 2. Get a system accessor for the channel.
         accessor = LookupService.getSystemAccessor(channel);
         // 3. Create a payload according to the data type which the adapter expects.
         //    Use service.getBinaryPayload() for binary payload,
         //    and service.getTextPayload() for text payloads.
         Payload payload = LookupService.getXmlPayload(isRequest);
         // 4. Execute lookup.
         Payload response = accessor.call(payload);
         //Parse response
         DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
         DocumentBuilder builder = factory.newDocumentBuilder();
         InputStream resStream = response.getContent();
         Document doc = builder.parse(resStream);
         Element sequence = doc.getDocumentElement();
         NodeList number = sequence.getElementsByTagName("NUMBER");
         //Extract Number
         num = DOMUtil.getSimpleElementText((Element) number.item(0));
    } catch (Exception e) {
         return e.getMessage();
    } finally {
         try {
              if (accessor != null) accessor.close();
         } catch (Exception e) {
              return e.getMessage();
    GlobalContainer gc = container.getGlobalContainer();
    gc.setParameter("Num", num);
    return num;
    Any help is appreciated.
    Regards,
    Darrell

    Fauver,
    Just to narrow down the problem first remove the first udf and only use the 2nd user defined function. Also in the 2nd udf you have to change this line:
    try{
    // 1. Determine a channel.
    Channel channel = LookupService.getChannel(Sender, "R_RFC_ERP");
    In the above line instead of Sender you use the business service or business system where R_RFC_ERP RFC communication channel is created in Integration Directory. So you are hardcoding it first.
    Once you have done this changes do save and test it once again. If this works then you can change back to original and your first udf needs to be checked.
    Regards,
    ---Satish

  • Error when saving message mapping -

    Just upgradedto PI 7.1. System details below....
    Make Release NW07_08_REL  SPS Number 08  JDK Version jdk15
    Server Version SAP J2EE Engine 7.10.3710.43701.20090416112158
    Java Runtime Java(TM) 2 Runtime Environment, Standard Edition (version=5.1.034)
    Java Virtual Machine SAP Java Server VM (version=5.1.034)
    Operating System AIX (version=5.3, arch=ppc64)
    I've been building an interface to test the developer tools and when I save my message mapping (it's a very simple graphical mapping) I get a java popup with the text 'Internal GUI error', I'm using Java WS Version 1.5.0 (build 1.5.0_19-b02) as per the PI documentation.
    I recreated the problem timing each activity and saved the exception in a text file. I'm able to identify the relevant section of the exception biut it's meaningless to me. I searched SDN & OSS and I can't find any specific hits. Those that are similar (different SAP applications - WebDynPro for example) point towards incompatible s/w components - Java Run Time environment etc.... I've cleared the Java WS cache (Edit>Preferences>Delete Files) just to make sure, but the problem still occurs. I'm looking for advice. I've pasted some of the exception details below. I can provide more information but it's a pretty long file.
    Edited by: Rob Warde on Aug 5, 2009 4:27 PM

    Thrown:
    com.sap.aii.utilxi.swing.framework.FrameworkException: Internal problem occurred
         at com.sap.aii.utilxi.swing.toolkit.ExceptionDialog.init(ExceptionDialog.java:124)
         at com.sap.aii.utilxi.swing.toolkit.ExceptionDialog.<init>(ExceptionDialog.java:96)
         at com.sap.aii.utilxi.swing.toolkit.IBMessages$1.run(IBMessages.java:319)
         at com.sap.aii.utilxi.misc.thread.ThreadPool.assureAWTEventQueueing(ThreadPool.java:84)
         at com.sap.aii.utilxi.misc.thread.ThreadPool.assureAWTEventQueueing(ThreadPool.java:67)
         at com.sap.aii.utilxi.swing.toolkit.IBMessages.showException(IBMessages.java:309)
         at com.sap.aii.utilxi.swing.toolkit.IBMessages.showException(IBMessages.java:299)
         at com.sap.aii.utilxi.swing.toolkit.Guitilities$EventProcessor$1.run(Guitilities.java:395)
         at java.awt.event.InvocationEvent.dispatch(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at com.sap.aii.utilxi.swing.toolkit.Guitilities$EventProcessor.dispatchEvent(Guitilities.java:319)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    Caused by: java.lang.NoSuchMethodError: com.sap.aii.ib.bom.mt.js.JavaSource.setMode(I)V
         at com.sap.aii.mappingtool.Project.getJavaFile(Project.java:324)
         at com.sap.aii.mappingtool.mf.MappingTool.getJavaFile(MappingTool.java:107)
         at com.sap.aii.mappingtool.fwutil.api.ViewUtil.prepareSave(ViewUtil.java:118)
         at com.sap.aii.ibrep.gui.mapping.xitrafo.XiMappingView.prepareSave(XiMappingView.java:269)
         at com.sap.aii.ib.gui.editor.DefaultPersistenceHandler.save(DefaultPersistenceHandler.java:153)
         at com.sap.aii.ib.gui.editor.XiDocument.save(XiDocument.java:335)
         at com.sap.aii.utilxi.swing.framework.cmd.SaveCommand.execute(SaveCommand.java:76)
         at com.sap.aii.utilxi.swing.framework.ExecutionContext.execute(ExecutionContext.java:198)
         at com.sap.aii.utilxi.swing.framework.ExecutionContext.executeSafe(ExecutionContext.java:154)
         at com.sap.aii.utilxi.swing.framework.CommandAction.actionPerformed(CommandAction.java:82)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
         at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at javax.swing.JComponent.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Window.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)

  • Error in Multi Message Mapping

    Hi,
    I am getting the following error in my multi message mapping scenario where I am trying to create 2 different output files from a single input file based on some condition. I tested the message mapping by using a test file and it works fine, but when I use the same file and test it end to end the scenario is failing with the following error.
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--
    Request Message Mapping
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
      <SAP:Category>XIServer</SAP:Category>
      <SAP:Code area="MAPPING">GENERIC</SAP:Code>
      <SAP:P1>Split mapping created no messages</SAP:P1>
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:Stack>Split mapping created no messages</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    Is there something wrong with my configuration?
    The trace has the following content.
    Trace level="1" type="T">*** START APPLICATION TRACE ***</Trace>
      <Trace level="3" type="T">Document start</Trace>
      <Trace level="3" type="T">Start tag [ns0:Messages]</Trace>
      <Trace level="3" type="T">Add raw attribute [ xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge"]</Trace>
      <Trace level="3" type="T">Start tag [ns0:Message1]</Trace>
      <Trace level="3" type="T">Close tag [ns0:Message1]</Trace>
      <Trace level="3" type="T">Start tag [ns0:Message2]</Trace>
      <Trace level="3" type="T">Close tag [ns0:Message2]</Trace>
      <Trace level="3" type="T">Close tag [ns0:Messages]</Trace>
      <Trace level="3" type="T">Document end</Trace>
      <Trace level="1" type="T">*** END APPLICATION TRACE ***</Trace>
      <Trace level="2" type="T">Java mapping com/sap/xi/tf/_Employee1_MT_To_Employee1_MT_AND_Employee2_MT_MM_ completed. (executeStep() of com.sap.xi.tf._Employee1_MT_To_Employee1_MT_AND_Employee2_MT_MM_).</Trace>
      <Trace level="3" type="T">Message Type 1 Number of Messages 0</Trace>
      <Trace level="3" type="T">Message Type 2 Number of Messages 0</Trace>
      <Trace level="1" type="E">CL_XMS_PLSRV_MAPPING~ENTER_PLSRV</Trace>
      </Trace>
      <Trace level="3" type="System_Error">Error exception return from pipeline processing!</Trace>
      <Trace level="1" type="B" name="CL_XMS_MAIN-WRITE_MESSAGE_TO_PERSIST" />
    - <!--
      -->
      <Trace level="3" type="T">Persisting message Status = 014</Trace>
      <Trace level="3" type="T">Message version 001</Trace>
      <Trace level="3" type="T">Pipeline CENTRAL</Trace>
      </SAP:Trace>

    Hi,
    The scenario I am trying to test is a multi mapping scenario where I am trying to split one source message and create two target messages by using two different receiver interfaces, one for each message.
    I am on PI 7.1 and when I test message mapping and operation mapping using the payload from SXMB_MONI, it is successful. Whereas when I test the scenario end to end I am getting the following error messages:
    Operation Mapping
    Employee_Out_SI_To_Employee1_In_SI_AND_Employee2_In_SI_OM
    Name
    Employee_Out_SI_To_Employee1_In_SI_AND_Employee2_In_SI_OM
    Namespace
    http://accenture.com/1:N_multi-mapping
    Runtime error
    Split mapping created no messages
    Start tag ns0:Messages Add raw attribute xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge" Start tag ns0:Message1 Close tag ns0:Message1 Start tag ns0:Message2 Close tag ns0:Message2 Close tag ns0:Messages
    Could someone please help
    Cheers,
    S

  • Unable to save the message mapping

    Hi..
    I have completed the Message Mapping. when i am trying to save the Message Mapping i am getting the  Error while executing save "The length 0 of the array ' Sorted Function keys' is not equal to the number of 1 functions".
    can you pls suggest me, how can i rectify this type of strange error.
    Regards,
    Prasad

    Hi,
    that means that one of your Sorted Functions does not have correct input
    as the error says
    you probably placed it in a wrong way - check the functions
    desciption on help.sap.com or an example on SDN blogs
    and correct it - then it will work
    Regards,
    Michal Krawczyk

  • Process Order Batch number generation at the time of order creation

    Dear All,
    I m facing some issue at the time process order creation:
    Current Settings:
    1. Batch Number Creation at the time of order create.
    Reason for this setting: Release of order is done  by releasing operations one by one, therfore batch number will be generated on the final operation release, thats why we set up batch creation at the time of order create.
    2. For FG batch number generation there is a program that copy the SFG(in Order BOM) Batch number to FG. ITs a industry requirement.
    Problem:
    when we create FG order system generate the error message at the time of order creation tht No batch could be determine.
    Please suggest the solution
    Thanks,

    Hi
    Hope you have cretaed Batch serch strategy in COB1
    U need to maintain it as per your strategy type.

  • Soap lookup in PI7.31 message mapping

    Hi All,
    I have a soap lookup created in UDF in PI message mapping
    I am taking material id from the source structure and use it as input parameter for the lookup webservice
    Here is the UDF code which takes material number and returns the internal id
    AbstractTrace trace = container.getTrace();
    String matintid = "";
    try {
    //instance the channel to invoke the service.
    Channel channel = LookupService.getChannel("BS_Bus","CC_SearchLookup");
    SystemAccessor accessor = LookupService.getSystemAccessor(channel);
    // The Request message in XML. THIS IS THE LOOKUP SERVICE
      String SOAPxml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><searchTM_MATERIAL>xmlns:ns0=\"MDM_MAT_Search_MDM"><query><criteria><fTX_MATERIAL><constraint><value>"
    +a
    + "</value><expressionOperator>equals</expressionOperator></constraint></fTX_MATERIAL></criteria></query><reposInfo><repositoryName>REP_MATERIALS</repositoryName><serverName>mdm6765</serverName></reposInfo></searchTM_MATERIAL>";
    InputStream inputStream =new ByteArrayInputStream(SOAPxml.getBytes());
    XmlPayload payload = LookupService.getXmlPayload(inputStream);
    Payload SOAPOutPayload = null;
    //The response will be a Payload. Parse this to get the response field out.
    SOAPOutPayload = accessor.call(payload);
    /* Parse the SOAPPayload to get the SOAP Response back.  */
    InputStream inp = SOAPOutPayload.getContent(); 
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); 
    /* Create DOM structure from input XML */ 
    DocumentBuilder builder = factory.newDocumentBuilder(); 
    Document document = builder.parse(inp);
    NodeList matlist = document.getElementsByTagName("tM_MATERIAL");
    Element material = (Element) matlist.item(0);
    NodeList recidlist = material.getElementsByTagName("recordIdentification");
    Element recidnode = (Element)recidlist.item(0);
    matintid = recidnode.getNodeValue();
    trace.addInfo("matnid is" + matintid);
    } catch (Exception e) {
    trace.addWarning("Error" + e);  }
    trace.addInfo("Service XXX success executed");
    return matintid;
    This is giving a java null point error
    Errorjava.lang.NullPointerException: while trying to invoke the method org.w3c.dom.Element.getElementsByTagName(java.lang.String) of a null object loaded from a local variable at slot 16
    Any idea whats going on? I am able to get response for the webservice using SOAP UI 
    And here is the soap input and output in SOAP UI execution
    Input
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:MDM_MAT_Search_MDM" xmlns:urn1="urn:com.sap.mdm.ws.beans.mdt_mat_search_mdm_in" xmlns:urn2="urn:com.sap.mdm.ws.beans" xmlns:urn3="urn:com.sap.mdm.core.beans">
       <soapenv:Header/>
       <soapenv:Body>
          <urn:searchTM_MATERIAL>
             <urn:query>
                <!--Optional:-->
                <urn1:criteria>
                     <!--Optional:-->
                   <urn1:fTX_MATERIAL>
                      <urn2:constraint>
                         <!--Optional:-->
                         <urn2:value>12345</urn2:value>
                         <!--Optional:-->
                         <urn2:expressionOperator>equals</urn2:expressionOperator>
                      </urn2:constraint>
                   </urn1:fTX_MATERIAL>
                </urn1:criteria>
             </urn:query>
             <urn:reposInfo>
                <urn3:repositoryName>REP_MATERIALS</urn3:repositoryName>
                <urn3:serverName>mdm1234</urn3:serverName>
             </urn:reposInfo>
          </urn:searchTM_MATERIAL>
       </soapenv:Body>
    </soapenv:Envelope>
    Output:
    <SOAP-ENV:Envelope xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       <SOAP-ENV:Body xmlns:rpl="urn:MDM_MAT_Search_MDM">
          <rpl:searchTM_MATERIALResponse xmlns:rn0="java:sap/standard" xmlns:rn1="urn:com.sap.mdm.ws.beans" xmlns:rn2="http://schemas.xmlsoap.org/soap/encoding/" xmlns:rn3="urn:com.sap.mdm.core.base" xmlns:rn4="urn:com.sap.mdm.ws.beans.mdt_mat_search_mdm_in" xmlns:rn5="urn:com.sap.mdm.core.beans">
             <rpl:Response>
                <rn1:executionStatus>
                   <rn1:status>OK</rn1:status>
                   <rn1:description>Search/Retrieve done successfully</rn1:description>
                   <rn1:dataObject>Records 1..1 of 1 found</rn1:dataObject>
                </rn1:executionStatus>
                <rn4:tM_MATERIAL>
                  <rn4:fTX_MATERIAL>12345</rn4:fTX_MATERIAL>    
                 <rn4:recordIdentification>
                       <rn4:internalID>1267</rn4:internalID>
                    </rn4:recordIdentification>
           </rn4:tM_MATERIAL>
             </rpl:Response>
          </rpl:searchTM_MATERIALResponse>
    Thx
    mike

    Hi Mike,
    What I suspect is, you get a null pointer exception because the XML tag name which you are trying to retrieve, has a namespace. Could you please instead try to use:
    getElementsByTagNameNS(java.lang.String namespaceURI, java.lang.String localName)
              Returns a NodeList of all the Elements with a given local name and namespace URI in document order.
    Let us know if it works.
    Regards,
    Shweta

  • XI message mapping clarifications

    Dear All                                                                               
    I would like to know if XI message mapping(graphical mapping) can be         
    used for mapping based on the order of elements given in the XML source          
    message.                                                                               
    For example I have a source message as below                                                                      
    Source XML:                                                                      
    <Source>                                                                         
    <givenname>Ramesh</givenname>                                                     
    <givenname>Kumar</givenname>
    <givenname>Ganapathy</givenname>                                                                               
    </Source>                                                                               
    semantic is first instance of <givenname> needs to be mapped <firstname> in target,                      
    Second occurance of <givenname> needs to be mapped <secondname>,                                
    Third occurance of <givenname> needs to be mapped <familyname>                                                                               
    Target XML                                                                       
    <Target>                                                                         
    <firstname>Ramesh</firstname>                                                    
    <secondname>Kumar</secondname>
    <familyname>Ganapathy</familyname>                                               
    </Target>                                                                               
    As I understand graphical mapping editor works based on Xpath                    
    expressions, Is it possible to achieve such mapping schematics with              
    graphical mapping and UDF in XI.
    Please note I cannot use Java, ABAP or XSLT mapping programme.
    Can you provide me some hints on how to do this.                                                                               
    Thanks                                                                           
    Satish

    Hi Chilla
    This is how I am currently handling it. But my problem is
    The number of UDF's keeps increasing if I have a fourth, fifth element to handle. I have to create new UDF for every new level added.
    Is there a way I can do this with single UDF.
    result.addValue(givenname(X));
    X- will be the position and I can pass values as an argument to the UDF.
    Again the problem here is when I have second argument to specify which value of input to pick up say for example  givenname(1) or givenname(2)
    The second argument expects an String[] array as argument and not string(when i assign a constant its a string).
    So I cannot attach a constant to the second argument and pass the input.
    Is there any functions that can return a String[] array as an output taking sting value as input.
    Thanks
    Satish

  • How to find length of integer elements using message mapping

    Hi all,
             How can I find the number of digits in an element using message mapping
    XIer

    Satish,
               Cause I have to write the code for 100 elements, I have decided to have a AUDF with two inputs;
    1) for the element
    2) for the length of the data type (I am passing length using Constant message mapping func).
    Now when I change my UDF and try running it I get the following error:
    <b><i>Start of test
    Source code has syntax error:  /usr/sap/B06/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Map0999e66045cf11dcc83b4ebcfc11da82/source/com/sap/xi/tf/_MM_Recordcount1_.java:160: operator >= cannot be applied to int,java.lang.String if(Element_Name.length()>=Element_Length) ^ /usr/sap/B06/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Map0999e66045cf11dcc83b4ebcfc11da82/source/com/sap/xi/tf/_MM_Recordcount1_.java:166: operator <= cannot be applied to int,java.lang.String for(int i=Element_Name.length();i<=Element_Length;i++) ^ 2 errors</i></b>
    The code I have used is:
    public String Include_Space(String Element_Name,String Element_Length,Container container)
    {StringBuffer sb= new StringBuffer();
    if(Element_Name.length()>=Element_Length)
    return""Element_Name"";
    else
    for(int i=Element_Name.length();i<=Element_Length;i++)
    if(i==Element_Name.length())
    sb.append(Element_Name);
    else
    sb.append(" ");
    return ""sb.toString()"";
    Pls advice, where I am going wrong...
    XIer
    Message was edited by:
            XIer

Maybe you are looking for

  • 'svchost.exe has encountered a problem and needs to close.'

    I keep getting this error message  svhost has encountered a problem and needs to close. I am running Windows XP 3,  Does HP have a solution for XP-3?

  • Mirror iPad to television?

    Hello everyone. I am trying to figure out how to mirror my iPad 2 to my tv. I have a new Mac mini hooked up to my tv as a monitor with wifi and hdmi. Do I need appletv or AirPlay since I have the Mac mini?

  • Use of JSR-94 in oracle business rule

    I am developing an application using oracle business rules . I want to create a JSR-94 Rule Execution Set from Rule Sets in a Dictionary and want to run the application through created rule execution set. I have taken reference form OracleBusinessRul

  • Henry dropped the Ipod touch and cracked the screen.  How can I get this fixed.

    Hi, Henry dropped his Ipod touch and cracked the screen and put in a passcode and now has forgotten his passcode.  Need to know how I can get the screen fixed and or if it is covered on the 1 year warranty?  How can I unlock the Ipod without the pass

  • Video TS to appleTV

    I am very close to pulling the trigger on purchasing the new appleTV, it sounds like the wife and kids could use this with no issues at all. I have been looking through the archives and I have not been able to find a complete answer to this. I have s