Abap mapping for content conditions routing in a flat-flat scenario

Dear Experts.
I have a flat-flat file scenario. Based on the content of the input file, I need to route data to the receiver.The source flat file will have several IDOC details.
Assume two fields FIELD1 and FIELD2 in different segments of the IDOC. My requirement is if FIELD1 of an IDOC = "XYZ" and FIELD2 of the same IDOC = "PQR", then this  IDOC's details has to be passed to the receiver.
I have tried to implement the above condition at interface determination in graphical mapping.
In the graphical mapping,  the problem is:
Assuming there are 3 idocs in the input file.
FIELD1 of IDOC[1] = 'XYZ' and FIELD2 of IDOC[1] = 'PQR'
FIELD1 of IDOC[2] = 'LMN' and FIELD2 of IDOC[2] = 'RST'
FIELD1 of IDOC[3] = 'ABC' and FIELD2 of IDOC[3] = 'DEF' .
Now, if none of the IDOCs in the input file satisfy my requirement,the message mapping should not be called at all. But in my case its failing because FIELD1 of IDOC[1] and FIELD2 of IDOC[3] together are satisfying the condition and hence the message mapping is getting called.
And I need to check this condition IDOC wise. Both the conditions has to be satisfied in the same IDOC.
The question is very similar to the one posted by SHOBHA HB. (Topic:Receiver determination(or Interface determination) and conditional routing )
but, due to complexities in the graphical mapping,  we have decided to go for the ABAP mapping instead.
Kindly help, by mentioning the steps I should follow for this interface, the logic basically. I already have paths to some basic ABAP mapping documents from SDN, so, kindly refrain from posting general URLS for definition or history of ABAP mapping.
IF you could guide me on this interface, It would be really helpful.
regards,
giri raj

Hi,
/people/ravikumar.allampallam/blog/2005/02/10/different-types-of-mapping-in-xi
This document will help you to create ABAP Mapping .
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/3.0/how%20to%20use%20abap-mapping%20in%20xi%203.0.pdf
How to Use ABAP Mapping in Exchange Infrastructure 3.0 (NW2004)
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/5c46ab90-0201-0010-42bd-9d0302591383
SAP Network Blog: How to call XI ABAP Mapping via RFC
/people/ricardoandres.maienza/blog/2007/04/06/how-to-call-xi-abap-mapping-via-rfc
SAP Network Blog: Testing ABAP Mapping
/people/sameer.shadab/blog/2005/09/29/testing-abap-mapping
/people/udo.martens/blog/2006/08/23/comparing-performance-of-mapping-programs
An ad-on
/people/michal.krawczyk2/blog/2006/09/20/xi-abap-mapping-logs--more-standard-better-visibility
Regards

