Validations in message mapping

Hi,
How can we do different validations in message mapping
and how can we trap them
Pls suggest blogs.
Regards

Hi,
you need to model them yourself
with some standard functions like:
- length
- if
- ifwithoutelse
etc
Regards,
michal

Similar Messages

  • How to implement validations in message mapping?

    Hi experts,
    I have a simple requirement:
    I have a simple synchronous scenario:
    SOAP -> XI -> RFC
    In a message mapping, one of the fields in the source message is of type String.
    However, the target application (RFC) does not expect a non-numeric characters in this string.
    My question is how can I perform the validation in XI and tell the sender that this field contains Non-numeric characters?
    Please help.
    Thanks.
    Ron

    > Ron,
    >
    > >>With a RunTime Exception thrown, how can I tell
    >  the sender an error has occured?
    >
    > Sure. You can do this with out a BPM. You need to
    > configure alerts for this. If you configure ALERTS
    > and SCOTT, this will send an email of the errors
    > occuring in your scenario.
    >
    > For configuring and trouble shooting alerts check
    > these
    >
    > https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/
    > 2327
    > https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/
    > 2328
    >
    > Regards,
    > Jai Shankar
    Hi Jai
    I already have alerts configured.
    But what I had in mind is to send a response to the sender (The sender is waiting for a reply since this is synchronous), instead of telling the sender through an alternative means such as email, sms, etc.
    Is this possible?

  • Ignoring a DTD validation at message mapping

    Hi,
    I'm facing the following situation: as a responce for a HTTP service consume, we are getting this payload:
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE ChannelAdminResult SYSTEM "/AdapterFramework/channelAdmin/ChannelAdmin.dtd">
    <More tags....>
    the problem is that the message mapping is not able to get the dtd that validates the payload. I did try uploading the dtd file as external definition, but it still not working.
    Is there anyway to bypass the !DOCTYPE validation?
    Thanks in advance,
    Ariel

    Hello, I have the same problem. If you have an solution for it, please post it here anyway.
    In my case, the external reference is an http-adress. The server has an connection to it, but it doesn't work until now.
    I tested the way over the external  definition, too, but with the same effect.

  • Message Mapping - Turn Off dtd validation

    Hi,
    I would like to know how to turn off dtd validation in a message map.
    The source message type is based on dtd. When testing, I get the following error
    java.io.IOException: Failed to load resource from the context classloader of the current thread! Loading from classloader was caused by: java.io.FileNotFoundException: D:\usr\sap\XYZ\DVEBMGS01\j2ee\cluster\server0\abc.dtd (The system cannot find the file specified)
    I understand that the map requires the dtd to be present in the application folder. But, can I change some setting not to look up this file.
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE MessageContainer SYSTEM "abc.dtd">

    Sorry Arvind. Not able to understand your question.
    The problem we are facing is, when the input xml file contains DocType declaration with reference to a dtd, we get an error stating the dtd is not found in the j2ee application folder.
    It works fine if the dtd is saved in the location. Also, it works fine if the DocType declaration is removed from the xml file. However, we are exploring an option where declaration is used but dtd is not available.
    Is there any way to achieve this?
    Thanks!

  • Does the message mapping editor insure that a valid target message is co

    Hi Friends
    Does the message mapping editor insure that a valid target message is constructed?
    Regards
    Sam

    Samuel,
    Message mapping editor ,will generate the output as per your logic. Hence you need to validate and check whether the target message has been created correctly.
    If you say," I'm perfect with the logic, I created the mapping I checked the target strcuture, its perfect, always the data will be populated correctly?" If the above is your question, then the answer is YES.
    raj.

  • User defined function in java for message mapping

    I wrote the following user defined function in java for message mapping and mapped vendor with this. The aim of this function is to write a error file at defined path when i send empty Vendor value from File to RFC-Function module BAPI_PO_CREATE. The "err.txt" error file is not written when i execute in TEST but the value "ERROR" is returned to destination Vendor Field.
    public String  validation(String a, Container container) {
    //write your code here
    if (a.equals("")) {
    try {
    String source = "Vendor cannot be empty";
    char buffer[] = new char[source.length()];
    source.getChars(0, source.length(), buffer, 0);
    for (int i = 0; i < buffer.length; i +=2)
       f0.write(buffer<i>);
    f0.close();
    FileWriter f1 =  new FileWriter("/10.10.0.55/sapmnt/trans/edixiin/err.txt");
    f1.write(buffer);
    f1.close();
    catch (IOException e) {}
    return "ERROR";

    Hi Senthil,
    Check these things :
    1) Whether you have permission to create a file in that directory.
    2) try giving this 
    10.10.0.55
    sapmnt
    trans
    edixiin
    err.txt
    3) Also check for permissions.
    Hope this will help you.
    Regards
    Suraj

  • How to validate a date in message mapping

    Hi experts,
                    how to validate a date in message mapping. For ex:  if date comes as 2008/02/31, then file it shold not get processed.how to achieve this in message mapping. Please help .
    Thanks&Regards,
    Reyaz Hussain

    Hi,
    There are few simple ways for date validation as follow,
    1.If you would like to handle it in XI only, then in message mapping you could verify about it with the help of generating smart exception.
    For e.g in mapping there is one Date conversion API i.e. somthing DateTransformation It converts the incoming date format to required format. Here give the date format i.e expected from Sender File.
    If in case the format miss-matched then it will create the exception.
    You could handle this exception with the use of [Alert notification|http://help.sap.com/saphelp_nw04/helpdata/en/2c/abb2e7ff6311d194c000a0c93033f7/frameset.htm] and could be even able to notify to sender system about it.
    2. The another solution is easy for SAP synchornous communication --If you are passing the file data to SAP, then you could use below function modules to verify date format in receiver RFC/BAPI or inbound IDOC program. If the sy-subrc is not 0 then don't process further.
    CONVERT_DATE_FORMAT
    ISU_DATE_FORMAT_CHECK
    Thanks
    Swarup

  • RuntimeException in Message-Mapping transformatio

    Hi all,
    My XI server is successfully picking up a comma separated file from an FTP server and generating the corresponding XML:
    <?xml version="1.0" encoding="utf-8" ?>
    <ns:CondRec_MT xmlns:ns="http://namespace-ConditionRecords">
    <Recordset>
    <ConditionRecord>
      <Usage>A</Usage>
      <Table>018</Table>
      <Application>M</Application>
      <ConditionType>PB00</ConditionType>
      <VarKey>00000039301300-340 2 0</VarKey>
      <Material>1300-340</Material>
      <Vendor>3930</Vendor>
      <PurchasingOrg>2</PurchasingOrg>
      <Infotype>0</Infotype>
      <InfoRecord>5300003218</InfoRecord>
      <CondRecordNo>0000020727</CondRecordNo>
      <ValidFrom>30.05.2006</ValidFrom>
      <ValidTo>31.12.9999</ValidTo>
      <ScaleType>A</ScaleType>
      <CalculatType>C</CalculatType>
      <KBETR>15.00</KBETR>
      <CondCurrency>USD</CondCurrency>
      <CondItemIndex>01</CondItemIndex>
      <RelToPricing>X</RelToPricing>
      </ConditionRecord>
      </Recordset>
      </ns:CondRec_MT>
    But nothing is getting submitted to the receiver adapter.
    The error in SXMB_MONI reads as follows:
    <?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="">
      <SAP:Category>Application</SAP:Category>
      <SAP:Code area="MAPPING">EXCEPTION_DURING_EXECUTE</SAP:Code>
      <SAP:P1>com/sap/xi/tf/_file2file_mm_</SAP:P1>
      <SAP:P2>com.sap.aii.utilxi.misc.api.BaseRuntimeException</SAP:P2>
      <SAP:P3>RuntimeException in Message-Mapping transformatio~</SAP:P3>
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>During the application mapping com/sap/xi/tf/_file2file_mm_ a com.sap.aii.utilxi.misc.api.BaseRuntimeException was thrown: RuntimeException in Message-Mapping transformatio~</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    I am using a simple one to one mapping(i.e the same msg type is being used for both the outbound and inbound interface).
    Pls can anybody guide me as to what can be the probable error.
    Thanks in advance
    Regards
    Neetu

    Hi all,
    Thanks for ur prompt responses.
    I followed the blog and performed testing of the mapping.
    The XML with which i tried was as follows:
    <?xml version="1.0" encoding="utf-8"?>
    <ns:CondRec_MT xmlns:ns="http://namespace-ConditionRecords">
    <Recordset>
         <ConditionRecord>
              <Usage>A</Usage>
              <Table>018</Table>
              <Application>M</Application>
              <ConditionType>PB00</ConditionType>
              <VarKey>00000039301300-340          2   0</VarKey>
              <Material>1300-340</Material>
              <Vendor>3930</Vendor>
              <PurchasingOrg>2</PurchasingOrg>
              <Infotype>0</Infotype>
              <InfoRecord>5300003218</InfoRecord>
              <CondRecordNo>0000020727</CondRecordNo>
              <ValidFrom>30.05.2006</ValidFrom>
              <ValidTo>31.12.9999</ValidTo>
              <ScaleType>A</ScaleType>
              <CalculatType>C</CalculatType>
              <KBETR>15.00</KBETR>
              <CondCurrency>USD</CondCurrency>
              <CondItemIndex>01</CondItemIndex>
              <RelToPricing>X</RelToPricing>
         </ConditionRecord>
    </Recordset>
    </ns:CondRec_MT>
    this gave the following error:
    Cannot produce target element /ns:CondRec_MT/ConditionRecord. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd
    But when i removed the tag 'RECORDSET', it works fine and output gets genersted.
    My datatype has no such field called recordset.
    The adapter generates it on its on.
    How do i solve this issue.
    Regards
    Neetu

  • Message Mapping error:  RuntimeException in Message-Mapping transformation

    Hi,
    Being new to XI, I am struglling to sort out a basic mapping error. Appreciate if you could help out.
    Its an File->XI->R/3 scenario.
    My FCC successfully reads the File and creates an XML. However this XML is not transferred to the target XML structure which is exactly same except the root element name is different at top.
    I tried various forum tips but I still am getting the error.
    ( When I Test the Message mapping in test mode..it seems fine, however if I copy the XML from SXMB_MONI, it then throws the above error)
    I looked at the MM in text mode: below is the extract
    /ns0:MT_REQUEST_TO_SAP/REQUEST_DETAILS/MSG_HEADER=/ns0:MT_REQUEST/REQUEST_DETAILS/MSG_HEADER=
    /ns0:MT_REQUEST_TO_SAP/REQUEST_DETAILS/MSG_HEADER/SOURCE=/ns0:MT_REQUEST/REQUEST_DETAILS/MSG_HEADER/SOURCE=
    /ns0:MT_REQUEST_TO_SAP/REQUEST_DETAILS/MSG_HEADER/DESTINATION=/ns0:MT_REQUEST/REQUEST_DETAILS/MSG_HEADER/DESTINATION=
    /ns0:MT_REQUEST_TO_SAP/REQUEST_DETAILS/MSG_HEADER/MESSAGE_ID=/ns0:MT_REQUEST/REQUEST_DETAILS/MSG_HEADER/MESSAGE_ID=
    As seen the name space in both starts with nS0 and end of each line has '=' sign. Is that ok.
    I have run out of options and dont know , whats the problem. Please help.
    The target and Source XML structures are exactly same as shown below
    MT_REQUEST                                 MT_REQUEST_TO_SAP
       |__MSG_HEADER                            |__MSG_HEADER  
         |__SOURCE                                |__SOURCE
         |__DESTINATION                           |__DESTINATION
         |__MESSAGE_ID                            |__MESSAGE_ID
    And the SXMB_MONI Trace shows the following error
    <Trace level="1" type="T">com.sap.aii.utilxi.misc.api.BaseRuntimeException: RuntimeException in Message-Mapping transformation:
    Cannot produce target element /ns0:MT_REQUEST_TO_SAP.
    Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd at ..
    Thanks
    Shirin
    Edited by: Shirin K on May 29, 2008 10:29 AM

    Hi Prakasu,
    As structure are exactly same, I have done 1:1 mapping. So all the fields in target structure are mapped, so no field has beeen left.
    In this structure, I do not have any 1:n relation. So 1:1 mapping should be fine.
    Apart from this could teher be any other reason.
    Regards
    Rajiv

  • Message Mapping : Testing at Runtime

    Hi all,
    I am doing scenario File XI IDoc...
    I was encountering error.. Runtime exception in Mapping...
    So i tried the testing step described by michal.
    if i paste the payload of the data obtained from SXMB_MONI in test tab of message mapping editor i will get error
    <i>Cannot produce target element /WGSREQ02/IDOC/E1WGRK1. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd </i>
    but for the same paylod in "src" of testing tab if i add namespace the testing is working fine.
    Kindly can anybody give me suggestion
    Regards,
    Ramesh P
    Message was edited by:
            Ramesh Parashivamurthy

    Message Mapping
    http://help.sap.com/saphelp_nw04/helpdata/en/49/1ebc6111ea2f45a9946c702b685299/frameset.htm
    User Defined Functions:
    http://help.sap.com/saphelp_erp2004/helpdata/en/22/e127f28b572243b4324879c6bf05a0/frameset.htm
    Advanced Graphical Mapping:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/media/uuid/b9af5e71-0701-0010-d0b8-f612fb6593dd
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/be05e290-0201-0010-e997-b6e55f9548dd

  • Error during import of XSD file in message mapping

    When i try to import an XSD file from desktop during message mapping I am getting a following error 'display problem'.
    "Root element not found. Root Schema only describe type defintions. Cannot opent this XSD."
    Is there any direct or work around way to import the file?
    Any help would be appreciated.
    Thanks
    Prem

    Thanks Alexey
      Let me specify some more detail. I got the following XSD file from a third party vendor. I am using XML spyeditor to edit the file. When i tried to add the global element it says the schema is not validated. How can it fix this?
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
         <xs:include schemaLocation="http://www.ABC.com/schemas/ABCXMLlibrary.xsd"/>
         <xs:complexType name="sesType">
              <xs:sequence>
                   <xs:element name="eserviceNumber" type="xs:string">
                   <xs:element name="SAPPurchaseOrder" type="SAPPurchaseOrderType" minOccurs="0"/>
                   <xs:any namespace="##any" minOccurs="0" maxOccurs="unbounded"/>
              </xs:sequence>
         </xs:complexType>
    </xs:schema>
    Thanks
    Prem

  • Error in message mapping - Cannot produce target element

    As one step in my integration process, I am builing a very simple file to BPM integration (inbound MI async, outbound MI abstract).
    The source type and the target type are completely equal - I am only doing some modifications to some of the content.
    The type for both messages - source & target message - is an imported external definition (DTD), and hence no DT or MT are created.
    As a first step I am trying to fill the target message with the content from the source message (without any modifications to the content). However, when testing this in the message mapping area, I get an error message already when filling the first element, the 'root node'.
    The error message is as follows:
    Start of test
    Compilation of <MM name> successful
    Cannot produce target element <elementname>. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd Cannot produce target element <elementname>. . Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd
    End of test
    Any suggestions?
    Thanks,
    C

    Thanks,
    when creating the source message manually in the MM it worked - so nothing wrong with the mapping.
    I saved this file and compared with the "original file" - containing the content which I wanted to upload, and on which the xsd (external definition) was based - and there where some inconsistancies.
    I changed some values in the source XML which made it work, also when uploading the file from a drive.
    So, I will go back to the source system and try to get a better XML.
    Thanks for now!

  • Message Mapping Transformation error in E-filing GB

    Hi All,
    I am running the E-filing GB interface and at the Message mapping I get Process Error:
    The source structure, target structure, or a function library has been changed or could not be found in the Enterprise Services Repository. The mapping definition contains elements or attributes that do not exist in the changed structure, or functions that were changed in a function library. The relevant entries will be deleted.
    Node with path /ns0:GovTalkMessage/ns0:Body/ns1:IRenvelope/ns1:EndOfYearReturn/ns1:P14/ns1:NICs/ns1:Earn/ns1:ETtoUEL not found in source structure Node with path /ns0:GovTalkMessage/ns0:Body/ns1:IRenvelope/ns1:EndOfYearReturn/ns1:P14/ns1:NICs/ns1:Earn/ns1:ETtoUEL/@Currency not found in source structure
    I have already tested a few steps like:
    1. We have applied the latest patch to E-filing GB. This did not help solve the problem.
    2. Tested the Message Mapping. No error at Message Mapping.
    Is there anything we are missing out on?? Please suggest.
    Thanks,
    Shwetha

    Hi,
    for me its looks cache issue,did you changed structure of source and target ?? check your function liabraris code,it is valid or not.
    Regards,
    Raj

  • Message Mapping validates against DTD

    Hello,
    We use XI message mappings to transform xml messages from 1 format to another. Now the xml that we receive from our trade partner has a reference tot a DTD. Eg.
    <!DOCTYPE cXML SYSTEM "cXML_NO_ATTR.dtd">
    Now when use eg. the mapping test tool, then we get an error that he doesn't find the DTD.
    java.io.IOException: Failed to load resource from the context classloader of the current thread! Loading from classloader was caused by: java.io.FileNotFoundException: C:\usr\sap\X01\DVEBMGS01\j2ee\cluster\server0\cXML_NO_ATTR.dtd (The system cannot find the file specified)
    For the moment we copied the DTD to the above mentionned path and now it seems to work.
    But does someone now how we can turn off this validation?
    (Or specify which DTD ourselves?)
    Greetings,
    Bart

    Hi Bart,
    You can try removing the tag <!DOCTYPE cXML SYSTEM "cXML_NO_ATTR.dtd">
    using a Java class, which will be at #1 in the sequence of your mappings. Then comes your message mapping
      This way you can manipulate the msg.
    Check my msgs (& other msgs) in this link
    /message/549856#549856 [original link is broken]
    Regards
    Vishnu

  • Message mapping: Passing data at the node level

    Hi,
    I have a question/requirement, XI Message Mapping program need to read the incoming xml and map to a diffrerent target structure. Incoming xml has a parent node called Description and it has a value "Frauen Hemd Shoes", we need to map this value to target LongText Field but message mapping is ignoring this data while mapping.
    A parent node can't hold the value/data while a child node is present. So is there any workaround to read this data to target str?
    <Description>
    <ShortName>Shoes</ShortName>
    Frauen Hemd Shoes
    </Description>
    Expected result:
    <Comments>
    <ShortText>Shoes</ShortText>
    <LongText>Frauen Hemd Shoes</LongText>
    </Comments>
    Please let me any clues to resolve the issue.
    thanks,
    Laxman

    I agree , the soruce structure is not a valid one..
    The source structure should look like the below:
    <Description ShortName='Shoes'>
    Frauen Hemd Shoes
    </Description>
    where ShortName is attribute for the Element "Description".
    You add attribute to the element the same way you add subElement, Just choose attribute instead of subelement.
    In this case the Mapping would be
    Descriprion -
    > LongText (target)
    ShortName -
    > ShortText (target)
    This Should work.
    Regards.
    Jeet.

Maybe you are looking for

  • Issue in finding  GR posting date and quanity for Purchase order item

    Hi All, I have a requirement to list all PO items with Goods receipt posting date and quantity. So for each po item I have fetched Goods receipt posting date and quantity from table EKBE for movement type 101. But in transaction ME23n   in PO history

  • Write string (7 chars), int16, sgl into binary file and read it in C

    How to write write string (7 chars), int16, sgl, string (5 chars) into binary file and then read it in C ? Total 18 Bytes file (binary) should be created.

  • Lion and waking up iMac from sleep

    Since updating to Lion (iMac 24", 2.6 Ghz) when I awake the unit from sleep instead of the cursor on the screen  I get a dark spot  (tiny dark grey square) at the tip of it, that turns into a line when I move the cursor. Have to turn the unit off and

  • Deleting duplicate song files in itunes 11

    can anyone help. the "delete duplicate files under the View menu" is now gone thanks

  • Large Charset Problem

    Hi I've the following problem: We have an Oracle 10 database running on Red Hat Linux: Now we also have a tomcat 5 on this Linux-Server, but our web-application cannot display "umlaute" like Ä or Ö correctly.It cannot depend on the database, becaus