MessageSplit from JDBC-Sender to JMS-Receiver

Dear all,
we are getting data in a resultset from JDBC-Sender and have to process each row as a own message. When we use message-splitting we are not able to generate plainText for the receiving JMS-channel. So we thought that we first have to generate xml and afterwards in JMS-Receiver-Adapter we have to use MessageTransformBean Struct2XML, but it does not work.
Howcan we achieve this?
Here is our mapping:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
     <xsl:output method="text" encoding="utf-8" />
     <xsl:template match="//resultset">
          <xsl:text disable-output-escaping="yes">&lt;ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge"></xsl:text>
          <xsl:text disable-output-escaping="yes">&lt;ns0:Message1></xsl:text>
          <xsl:for-each select="row">
                    <xsl:value-of select="NODENAME" />
          </xsl:for-each>
          <xsl:text disable-output-escaping="yes">&lt;/ns0:Message1></xsl:text>
          <xsl:text disable-output-escaping="yes">&lt;/ns0:Messages></xsl:text>
     </xsl:template>
</xsl:stylesheet>

Hi Abid,
we've tried it with MessageTransformBean, but unfortunately we were'nt able to generate the correct messages for JMS.
If we adapt our original mapping to that one below than we are able to send  2 messages to JMS having the xml-structure. Now, we just have to remove the xml structure. How do we have to configure the Module-Tab? Which one's are the exact parameters we have to use?
new MAPPING:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
     <xsl:output method="xml" encoding="utf-8" />
     <xsl:template match="//resultset">
          <xsl:text disable-output-escaping="yes">&lt;ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge"></xsl:text>
          <xsl:text disable-output-escaping="yes">&lt;ns0:Message1></xsl:text>
          <xsl:for-each select="row">
               <MSG>
                    <xsl:value-of select="NODENAME" />
               </MSG>
          </xsl:for-each>
          <xsl:text disable-output-escaping="yes">&lt;/ns0:Message1></xsl:text>
          <xsl:text disable-output-escaping="yes">&lt;/ns0:Messages></xsl:text>
     </xsl:template>
</xsl:stylesheet>
resulting messages:
<?xml version="1.0" encoding="utf-8" ?><MSG>VALUE_1</MSG>
<?xml version="1.0" encoding="utf-8" ?><MSG>VALUE_2</MSG>
Kind regards, Stefan

