Empty Segment handling  in XSLT

Hi All,
  I have a strange requirement as below
   --> PI is getting data from R3 system by ABAP proxy and the whole XML proxy structure should be mapped to one of the target field (SOAP call). i have done this by using XSLT mapping and everything is working fine.I am able to pass the whole XML data into SOAP call.
  --> Now, i am not supposed to empty segments in the XML which i am passing to target. It means that if all fields of a segment is blank, i should not send the corresponding segment to XML.
For an example,
     < Employee >
           < Job/ >
          < Location/>
           <Contact/>
   < / Employee>
This case, segment < Employee >should not be sent along with XML structure.
---> Second case,
< Employee >
           < Job/> Consulting <Job/>
          < Location/>
           <Contact/>
   < / Employee
In this case, i have send only segment  < Employee > with only< Job/> Consulting <Job/> field.
Please note the XML structure is very complex with 150 fields and nested
How should i achive this?
Edited by: Rajesh on Jun 12, 2009 8:21 PM
Edited by: Rajesh on Jun 12, 2009 8:22 PM

Thanks for the response.
1)We cannot handle this case in ABAP PROXY due to some restriction. I would like to handle this in PI mapping step.
2)But the thing here is i would like to handle all these logic in XSLT mapping. I knows that combination of Graphical and XSLT mapping will handle this.
Is there any way to do this?