Similar Messages

  • ABAP Mapping for Error handling in Proxy to JDBC

    Hi All,
    I am working on a proxy to jdbc scenario in which we have to throw validation errors to NWPM(Net Weaver Process Monitor Tool)
    I am following the below steps,
    step 1 - In message mapping a UDF is created to catch errors and store them in a variable using  dynamic configuration
    step 2 - writing abap mapping for handling this thrown exception and im reading the dynamic configuration in the abap class and raising exception. The exception format expected is
    SAP:Error SOAP:mustUnderstand="" xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
      <SAP:Category>XIServer</SAP:Category>
      <SAP:Code area="RCVR_DETERMINATION">NO_RECEIVER_CASE_ASYNC</SAP:Code>
      <SAP:P1>ZPI_THROW_EXCEPTION</SAP:P1>
      <SAP:P2>001</SAP:P2/>
      <SAP:P3>Mandatory field is missing[BUKRS] </SAP:P3>
       <SAP:AdditionalText />
      <SAP:Stack>No receiver could be determined</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    I have written the following ABAP code to achieve this:
    method IF_MAPPING~EXECUTE.
      DATA l_record type mpp_dynamic.
    DATA error type String.
    getting dynamic configuration value
    filled in by any previous mapping
    CALL METHOD DYNAMIC_CONFIGURATION->GET_RECORD
      EXPORTING
        NAMESPACE = 'http://sap.com/xi/XI/System/ERROR'
        NAME      = 'ERROR'
      RECEIVING
        RECORD    = l_record.
    error = l_record-value.
    *raising exception with our message
    RAISE EXCEPTION TYPE CX_MAPPING_FAULT
      EXPORTING
       TEXTID =
       PREVIOUS =
        ERROR_CODE = '001'
        ERROR_TEXT = error .
    RAISE EXCEPTION TYPE CX_MAPPING_FAULT
      EXPORTING
       TEXTID =
       PREVIOUS =
        ERROR_CODE = '003'
        ERROR_TEXT = error .
    endmethod.
    I am gettign the following message for our code:
    SAP:Error SOAP:mustUnderstand="" xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
      <SAP:Category>XIServer</SAP:Category>
      <SAP:Code area="RCVR_DETERMINATION">NO_RECEIVER_CASE_ASYNC</SAP:Code>
      <SAP:P1 />
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:Stack>No receiver could be determined</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    Could you please help in finding the solution for getting currect error message from ABAP class?
    Edited by: SwethaC on Jan 21, 2011 8:18 AM

    The error is due to RFC Call fail from PI system to your ECC Application System.
    Check your RFC Destination for ECC System type 3 in PI System.
    When you are receiving data from ECC System using Proxies & again you are going to ECC System for Validation.
    Why you are not doing this validation on ECC System only in your proxy code ?
    In your proxy code, it will be much better for performance to check your data there on same system.

  • ABAP Mapping :: for multi files

    Dear Experts,
    We are doing an Idoc to file interface, using ABAP mapping.
    This is 1:n mapping i.e receiver message interface is 0..unbounded.
    We have achieved the mapping for 1:1. But when I test for multi, i get an error in moni saying
    Parsing error after multi mapping.Expected Message<i> instead of Item
    Item is the name of the node that has to be created multiple times.
    Has anyone done multi mapping in ABAP?? Any idea why this error....may be we are missing something.
    Any idea as to how we can progress???
    Thanks in advance
    Regards
    Shobha

    Hi,
    Surely u can use an ABAP mapping for this.
    Sounds like your problem is your not using correct output structure for multi mapping.
    As with any type of multi mapping your structure should reflect this. Your target payload must thus have the following structure:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
         <ns0:Message1>
              <unboundedPayload/>
         </ns0:Message1>
    </ns0:Messages>
    The <unboundedPayload> element in above should of course be replaced with your actual payload - I believe 'Item' in your case, if that is in fact the root node of your actual payload.
    Regards,
    Daniel

  • Access MIME from ABAP Mapping for Attachment

    Hi,
    I am adding an attachment in ABAP Mapping and sending that message to Ariba System through HTTP Adapter channel.
    I am able to send the message successfully and also I can see the attachment in the PI RWB But I am not able to see any
    attachment in the Receiver's end along with the message.Ariba is able to receive the message successfully though.
    It looks like I need to change MIME Header a bit before sending the message.
    I check this link.
    XI Attachment and main document MIME sequence
    But Its about SOAP Adapter with PayloadSwap Bean. Since HTTP adapter is on ABAP we can not use the Module
    Tab of the channel.
    I need to know how can I use ABAP Mapping to access the MIME HEADER to change/ check Content Disposition and
    other properties.
    Thanks,
    Vijay
    Edited by: tech.info012 on Oct 12, 2010 6:33 PM

    When I tried the 2nd option It is giving me this error in response message. Do you have any idea what problem can cause this.
    <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.engine.interfaces.messaging.api.exception.MessagingException: Could not queue receive
    for message 4cb474bf-00c1-02af-e100-80000aa00d4b(INBOUND). Reason: java.lang.NullPointerException:
    </SAP:AdditionalText>
      <SAP:Stack />
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    Thanks,
    Vijay

  • ABAP Mapping for Large Messages

    Hi Folks,
    We are exploring different options for dealing with the fact that XI will choke on very large messages/files. One of the options that we are considering is a third party tool that bypasses XI. However, we've just learned that it may be possible to solve the large message problem by using ABAP Mapping, because supposedly, by doing so, one would bypass the large message being converted to XML as it comes into XI. The scenario involves messages coming into XI on their way to SAP R/3. Does the ABAP Mapping option appear to be viable to you experienced folks out there?
    Thanks
    Nic

    Hey
    tunneling as per the term is used mainly for IDOC but we use the term bypass to implement the same concept but with other interfaces.
    see if u have simple 1-1 mapping then u can do a bypass scenario in which u are not doing anything in IR,u simple do the configurations in ID.
    you can not drastically increase the performance just by choosing some specific mapping.mappin is not made for this .
    for best performance you can design a bypass JDBC to IDOC scenario(but then you wont be able to do any message mapping.
    have a look at the following for bypass scenario
    /people/william.li/blog/2006/09/08/how-to-send-any-data-even-binary-through-xi-without-using-the-integration-repository
    if u want to do message mapping then design a JDBC to Proxy scenario.
    proxy is mainly used to enhance performance and would be the best bet for u i guess
    Thanx
    Aamir suhail
    Message was edited by:
            Aamir Suhail

  • Incorrect condition evaluation for content-based routing (Receiver determ.)

    Hi experts,
    We have a SAP XI scenario (using web services), where we use external
    definition (an imported WSDL document) of messages, which contain
    elements with a default namespace. We have a problem during the
    receiver and interface determination, where we use conditions.
    When we use an element with a default namespace, it doesn't work (the receiver is not found), e.g. <UserRequest xmlns=http://portal.skoda-auto.com/Namespaces/PortalB2B...
    When we add some prefix to the namespace e.g. ns0, it starts working
    OK. Problem is, that sender application (web service client) send us
    message without a prefix.
    What we can do on the side XI? Can you suggest some solution for this problem?
    Do you know if SAP XI has some limitation using default namespaces?
    In our test system we use SOAP sender adapter and in productive we use external SOAP adapter.
    We use SAP XI3.0 (SP19)
    Thanks for your help!
    Regards
    Petr

    It is OK now. We have already solved the problem. We had to correct a
    wsdl and add to it <b>elementFormDefault="qualified"</b> ,
    <schema targetNamespace="http://portal.skoda-
    auto.com/Namespaces/PortalB2B" xmlns="http://www.w3.org/2001/XMLSchema"
    xmlns:ns0="http://portal.skoda-auto.com/Namespaces/PortalB2B"
    elementFormDefault="qualified" >
    The receiver determination started to work correctly. (Our partner apologise for this mistaken wsdl).

  • What is the correct device to use for content/application routing/switching?

    We currently have 2 data centres and traffic from anywhere is sent from our customers to a Windows cluster IP and TCP port number. Its old and unreliable and unwieldy.
    What i am looking for is a device that sits one network hop up from our 2 data centres that can support our internet facing IP address and make routing decisions based on a combination of source/destination address and source/destination port as to which data centre and ultimately which server the traffic is forwarded to. This will then allow me to direct all traffic to one DC whilst hardware in the other is upgraded.
    In the old days I would have looked at things like ACE or even CSS but those are gone or going and there does not seem to be a clear replacement path with Cisco unless someone knows different.
    Thanks in anticipation of replies

    Hi Matthew, the load balancing that was with the CIsco ACE has been reintegrated into the IOS of most ISR routers now a days. This would be the type of appliance you would be looking into to direct and control the traffic from the 2 data centers. so I can give you a recommendation on the best appliance to look into please send me an email at [email protected]
    Regards,
    Ferdz

  • Design suggestion for content based routing

    Hi All,
    I have the following scenario.
    Based on one field in the file I have to take the following decisions.
    1)If field is 'R'. Then I should send a mail with some data to the concerned person.
    2) If filed value is 'V' . Then I should create file with the  input XMl.
    Venu.

    hi,
    just use condition editor in directory to
    do it (receiver determination)
    if r then one service which will send mail
    if v then another service with mapping etc
    it's all standard
    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>

  • Pass through scenario in SAP PI with no mapping for File to IDoc and Idoc to file scenarios

    Hi Experts,
    Can i have step by step process in SAP PI for pass through scenario with no mapping in case of file to Idoc and Idoc to file both cases please.
    What objects i can skip.
    My PI system is 7.3 dual stack.
    I have seen below blogs, still its confusing to me.
    When and how to create an scenario in SAP PI without mapping objects.
    Pass Through Scenario with no Mapping in PI 7.1
    Appreciate your help on this.
    Regards,
    Mohan.

    Hi Mohan
    In pass thru interface you don't need to create any ESR objects, only ID objects are required.
    Just Create a Receiver Determination and Receiver Agreement for your scenario (no need for Interface Det. and Sender Agreement).
    Specify the IDOC in the Sender Interface and namespace as urn:sap-com:document:sap:idoc:messages
    Or instead of creating objects manually, Run the wizard with Idoc name/namespace in sender/receiver interface
    Regards
    Osman

  • Sender SMTP Adapter / Content Based Routing / Mapping of an attachement

    Hi all,
    I'm still working on my SMTP --> PI --> Proxy scenario (asynchronous). I've tried several different properties of my sender communication channel (type = mail), but I didn't find the correct configuration. Hopefully it exists.
    I'm working with PI 7.0 SP10.
    I get an inbound message via Mail using sender SOAP Adapter. The message payload itself is an attachement. Now I'd like to do the following:
    a) Content Based Routing in Receiver Determination based on the message subject
    b) Mapping of the Attachement XML message to my inbound proxy interface
    Now, trying to do so, I didn't get it work. When I use XIPAYLOAD with keep attachements, I get two attachements in my inbound message (one in XI mail package format having the subject within, one with the IDoc structure I'd like to map). How can I assign the second attachement to be used for my message mapping?
    When I use XIALL instead of XIPAYLOAD, I think the mapping will work but my subject for content based routing will be lost, right? That one I didn't get running because of another failure, so I don't know the exact behaviour of the adapter for that configuration.
    Anybody out there who know the correct configuration for the sender mail adapter for my small scenario above?
    BR
    Holger

    Hi Stefan,
    sorry for misunderstanding, for sure I'm using the mail adapter, not the SOAP Adapter. I'm actually on the same direction. I'm using XIPAYLOAD as message protocoll (having the attachement as the content for the mapping --> correct). Furthermore I've also found the predefined context objects for the content based routing receiver determination.
    What I missed was setting the following properties in the communication channel:
    To store adapter attributes in the message header of the XI message, set the Set Adapter-Specific Message Attributes indicator.
    The following attributes are added to the XI message header if the sender makes them available, and if the Variable Transport Binding indicator is set.
    Now it's working
    BR
    Holger

  • Setting the content type inside the ABAP mapping.

    Hello All,
    Can any one help me by telling me how to set the content-type inside ABAP mapping. I have searched a large no of blogs and help.sap.com for the same.
    My requirement is I want to change the MIME type of the Main Document in side SXMB_MONI so that can change the content type of Main document which is application\xml by default.
    I would appreciate an early response regarding the same.
    Abinash

    Hello Raj,
    The output of my ABAP mapping is a flat file. So when I try to open the file with content type application/xml in the message monitor it shows the file has some error which is natural. The way to get around this problem is change the content type to application\txt from application\xml.
    I am not finding an option to set the content type inside the ABAP mapping for the same.
    Abinash

  • Error text missing in  raising exception (In ABAP mapping)

    Hi,
    iam using ABAP Mapping for 1 interface.
    Based on some condition  i am raising exception with error text. When i executed this in SXI_Mapping_test it's showing the Error text. But when i execute the interface directly error text is missing in the Error details.
    can any one figure out y its not coming..
    regards
    Kishore

    Hi,
    I think you need to write the error to mapping trace.
    http://help.sap.com/saphelp_nw04/helpdata/en/ba/e18b1a0fc14f1faf884ae50cece51b/content.htm
    Regards
    Vijaya

  • Abap mapping - Error in Control Framework

    Hi Gurus,
    Scenario: IDOC - -- XI -
    Http (post)
    i am using ABAP mapping for IDOC to XML. I am able to test it using sxi_mapping_test which gives me output XML. But, when i test the scenario from RWB, it fails with "SYSFAIL" error in inbound queue as per moni.
    error - "Error in Control Framework".
    Looks like it did not even go to message mapping pipeline step.
    Please help.
    Thank you,
    mk

    HI,
    Hope you have done all the necessary pre-requisites for ABAP mapping
    This may help u- http://help.sap.com/saphelp_47x200/helpdata/en/55/bff20efe8c11d4b54a006094b9456f/content.htm
    just cross verify with this guide-
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e3ead790-0201-0010-64bb-9e4d67a466b4
    Please also try to debug as follows...
    put a break point inside your class/method....
    goto tcode SXI_MAPPING_TEST....give in the configuation details of your scenario...and when you execute, give the IDOC-XML, copy it from SXMB_MONI where you are getting the error....
    when you execute, it shoudl stop at the break point that you had set in your class....continue debugging using 'F6' function key, and check where you are hitting this error...
    The chances are that the FM that converts IDOC-XML to flat file format might not have been executed correctly...
    Thanks
    Swarup

  • Variable Substitution not working when using ABAP mapping

    Hi all,
    I am doing an IDoc to File scenario.
    Due to some complex mapping requirements, i had to use ABAP mapping for IDoc to File ( IDoc : SHPMNT05)
    There is also one more requirement where in i need to generate the receiver filename dynamically
    i.e the filename is of the form :     
        GW-XYZ-DD/MM/YYYY.csv
    Where
    XYZ is the Shipment number (E1EDT20- TKNUM)
    DD/MM/YYYY is the IDOC creation date in ECC (EDIDC-CREDAT)
    so i used the variable substitution option in receiver file adapter.
    But its not working.
    Is there any limitation for using the variable Substitution, doesnt variable substitution work in case of ABAP mapping?
    Regards,
    Loveena.

    Hi,
      u written ABAP mapping program to get the file name in the required format ,
    is it rt?
    when u test it at message mapping(including ABAP map program)
    u get the the required format of file name in the one of target filed.
    if that was fine, please check the variable substituiton parameters at receiver file adapter.
    i mean, are u maintain variable name and refernece.
    u have to specify the payload information.
    warm regards
    mahesh.

  • ABAP mapping split messages and dynamic filename

    Hello,
    i have set up a IDOC to file scenario where the IDOC is split into several files, which works fine. In addition to this it is required to set a dynamic filename out of the ABAP mapping for each file. If only one file is created this works already as well but how do you set the dynamic configuration when the messages are split?
    Regards,
    Andreas
    Edited by: Andreas on Feb 26, 2009 9:09 AM

    you cannot do dynamic configuration for message splits. The below is from SAP help.
    Adapter-Specific Attributes and Multi-Mappings
    In multi-mappings, there are multiple message headers with adapter-specific attributes. The mapping API can only access one message header. This has the following consequences depending on whether there are multiple source or target messages:
    u25CF     1:n Transformation
    If there are multiple target messages, the header for the adapter-specific attributes is copied for each message. This means that you can only create one header for all adapter-specific attributes, and not individual headers.
    u25CF     n:1 Transformation
    This variant is only possible for multi-mappings in integration processes. If there is more than one source message, read-access to the adapter-specific attributes of the various message headers is not possible at runtime.
    u25CF     m:n Transformation
    All afore-mentioned restrictions apply here. Developers can at most write the same adapter-specific attributes for all target messages to the header, without read-access to the attributes of the source messages. m:n transformations are only supported within integration processes.
    What i will suggest is to use BPM to have the message split i.e 1:N mapping and then after that have another mapping 1-1 to have the dynamic configuration

Maybe you are looking for