Similar Messages

  • The same filename from a sender to a receiver file adapter

    Michal has provided us with a brilliant <a href="/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14.  I guess a lot of people have been waiting to do this. However, I have a slightly different scenario. In this case, XI is used as a medium to transfer a PDF file from one directory to another directory. There is not transformation or mapping involved.
    The message is send by File Sender Adapter and received by File Receiver Adapter. Message type is created as a simply type hexBinary. The file is supposed to be picked up as a PDF and received as a PDF, retaining the same file name. As such, the file name is neither stored in the source structure nor the target structure.
    Once the PDF file is transfered into target directory, it should be able to be open by using Acrobat directly without further conversion.
    We might add a file name file into the target structure but would that rendered the PDF non-readable upon being received by the File Receiver Adapter?
    Any feedback is highly appreciated.

    Hi
    >>We might add a file name file into the target structure but would that rendered the PDF non-readable upon being received by the File Receiver Adapter?
    No, adding file name would not hamper the properties. You can name *.pdf or something else.
    For that matter any file pdf, word, .msg format etc can be transferred by this approach. We have tried it.
    Earlier to SP14 you cannot give the same name to outgoing file without writing a Adapter module. But things are easy with SP14.
    Cheers,
    satish

  • The same filename from a sender to a receiver file adapter - SP14

    Hi Expers,
    I Have Gone through the link which is given bu Michal.
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    Here My Questions are.........
    1.Should we give any file name in the receiver side Adapter in this scenario.?????
    2.How wil be the Sender and Receiver Communication channel Parameters????
      What Are they???????
    Please Clarify me...
    Regards
    Khanna

    Hi Rajesh,
    Is your query related to sending the file name from the source xml document to the reciever file adapter. If so this can be achieved.
    Pls. do the following.
    1. In the mapping program that you are using populate the filename coming from the source into the target root element.
    2.Sender adapters can write adapter-specific attributes to the message header; these can then be evaluated at configuration time
    3. To change the adapter-specific attributes of the message header by using message mappings, you access the required classes of the mapping API by using a mapping runtime constant.
    <b>Note: You donot need to specify any filename in the receiver communication channel.</b>
    To access the classes DynamicConfiguration and DynamicConfigurationKey by using the mapping runtime constant DYNAMIC_CONFIGURATION, use the method getTransformationParameters() of the container object.
    Create an simple user defined function in the mapping and use the following code.
    Imports: com.sap.aii.mapping.api.*;
    Parameter: String filename
    Paramter: String filename;
    filename = fileName + ".DAT";
    DynamicConfiguration conf = (DynamicConfiguration) container
    .getTransformationParameters()
    .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/File", "FileName");
    conf.put(key, filename);
    return filename;
    You donot need to hard code the value of the filename in the file adapter for your interface.
    In SXMB_MONI, when you see the pipeline services you would see that the value of the filename is populated in the message payload.
    Thanks
    Indranil

  • Problem: The same filename from a sender to a receiver file adapter - SP14

    Blog : /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    My Problem:
    The thing works for me and i am able to get my input files name as my output file name. But one thing i noticed is that in my target message, the field where i have mapped the code it always returns the value "null" but finally when the file is created i get the required result.
    My input file name is input.txt and i get the same name in my output file too.
    In sxmb_moni if i check DynamicConfiguration link i see the following
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!-- Response
    -->
    - <sap:DynamicConfiguration xmlns:sap="http://sap.com/xi/XI/Message/30">
    <sap:Record namespace="http://sap.com/xi/XI/System/File" name="SourceFTPHost">10.25.116.98:21</sap:Record>
    <sap:Record namespace="http://sap.com/xi/XI/System/File" name="Directory">/input/test</sap:Record>
    <sap:Record namespace="http://sap.com/xi/XI/System/File" name="SourceFileTimestamp">20060228T112200Z</sap:Record>
    <sap:Record namespace="http://sap.com/xi/XI/System/File" name="FileType">bin</sap:Record>
    <b><sap:Record namespace="http://sap.com/xi/XI/System/File" name="FileName">input.txt</sap:Record></b>
    <sap:Record namespace="http://sap.com/xi/XI/System/File" name="SourceFileSize">770</sap:Record>
    </sap:DynamicConfiguration>
    But when i check my mapped field i see
    <field3>BodyC</field3>
    <keyfield>02</keyfield>
    <field5>BodyE</field5>
    <field6>BodyF</field6>
    </Body>
    - <Trailer>
    <keyfield>03</keyfield>
    <b><field2>null</field2> -> Null value instead of input.txt</b>
    </Trailer>
    </ns0:MT_Putfile>
    The code i have used to map the field2 of the trailer is the following ....
    <i>DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileType");
    String valueOld = conf.get(key);
    return  valueOld;  </i>
    Any clues ?

    Gosh this is spooky
    Anyway i tried with that line of code but it throws me an error during activation ...
    Activation of the change list canceled Check result for Message Mapping mm_IS | http://t-systems.com/Shabarish:  Starting compilation  Source code has syntax error:  /usr/sap/TXT/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Map387c7300a9ac11da9d280011256afae8/source/com/sap/xi/tf/_mm_IS_.java:104: cannot resolve symbol symbol : method getTransformationParameters () location: interface com.sap.aii.mappingtool.tf3.rt.GlobalContainer DynamicConfiguration conf = (DynamicConfiguration) container.getGlobalContainer().getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION); ^ 1 error
    The code is :
    DynamicConfiguration conf = (DynamicConfiguration) container.getGlobalContainer().getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    //DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    //String valueOld = conf.get(key);
    String valueOld = conf.toString();
    return  valueOld; 
    Thanx Renjith so far .. but i hope this gets resolved (else i will loose my sleep thinkin abt the situation)

  • Stored Procedure call from JDBC sender for Oracle Database

    Hi,
    I have a requirement to call stored procedure using JDBC sender adapter for retriving data from an Oracle database.
    I need to execute first stored procedure call from Querry SQL statement and then trigger second stored procedure call for confirming the succesful retrival of those records from the update SQL statement.
    Querries:
    1. Can we trigger stored procedure from Update statement of JDBC sender.
    2. Can we call stored procedure from Querry statement, since I have read on other sdn threads that stored procedure calls on Oracle database are not allowed. If not possible to have "Execute stored procedure" would the function call (select * from table(function name)) work same as stored procedure.
    3. In a JDBC sender the Querry statement and Update statement are executed in same session call and same database connection. What happens if the querry statement was not succesful, would the update be still triggered.
    Please note PI does not have direct access to main table and hence the need to have separate stored procedure calls.
    The PI version is PI 7.11 sp4.
    Appreciate your inputs.
    Thanks.
    Siddhesh S.Tawate

    >1. Can we trigger stored procedure from Update statement of JDBC sender.
    I think not possible using update statement.
    > Can we call stored procedure from Querry statement, since I have read on other sdn threads that stored procedure calls on Oracle database are not allowed. If not possible to have "Execute stored procedure" would the function call (select * from table(function name)) work same as stored procedure.
    Yes using select query you can call stored procedure.
    >. In a JDBC sender the Querry statement and Update statement are executed in same session call and same database connection. What happens if the querry statement was not succesful, would the update be still triggered.
    No select and update handles in the same session using the same thread so if one transaction fails update should not proceed.

  • Count Records from JDBC Sender

    Hi Experts,
    I have a requirement to process 80,000 records once a month from MS SQL Server to BW.
    After tuning of server and assigning the XBTM queue for the scenario didnt help much and brings down the J2EE engine everytime.
    Now i am thinking of processing 5000 records at a time in a BPM (in a while loop). But i somehow need to trap the overall number of records which is not always 80k.
    set rowcount 5000 SELECT * table_name where XIProcessed is NULL (SELECT COUNT(*) from table_name) 
    and then sending an UPDATE of XIProcessed flag to get the next 5000 rows in the JDBC sender.
    I somehow need to get the total number of records and the COUNT function will not help as i am getting 5000 rows at a time and not all.
    Thanks

    Hi Siva,
    why do you attempt counting in the BPM and adding all this overhead? Can't you just do that on the Database directly? In Oracle this is fairly easy as you can use the pseudo column rownum to limit your results. A search for rownum and SQL Server shows, that it is not as easy on SQL Server but there are still fairly simple ways to do this.
    Some sources:
    http://blogs.x2line.com/al/articles/173.aspx
    http://www.databasejournal.com/features/mssql/article.php/10894_2244821_2
    http://www.mcse.ms/archive94-2005-3-1502710.html
    From a performance standpoint i'm sure, it will work a lot better than any BPM into which you put 80000 records.
    Regards
    Christine

  • How to use Stored Procedures in JDBC sender side and receiver side

    Hello,
    Can anyone explain how to use stored procedures in configuring the scenario using JDBC adapter at bothe sides sender nad receiver..
    Thanks,
    Soorya

    Hi,
    Refer the below link:
    JDBC:
    Receiver JDBC scenario MS access - /people/sameer.shadab/blog/2005/10/24/connecting-to-ms-access-using-receiver-jdbc-adapter-without-dsn
    /people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30 --> for jdbc receiver: file -JDBC
    Stored Procedures-
    /people/siva.maranani/blog/2005/05/21/jdbc-stored-procedures
    http://www.ics.com/support/docs/dx/1.5/tut6.html
    /people/sriram.vasudevan3/blog/2005/02/14/calling-stored-procs-in-maxdb-using-sap-xi
    http://www.ics.com/support/docs/dx/1.5/tut6.html
    http://java.sun.com/docs/books/tutorial/jdbc/basics/sql.html
    http://www.sqlteam.com/article/stored-procedures-an-overview
    HI in the message mapping structure u need to specify the different action and also u need to specify the procedure name.
    refer the below link which has all the associated action
    http://help.sap.com/saphelp_nw04s/helpdata/en/22/b4d13b633f7748b4d34f3191529946/frameset.htm
    Chirag

  • Same filename from a sender to receiver :: DO we really need UDF ?

    Hi
    This is in refrence of Weblog " <i>same filename from a sender to a receiver file adapter "</i> by <i>Michal Krawczyk</i>.
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    Actually I worked on another weblog by " <i>Shabarish Vijayakumar</i> "-->
    /people/shabarish.vijayakumar/blog/2006/04/03/xi-in-the-role-of-a-ftp
    And I am getting file created on the receiver side with the same file name as on the sender side without using the user-defined function mentioned in Michal's weblog.
    Now my question do we really need UDF for same file name when on the sender we are polling for one file only by its name.
    I am not exaclty getting the benefit of this feature. Can you tell me why do we need this feature as in whatever scenarios I worked I mentioned the file names in both Sender & Receiver File Adapters.
    So I am not getting what is the use of using this UDF, when we mention the name of file needs to be created on Receiver side.
    - Lalit Chaudhary -

    Hi
    I put this code for UDF -->
    <i>String valueNew;
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String valueOld = conf.get(key);
    if (valueOld != null)
        valueNew = valueOld.replaceAll("input123",name);
        conf.put(key, valueNew);
    return valueNew;</i>
    Signature of UDF is this :: <u>public String GetFileName(String name,Container container)</u>
    But when I am testing this UDF, I am getting following RunTime exception -->
    <i>Runtime exception during processing target field mapping /ns0:FileFTP_InOut_MT/File_nm. The message is: Exception:[java.lang.NullPointerException] in class com.sap.xi.tf._FileFTP_MsgMapping_UDF_ method GetFileName$[lalit, com.sap.aii.mappingtool.tf3.rt.Context@735df3b0] com.sap.aii.mappingtool.tf3.MessageMappingException: Runtime exception during processing target field mapping /ns0:FileFTP_InOut_MT/File_nm. The message is: Exception:[java.lang.NullPointerException] in class com.sap.xi.tf._FileFTP_MsgMapping_UDF_ method GetFileName$[lalit, com.sap.aii.mappingtool.tf3.rt.Context@735df3b0]</i>
    I am not much of Java Guy, can you pls. suggest what am I doing wrong, I copied this code from <a href="http://help.sap.com/saphelp_nw04/helpdata/en/43/03612cdecc6e76e10000000a422035/content.htm">SAP Help</a>
    - Lalit -

  • JDBC Sender Adapter

    Hi everybody
    I have the following error in my JDBC to JDBC scenario; I  configured the JDBC sender adapter and receive the following message back. In the Configuration I set “Document Name” to MT_ScanningStatus:
      <?xml version="1.0" encoding="utf-8" ?>
    <MT_ScanningStatus>
    <row>
      <ScannerNb>1</ScannerNb>
      <Status>0</Status>
      </row>
    <row>
      <ScannerNb>2</ScannerNb>
      <Status>2</Status>
      </row>
    <row>
    <ScannerNb>3</ScannerNb>
      <Status>0</Status>
      </row>
    <row>
      <ScannerNb>4</ScannerNb>
      <Status>2</Status>
      </row>
      </MT_ScanningStatus>
    I defined the  corresponding datatype as follow:
    DT_ScanningStatus Complex Type
            row              Element 1...unbounded
              ScannerNb      Element 1
              STatus         Element 1
    In the following Mapping I tried to Map this structure to the Structure used to send an Update SQL Statement to the JDBC Receiver to update the same table.  A normal Test in the Mapping Tool runs fine but when I enter under source the above incoming Message from the JDBC Adapter I got the following error. I think the incoming message cannot be interpreted. Can someone support me? I read the documentation for the JDBC adapter and also a lot of weblogs and discussion threads. Maybe someone knows a weblog describing more detailed the sender adapter and how to handle the incoming Message!!
    Thanks in advance Oliver
    14:58:03 Start of test
    Compilation of MM_JDBC_to_JDBC_test successful
    Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XML Declaration not allowed here.(:main:, row:1, col:8)
    com.sap.aii.utilxi.misc.api.BaseRuntimeException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XML Declaration not allowed here.(:main:, row:1, col:8)
    at com.sap.aii.mappingtool.tf3.rt.xparser.MTSaxHandler.run(MTSaxHandler.java:130)
    at com.sap.aii.mappingtool.tf3.rt.xparser.XParser.run(XParser.java:68)
    Root Cause:
    com.sap.engine.lib.xml.parser.NestedSAXParserException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XML Declaration not allowed here.(:main:, row:1, col:8)(:main:, row=1, col=8) -> com.sap.engine.lib.xml.parser.ParserException: XML Declaration not allowed here.(:main:, row:1, col:8)
    at com.sap.engine.lib.xml.parser.XMLParser.scanPI(XMLParser.java:2009)
    at com.sap.engine.lib.xml.parser.XMLParser.scanProlog(XMLParser.java:2657)
    at com.sap.engine.lib.xml.parser.XMLParser.scanDocument(XMLParser.java:2713)
    at com.sap.engine.lib.xml.parser.XMLParser.parse0(XMLParser.java:162)
    at com.sap.engine.lib.xml.parser.AbstractXMLParser.parseAndCatchException(AbstractXMLParser.java:132)
    at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:142)
    at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:245)
    at com.sap.engine.lib.xml.parser.Parser.parseWithoutSchemaValidationProcessing(Parser.java:276)
    at com.sap.engine.lib.xml.parser.Parser.parse(Parser.java:338)
    at com.sap.engine.lib.xml.parser.SAXParser.parse(SAXParser.java:125)
    at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
    at com.sap.aii.mappingtool.tf3.rt.xparser.MTSaxHandler.run(MTSaxHandler.java:128)
    at com.sap.aii.mappingtool.tf3.rt.xparser.XParser.run(XParser.java:68)
    at com.sap.engine.lib.xml.parser.SAXParser.parse(SAXParser.java:144)
    at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
    at com.sap.aii.mappingtool.tf3.rt.xparser.MTSaxHandler.run(MTSaxHandler.java:128)
    at com.sap.aii.mappingtool.tf3.rt.xparser.XParser.run(XParser.java:68)
    Caused by: com.sap.engine.lib.xml.parser.ParserException: XML Declaration not allowed here.(:main:, row:1, col:8)
    at com.sap.engine.lib.xml.parser.XMLParser.scanPI(XMLParser.java:2009)
    at com.sap.engine.lib.xml.parser.XMLParser.scanProlog(XMLParser.java:2657)
    at com.sap.engine.lib.xml.parser.XMLParser.scanDocument(XMLParser.java:2713)
    at com.sap.engine.lib.xml.parser.XMLParser.parse0(XMLParser.java:162)
    at com.sap.engine.lib.xml.parser.AbstractXMLParser.parseAndCatchException(AbstractXMLParser.java:132)
    at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:142)
    at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:245)
    at com.sap.engine.lib.xml.parser.Parser.parseWithoutSchemaValidationProcessing(Parser.java:276)
    at com.sap.engine.lib.xml.parser.Parser.parse(Parser.java:338)
    at com.sap.engine.lib.xml.parser.SAXParser.parse(SAXParser.java:125)
    ... 3 more
    Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XML Declaration not allowed here.(:main:, row:1, col:8)

    Hi Oliver,
    >>>>source the above incoming Message from the JDBC Adapter I got the following error. I think the incoming message cannot be interpreted.
    do this:
    in the test tab try your mapping once more
    (the correct one)
    then save the source xml as file
    next compare this saved file with the one
    you get from the jdbc sender
    >>>>>Declaration not allowed here.(:main:, row:1, col:8)
    and compare the first lines in those two XML files
    are they the same?
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

  • Significance of Document Name in JDBC Sender

    hi folks,
    tell me what exactly mean by the Document Name parameter in the JDBC Sender adapter? where does that plays?
    thanks
    nikhil bos

    > tell me what exactly mean by the Document Name
    > parameter in the JDBC Sender adapter? where does
    >  that plays?
    If you created MT_JDBC_Sender (for Example)
    Go to IR and Test your mapping..then take the input message from there and paste it to the Notepad...you will find the Root Element will be
    <<b>MT_Sender_JDBC</b> >
      <row>
    <>
    </MT_Sender_JDBC >
    now when you configured the JDBC adapter then by defalut the Document Name is <b>resultset</b>
    so XML from From JDBC sender adapter will come in this format.:
    <<b>resultset</b> >
      <row>
    <>
    </<b>resultset</b> >
    So coming XML does not match with the structure that u define..so finally need to overide the name of the defult document namespace so that it will not fail at runtime:-)
    Thanks
    Farooq.

  • JDBC Sender OS Command

    Hi All,
              I want to know where the operating system command runs when used  in jdbc sender adapter , In PI or in the database after executing the sql queries? I am wondering if i can use a Stored procedure through a script in database. Any help appreciated .And forgive me for my ignorance Thanks.

    What you can do is :
    Create a multi Mapping.
    JDBC Sender DT - JDBC Receiver STored Procedure DT and
    JDBC Sender DT - Actual Receiver .
    Key points to remember is , on Interface Determination .. maintain  order runtime ..... this will help to execute first Stored procedure then your actual target ,  if stored procedure fails then other interface will also not execute as maintain runtime order is checked.
    REgards
    PS

  • Send Idoc flat file message in JMS receiver adapter

    Hello,
    I am working on a scenario where we send Delvry 03 idoc from ECC to external system. To external system, we send the whole Idoc in flat file structure through JMS queue. I have used Idoc to flat file program in my interface mapping and have configured JMS receiver adapter with just default Module configs but, I am getting an error in communication channel monitoring for the messages.
    Please note that Idoc xml to flat file structure conversion is already done in the mapping, I need to just pass this idoc flat structure in the jms adapter. Hence ther eis no content conversion i nthe adapter..
    Please give some inputs..Here are the modules in my receiver adapter and nothing else..
    SAP XI JMS Adapter/ConvertMessageToBinary
    SAP XI JMS Adapter/SendBinarytoXIJMSService
    The error I get is in audit log
    Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: No transition found from state: ERROR, on event: process_commence for DFA: CC_JMS_R:ca336a6689f837da8bd3387140fc4447
    in turn the message has this error if I open the message
    Whitespace is not allowed at this location. Error processing resource 'http://host:port/mdt/messageconten...
    and it shows one of the lines from idoc..flat file
    Any idea is greatly appreciated..Thank you..Thanujja

    The difference in what I suggest is that it is way simpler.
    Maybe you did not understand this, so will try to explain it better. Its not the best thing to do, but if JMS adapter doesn't budge then you can give it a shot.
    1. You continue to use the ABAP mapping in your interface mapping to map the Idoc xml to Idoc flat.
    2. Write a Java Map that will take the output of the ABAP mapping ; and then create a XML output which would be something like,
    <Root>
    <Idoc_Flat>
    <Data>ABAP Mapping Output<Data>
    </Idoc_Flat>
    </Root>
    3. Now use the simple content conversion in the JMS adapter to convert this to flat file.
    Regards
    Bhavesh

  • JDBC(Sender)-XI-RFC (Request) RFC (Response)-XI-JDBC(Receiver)

    Hi All,
    JDBC(Sender)-XI-RFC (Request)
    RFC (Response)-XI-JDBC(Receiver).
    Need some solution for sending email for successfully completion of scenario after updating SQL DB Table.
    Let me explain the scenario:
    We are pooling the SQL DB table to pull the records and map the records to RFC request parameters, after successful Posting the entries in R3 HR, RFC response contain the same with E (Error) S (Success) records status, we are updating the same in SQL DB table, I implemented the complete scenario without BPM with the help of module processor in Sending JDBC Adapter, scenario is working fine but now we have to send the successful mail to our support team with status contain Number of success, Error and total records as email.
    I need the solution how to implement the same requirement in current scenario.
    Is their way to do something with the RFC receiver adapter module addition to send the successful mail or generating Alert with all the description?
    I am at PI 7.0 SP12 with HP unix box.
    Thanks in Advance for creative idea
    With Regards
    Sunil

    Hi Bhavesh,
    Thanks for your help and your blog is really helpful. I implemented the UDF for generating Email Alert but this alert is generating before Updating the SQL Database, is their any way to generate alert after updating the SQL.
    Actually in my scenario we are sending the data from SQL to R3 by RFC and again updating the SQL status whatever the RFC return, after successfully updating SQL we need to send success email to support people but if we are sending the email before updating the DB then their will be problem.
    JDBC receiver after updating the SQL DB returns the response with No. of row updated but how to capture this response, if we can capture this response then we can send email through email adapter even their is one more problem, In my scenario I am counting the number of rows with status “S” and “E” and sending the same in alert email but if are sending email after updating the SQL DB where can hold the row count value and use it while sending the email.
    Implemented the scenario without using BPM..i am using sender JDBC module processor for Syn-Asyn bridge.
    Even I do not find the link to reward point. Please let me know how to do it.
    With Regards
    Sunil

  • JDBC Sender and Receiver

    Hello:
    I have an scenario FILE-to-FILE and it's working ok. So now I want to change it into FILE-to-JDBC so I thought just to change the Communication Channel RECEIVER, instead of file, use JDBC adapter.
    I've read this blog <a href="/people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30 to JDBC Adapter using SAP XI 3.0</a> but I don't have clear where tu place the SQL Insert statement, or to know which table to affect. I am using this settings on the RECEIVER communication channel:
    Adapter type: JDBC
    Transfer Protocol : JDBC 2.0
    Message Protocol : XML SQL Format
    -- Database Connection --
    JDBC Driver : net.sourceforge.jtds.jdbc.Driver
    Connection: jdbc:jtds:sybase://alma.mex.sap.corp:2638/demo
    I've noticed thta if the Communication channel is SENDER, I do get a parameter called Update SQL Statement, but it's not there when it's  a RECEIVER, why is that?
    Greetings!
    Alejandro

    Thanks for the info
    Reading the help site, I find that the xml message must have a certain structure, that will be interpreted by the database. If I want to send an INSERT, I would have an xml message like this:
    [code]
    <root>
      <stmt>
        <Customers action="SQL_DML">
          <access> UPDATE Customers SET CompanyName=’$NAME$’, Address=’$ADDRESS$' WHERE CustomerID='$KEYFIELD$’
          </access>
          <key>
            <NAME>Company</NAME>
            <ADDRESS>Street 3 </ADDRESS>
            <KEYFIELD>CO</KEYFIELD>
          </key>
        </Customers>
      </stmt>
    </root>
    [/code]
    And as I understand I <b>must define those fields</b> on my data type XSD so the mesagge from the sender arrives with this structure right?
    so I created an XSD like this
    [code]
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn://alex.com/ftp001" targetNamespace="urn://alex.com/ftp001">
         <xsd:complexType name="JDBC_DATA_TYPE_001">
              <xsd:sequence>
                   <xsd:element name="root">
                        <xsd:annotation>
                             <xsd:appinfo source="http://sap.com/xi/TextID">
                             89e2af209ce511dbaf580015587b9f42
                             </xsd:appinfo>
                        </xsd:annotation>
                        <xsd:complexType>
                             <xsd:sequence>
                                  <xsd:element name="smtp">
                                       <xsd:annotation>
                                            <xsd:appinfo source="http://sap.com/xi/TextID">
                                            89e520209ce511dbc9230015587b9f42
                                            </xsd:appinfo>
                                       </xsd:annotation>
                                       <xsd:complexType>
                                            <xsd:sequence>
                                                 <xsd:element name="Person">
                                                      <xsd:annotation>
                                                           <xsd:appinfo source="http://sap.com/xi/TextID">
                                                           89e520219ce511db832b0015587b9f42
                                                           </xsd:appinfo>
                                                      </xsd:annotation>
                                                      <xsd:complexType>
                                                           <xsd:sequence>
                                                                <xsd:element name="access" type="xsd:string">
                                                                     <xsd:annotation>
                                                                          <xsd:appinfo source="http://sap.com/xi/TextID">
                                                                          89e520239ce511db99c60015587b9f42
                                                                          </xsd:appinfo>
                                                                     </xsd:annotation>
                                                                </xsd:element>
                                                                <xsd:element name="key">
                                                                     <xsd:annotation>
                                                                          <xsd:appinfo source="http://sap.com/xi/TextID">
                                                                          89e520249ce511db95d80015587b9f42
                                                                          </xsd:appinfo>
                                                                     </xsd:annotation>
                                                                     <xsd:complexType>
                                                                          <xsd:sequence>
                                                                               <xsd:element name="FirstName" type="xsd:string">
                                                                                    <xsd:annotation>
                                                                                         <xsd:appinfo source="http://sap.com/xi/TextID">
                                                                                         89e520259ce511db81520015587b9f42
                                                                                         </xsd:appinfo>
                                                                                    </xsd:annotation>
                                                                               </xsd:element>
                                                                               <xsd:element name="LastName" type="xsd:string">
                                                                                    <xsd:annotation>
                                                                                         <xsd:appinfo source="http://sap.com/xi/TextID">
                                                                                         89e520269ce511dba6d30015587b9f42
                                                                                         </xsd:appinfo>
                                                                                    </xsd:annotation>
                                                                               </xsd:element>
                                                                               <xsd:element name="Age" type="xsd:string">
                                                                                    <xsd:annotation>
                                                                                         <xsd:appinfo source="http://sap.com/xi/TextID">
                                                                                         89e520279ce511dbc9070015587b9f42
                                                                                         </xsd:appinfo>
                                                                                    </xsd:annotation>
                                                                               </xsd:element>
                                                                          </xsd:sequence>
                                                                     </xsd:complexType>
                                                                </xsd:element>
                                                           </xsd:sequence>
                                                           <xsd:attribute name="action" type="xsd:string">
                                                                <xsd:annotation>
                                                                     <xsd:appinfo source="http://sap.com/xi/TextID">
                                                                     89e520229ce511db82120015587b9f42
                                                                     </xsd:appinfo>
                                                                </xsd:annotation>
                                                           </xsd:attribute>
                                                      </xsd:complexType>
                                                 </xsd:element>
                                            </xsd:sequence>
                                       </xsd:complexType>
                                  </xsd:element>
                             </xsd:sequence>
                        </xsd:complexType>
                   </xsd:element>
              </xsd:sequence>
         </xsd:complexType>
    </xsd:schema>
    and I must send the SQL Query statement in the ACCESS node.
    Right?
    Thanks
    Alejandro
    [/code]

  • BPM Question: JDBC Sender to RFC to JDBC Receiver

    I have the following requirement:
    JDBC Sender Adapter (by nature Asynchronous) – SELECT multiple rows from a table
    To…
    RFC Receiver Adapter (Synchronous)
    To…
    JDBC Receiver Adapter (Synchronous) – UPDATE multiple rows in a table
    Then…
    IF <SAP:Error> XML is returned from the JDBC Receiver Adapter, I want to either issue a CCMS alert, or utilize the XI Email Adapter for error notification. 
    ELSE, if <root_response> XML is returned from the JDBC Receiver Adapter, do nothing.
    This obviously requires a BPM.  If I use the JDBC Receiver Adapter Asynchronously (with no error handling) this is a piece of cake.  But after trying to use it synchronously along with error handling logic, I am stuck.
    This issue that I am facing is how to logically handle the JDBC Receiver Adapter Response XML in the BPM.  I would like to know what I need to do in the BPM in order to issue a CCMS alert (and/or send a message through the XI Email Adapter) ONLY if the <SAP:Error> XML is returned. 
    Below are examples of the 2 types of response messages that I would receive back from the JDBC Receiver:
    Error:
      <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
      <!--  Call Adapter -->
      <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
      <SAP:Category>XIAdapterFramework</SAP:Category>
      <SAP:Code area="MESSAGE">GENERAL</SAP:Code>
      <SAP:P1 />
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText>com.sap.aii.af.ra.ms.api.DeliveryException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'SAP_OrderImport' (structure 'StatementName2'): java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Violation of PRIMARY KEY constraint 'PK_SAP_OrderImport'. Cannot insert duplicate key in object 'SAP_OrderImport'.</SAP:AdditionalText>
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack />
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    Success:
      <?xml version="1.0" encoding="utf-8" ?>
      <root_response>
      <StatementName1_response>
      <update_count>1</update_count>
      </StatementName1_response>
      </root_response>
    I have searched SDN for a while but did not find anything that specifically addressed this.  I would appreciate any help…

    Hi,
    In ur BPM wrap the jdbc send step with a exception block. in the exception block define a control step to throw an alert.
    so when the jdbc step fails, the exception is caught and an alert is generated by the control step.
    cheers,
    naveen

Maybe you are looking for