Similar Messages

  • Receiver File adapter - 'Empty Message Handling' option to ignore not worki

    Hi,
      I am trying to create the Files in receiver based on condition.But I am gettiung error in communication channel when there is no payload. Receiver I am usuing FCC and processing tab I selected -'Empty Message Handling' option to ignore .
    one source -> Target 1 (0..1 occurance in signature tab changed, message mapping and operation mapping)
                 and Target 2 (0..1 occurance in signature tab changed)
    and I put the message type level condition. While creating first message If did not create the Message type in my maaping still my Receiver File communication channel is giving error. even thow I my receiver interface occurance is 0..1
    Right now I am in PI7.1 and SP7 is the bug for support pack do I am missing any thing. and do I need to upgrade any nwe patch. appreciate your help.
    Regards,
    Venu.

    Hi,
    here is the my requirment one source -> two target interfacess (0..1)
    If u have 2 target interfaces,then this is not suffice..... u should make it as 0..unbounded both in operation mapping and message mapping.
    But based on ur requirements posted above i guess u have only one inbound interface at a time based on some conditions....
    But,
    <messages>
    <messages1>
    based on condition first message type not created in mapping.
    <messgaes2>
    The error u r getting is because.... u want only one interface in target at a time....
    Then u should not generate Message1 also in the target.
    So avoid mapping to message1 if u want only message2.
    If both message1 and message2 are created in target means... it is triggering for two interfaces.... so avoid one message1 or message2... based on some conditions u have..
    Still nt solved do post...
    Babu

  • Receiver file adapter creates empty files, Empty-Message Handling SP19

    Hello,
    We have just upgraded the system to SP19.
    One of the new features is that it should be possible to determine how XI messages with an empty main payload are to be handled in the receiver file adapter.
    If the parameter Empty-Message Handling is set to 'Ignore' no file should be created if the main payload is empty. In our case an empty file (size 0 kb) is still created even though the main payload is empty and the flag is set to 'Ignore'.
    Has anybody experienced the same problem?
    //  Best regards  Hans

    This should work:
    Use your own adapter module that parses incoming message and checks if it has any record sets in the document. If it does not have any record sets, then set the message to empty and then give this modified message to File receiver.
    For example, see the example code below:
    Module imports..
    Audit log import..
    DOM imports/SAX imports..
    public ModuleData process(ModuleContext moduleContext, ModuleData inputModuleData) throws ModuleException {
              try {
                   // get the XI message from the environment
                   Message msg = (Message) inputModuleData.getPrincipalData();
                   AuditMessageKey amk = new AuditMessageKey(msg.getMessageId(),AuditDirection.INBOUND);
                   Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS,"RemoveRootTag: Module called");
                   XMLPayload payLoad = msg.getDocument();
                   Document doc = parseXmlFile(payLoad.getInputStream());
                   if(doc != null){
                        if(!doc.getDocumentElement().hasChildNodes()){
                             Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "Document is empty!!");
                             payLoad.setContent("".getBytes());
                             msg.setDocument(payLoad);
                   // provide the XI message for returning
                   inputModuleData.setPrincipalData(msg);
                   } catch (Exception e) {
                   // raise exception, when an error occurred
                   ModuleException me = new ModuleException(e);
                   throw me;
                   // return XI message
              return inputModuleData;
         private Document parseXmlFile(InputStream xmlpayload) {
              try {
                   DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                   factory.setValidating(false);
                   //        Create the builder and parse the file
                   Document doc = factory.newDocumentBuilder().parse(xmlpayload);
                   return doc;
              } catch (SAXException e) {
              } catch (ParserConfigurationException e) {
              } catch(IOException e){
              return null;

  • Problem with „Empty-File Handling" in PI 7.11

    Hi,
    Iu2019m working in PI 7.11 with file adapter, Sender CC, option: Empty-File Handling: Process Empty Files.
    What I want to do is giving target file the system-date, if the source file is empty.
    But I always get a mapping error in RTWB: Premature end of file.
    It seems that the payload is empty.
    Any idea?
    Thanks a lot in advance!
    Rene Dong
    Edited by: Rene Dong on Aug 31, 2010 4:20 PM

    What I want to do is giving target file the system-date, if the source file is empty.
    The error you are getting makes sense. You should do a check in the mapping, if the payload is empty then use brute force to pass the system date.

  • Empty File Handling in xLink adapter

    Helloo Experts
    I am doing a scenario, which creates an empty file(when some mapping condition doesnt satisfy).
    I dont want to write this empty file in the target directory.
    This can be handled if a file adapter is used, but I am using a SOAP AXIS adapter, so I dont know how to handle this here.
    I alaso tried using the StrictXml2PlainBean to avoid the creation, it creates 0 documents and a 0kb empty file.
    Can anyone please let me know how this can be solved????
    Also if some one has done this empty file handling in J2SE file adapter...can you tell how it was done.
    Thanks a lot!!!!!!
    Regards
    Shobha

    Hi Gabriel,
                       You can write a simple script to copy a file from source folder to target in case the fiel size is ZERO bytes. The script will not copy the file if the filesize is more than zero bytes, This will be processed normally by PI server. You can call the script from sender communication channel parameter : "RUN OS command before message processing". Could you please specify the Operating System (OS) you are using in your PI server.
    Regards
    Anupam

  • ***Empty File handling,sender .txt file

    Hi All,
    Can we use the option Empty file Handle if the sender is a text file.
    if so how to achieve this.
    Thanks,
    Srinivasa

    Hi,
    Refer the section of 'Empty File Handling' from the below link:
    http://help.sap.com/saphelp_nw70/helpdata/en/e3/94007075cae04f930cc4c034e411e1/content.htm
    You will get the required result.
    Regards,
    Supriya.

  • Empty File Handling : Do Not Create Message

    Hi,
    I have set this option in Sender CC - file.
    Parameters --> Processing.
    I dont want to pass file to reciever , when file is empty.
    Will the above option  "Do Not Create Message" do the trick.
    OR do i need to choose something else??
    -santosh.

    Santosh,
    Yes. The trick will work for empty file handling.
    When your incoming file is empty then will be no xml message posted to IE and hence receiver will not get any message.
    FYI: Also you can use skip empty files which will do the same but here the files will remain in your source directory.
    Regards,
    Prasanthi.

  • Empty-Message Handling is not working in receievr File Adapter

    Hi All,
    I have selected "Empty-Message Handling" = 'Ignore'in Receiver File adapter, but still empty files are creating in target directory.
    Message mapping generates output based on the conditon, if the condition is 'false' mapping will generate empty file (no data is being mapped).
    Why Receiver file adapter is processing empty fiels even i set 'ignore' empty fiels in configuration (ID)?
    Hoe can i manage not to place empty fiels in target directory?
    File type is '.txt'
    Your help would be appreiciated greatly.
    Thanks,
    Rajesh

    Not sure why is it not working. Make sure the channel is activated and cache is refreshed properly. But as a workaround you may use OS script checking for size of message and deleting it or configure a BPM to avoid the file creation. Or else an adapter module as shown
    /people/gowtham.kuchipudi2/blog/2006/01/13/stop-creation-of-an-empty-file-from-file-adapter-using-module
    Regards,
    Prateek

  • Recevier adapter empty message-handling ignore

    Hi all,
    I configured file receiver adapter with file content conversion (comma separated).
    In processing parameters Empty-message handling is set to Ignore.
    Payload that is in message generated from SAP is:
      <?xml version="1.0" encoding="utf-8" ?>
         <mt_ap_invoice xmlns:prx="urn:sap.com:proxy:DES:/1SAI/TAS128FC2C2C3C8E901DC22:700:20 08/06/25" />
    There are no any data that is filling structure (structure main node is defined as 0...unbounded) and still empty file with 0 bytes is created.
    Please can you tell what is wrong in this setup as In case of empty message I don't want that file is generated?
    Regards,
    Nenad

    - open Integration Builder
    - open your file receiver adapter
    - go to tab Processing
    - change Empty Message-Handling to 'Ignore'
    Cheers,
    André

  • Empty Message Handling with Receiver File adapter

    Hi,
         We were using the "Empty-Message-Handling" (status set to Ignore) of Receiver file adapter to stop a 0 KB file from being written to the specified directory.
    However, inspite of this, a 0KB file continues to be written.
    The specifications are given below-
    File Construction Mode - Add Time Stamp
    Put File - Directly
    Empty Message Handling - Ignore
    Maximum Concurrency - 1
    File Type - Binary
    Can anyone please help with this.
    Thanks and Regards,
    Shiladitya

    HI,
    In one of thread the same problem was coming. Just look at the thread.
    Receiver file adapter creates empty files, Empty-Message Handling SP19
    Or
    Follow the weblog for the same requirement.
    /people/gowtham.kuchipudi2/blog/2006/01/13/stop-creation-of-an-empty-file-from-file-adapter-using-module
    Thnx
    Chirag
    Reward points if it helps.

  • Handling EMPTY NAMESPACES IN BPEL XSLT

    Hello,
    I am getting following response in XSLT. I would like to remove xmlns:"" from my response. Any help is greatly appreciated.
    <?xml version="1.0" encoding="UTF-8" ?><Envelope xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://schemas.xmlsoap.org/soap/envelope/">
       <ns1:Header>
          <ns0:eiContext xmlns:ns0="http://ei.xxxxxx.com/schemas/envelope/v3_0" xmlns="http://ei.xxxxxx.com/schemas/envelope/v3_0">
             <ns0:ei>
                <ns0:type>request</ns0:type>
                <ns0:service>
                   <ns0:name>pendingTransactionProcessor</ns0:name>
                   <ns0:version>1.0</ns0:version>
                </ns0:service>
                <ns0:originator>EIDev</ns0:originator>
                <ns0:businessProcessName>default</ns0:businessProcessName>
                <ns0:servicerInfo/>
                <ns0:requestDateTime>2013-03-21T23:10:47.450Z</ns0:requestDateTime>
                <ns0:sequenceNumber>001.001</ns0:sequenceNumber>
                <ns0:user>
                   <ns0:id>EIDev</ns0:id>
                   <ns0:group>Selfcare</ns0:group>
                </ns0:user>
                <ns0:transactionReference>20130606PTPTest002</ns0:transactionReference>
                <ns0:expirationSeconds>120</ns0:expirationSeconds>
                <ns0:additionalParameters>
                   <ns0:param>
                      <ns0:name>accountId</ns0:name>
                      <ns0:value>332602</ns0:value>
                   </ns0:param>
                   <ns0:param>
                      <ns0:name>targetService</ns0:name>
                      <ns0:value>modifyReceiverPS</ns0:value>
                   </ns0:param>
                   <ns0:param>
                      <ns0:name>targetServiceVersion</ns0:name>
                      <ns0:value>4.0</ns0:value>
                   </ns0:param>
                </ns0:additionalParameters>
             </ns0:ei>
             <ns0:context>
                <PTPContext xmlns="">
                   <PTPRequestStatus>ASYNC_PROCESS</PTPRequestStatus>
                </PTPContext>
             </ns0:context>
          </ns0:eiContext>
       </ns1:Header>
    </Envelope>

    Hi,
    Use below XSLT logic to remove empty namespaces,
    <xsl:stylesheet version="1.0" ">
    <xsl:output omit-xml-declaration="yes" indent="yes"/>
    <xsl:strip-space elements="*"/>
       <xsl:template match="*">
       <xsl:element name="{name()}" namespace="{namespace-uri()}">
       <xsl:copy-of select="@*|namespace::*[name()]"/>
       <xsl:apply-templates select="node()"/>
       </xsl:element>
    </xsl:template>
    </xsl:stylesheet>
    -Santosh

  • Receiver AS2 Adapter : Empty Message Handling

    Hello Experts ,
    We are trying to work on following requirement .
    File -> PI -> AS2 ( File) ( We are using Pranke to drop our message to the receiver system) (MDN ack too is in place )
    There are times when none of the source records are valid and we have an empty payload post mapping.
    In AS2 adapter we are using StrictXML2Plain.
    Scenario works fine for all target messages which have data and a file is created at the receiver end. MDN ACK works fine too.
    Problem is when we have empty target payloads , We get following error in communication Channel monitoring.
    Information
    SEEBURGER/AttribMapper: Finished succesfully, 1 properties set or deleted
    Information
    MP: processing local module localejbs/ModuleProcessorExitBean
    Information
    Message entered AF MP exit bean and will be passed to the JCA adapter now.
    Information
    SEEBURGER/AS2: Received order from system.
    Error
    Message could not be forwarded to the JCA adapter. Reason: Fatal exception: javax.resource.ResourceException: SEEBURGER AS2: org.apache.commons.httpclient.NoHttpResponseException: The server as2gw.pranke.com failed to respond # , SEEBURGER AS2: org.apache.commons.httpclient.NoHttpResponseException: The server as2gw.pranke.com failed to respond #
    Error
    MP: exception caught with cause javax.resource.ResourceException: Fatal exception: javax.resource.ResourceException: SEEBURGER AS2: org.apache.commons.httpclient.NoHttpResponseException: The server as2gw.pranke.com failed to respond # , SEEBURGER AS2: org.apache.commons.httpclient.NoHttpResponseException: The server as2gw.pranke.com failed to respond #
    Error
    Adapter Framework caught exception: Fatal exception: javax.resource.ResourceException: SEEBURGER AS2: org.apache.commons.httpclient.NoHttpResponseException: The server as2gw.pranke.com failed to respond # , SEEBURGER AS2: org.apache.commons.httpclient.NoHttpResponseException: The server as2gw.pranke.com failed to respond #
    Has anyone handled such situation ? Is there any workaround at the SAP end to handle this issue ?
    Or is this to be handled at the Pranke end ?
    Attaching the Seeburger AS2 monitor error as well for empty messages ,
    State
    Error on send, will be retried
    Status Description
    Could not deliver as2 message to partner: org.apache.commons.httpclient.NoHttpResponseException: The server as2gw.pranke.com failed to respond # null
    Little urgent and your expertise is appreciated PI geeks
    Sayalee

    Hi,
    here is the my requirment one source -> two target interfacess (0..1)
    If u have 2 target interfaces,then this is not suffice..... u should make it as 0..unbounded both in operation mapping and message mapping.
    But based on ur requirements posted above i guess u have only one inbound interface at a time based on some conditions....
    But,
    <messages>
    <messages1>
    based on condition first message type not created in mapping.
    <messgaes2>
    The error u r getting is because.... u want only one interface in target at a time....
    Then u should not generate Message1 also in the target.
    So avoid mapping to message1 if u want only message2.
    If both message1 and message2 are created in target means... it is triggering for two interfaces.... so avoid one message1 or message2... based on some conditions u have..
    Still nt solved do post...
    Babu

  • Empty File Handling in  SAP XI------Urgent

    Hi Frnds,
      1)  I have  one doubt XI will support Empty file processing. Suppose in my scenario
    In sender side i am having Empty file i want to process this file , what are necessary steps i need to take.
    2) In my scenario XI will support only 10mb file processing at a time, But in sender side i am having 20 mb file. How to transfer the file without splitting.

    hi raja
    Regarding empty file processing
    Handling of Empty Files
    Specify how empty files (length 0 bytes) are to be handled.
    &#9675;       Do Not Create Message
    No XI messages are created from empty files.
    The files are processed according to the selected processing mode.
    For example, if the processing mode is Delete, empty files are deleted in the source directory.
    &#9675;       Process Empty Files
    XI messages are created with an empty main payload.
    The files are processed according to the selected processing mode.
    &#9675;       Skip Empty Files
    No XI messages are created from empty files.
    Empty files are skipped and remain in the source directory.
    Also refer this link
    http://help.sap.com/saphelp_nw70/helpdata/EN/ae/d03341771b4c0de10000000a1550b0/frameset.htm
    This is done at ID in sender File Adapter Configuration of the communication.
    Regards
    Ramesh  P

  • Empty file handling in file?

    hi
    Q: how to handle empty file in sender/reciver file adapter?
    Thanks&Regards
    upendra kumar

    Upendra,
    You have an option in the communication channels. Just go through this help:
    http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm
    ...Satish

  • Empty File handling and raise alert.

    Hi,
    We have requirement where we are doing file pass through. But client wants PI to raise alert when it receives 0 byte file.
    How can we achieve this using File/FTP/SFTP adapter when we are not reading the actual payload and doing only pass thru?
    Thanks,
    Vertika

    Hi Vertika,
    AFAIK - there is no standard way for pass through interface to raise alert (for empty file). so you need to develop adapter module to raise the alert for empty file.
    Please refer the help page
    Configuring the Sender File Adapter - Advanced Adapter Engine - SAP Library
    Under Handling of Empty Files, specify how empty files (length 0 bytes) are to be handled:
    Do Not Create Message No XI messages are created from empty files.The files are processed according to the selected processing mode.For example, if the processing mode is Delete, empty files are deleted in the source directory.
    Process Empty Files XI messages are created with an empty main payload.The files are processed according to the selected processing mode.
    Skip Empty Files No XI messages are created from empty files.Empty files are skipped and remain in the source directory.

Maybe you are looking for