How to do Validations on Incomming Idoc-XML In XI

Hi all,
I have Scenario Idoc--File, in this if my Idoc generated with 5 line items say 5 Materials.
Say If the 3rd Material data is wrong , then the whole Idoc wil be failing in MONI.
We implemented in mapping on how to through exceptions if there is no sales price or sales price is > MRP kind of validations and all, So the Idoc will fail in MONI if any of the conditions fails....this will not send to Legacy system because of condition fail
Can we do like this
1) Can we just process the remaining Materials except 3rd material???
2) How to know the 3rd Material data is wrong??? untill and unless we check in message mapping Test, we dont know this where it went wrong.
Regards

Hi,
I think XI/PI point of view we can't do with default setting.  Better to do something in IDOC generation program so that we can prevent at initial stage and it is very simple also.  XI/PI point of view we can do but need more customization, meanwhile all material data are comming in one idoc so we can't check individually, if each material data come separately in idoc, that time we can process.

Similar Messages

  • How to convert IDoc-XML to native Idoc-File with in SAP XI/PI

    Hello,
    I have a problem to Create an native IDoc-Format for an File-Receiver.
    The scenario:
    I get an Idoc (ZMATMAS) from a SAP System to an MATMAS-exchange-scenario. One of the non-SAP-receiver-systems needs an other native IDoc-Format as File. So I have to map the ZMATMAS to the receiver Format and write this as File. The problem is, that this file contains the data as IDoc-XML and not as native IDoc-format.
    Has anybody an idea for this problem?

    U need to use sender idoc adapter and file receiver adapter.
    U can do file content conversion at receiver end.
    Content Conversion is basically to convert a text file that contains complex structures into an XML source format and vice versa. It is present only in the File Adapter because it is one of the message protocol which will convert the structure to a desired format.
    There are many blogs for File Content Conversion. Some of them are listed hereunder:-
    Introduction to simple(File-XI-File)scenario and complete walk through for starters(Part1)
    Introduction to simple (File-XI-File)scenario and complete walk through for starters(Part2)
    How to send a flat file with various field lengths and variable substructures to XI 3.0
    Content Conversion (Pattern/Random content in input file)
    NAB the TAB (File Adapter)
    File Content Conversion for Unequal Number of Columns
    Content Conversion ( The Key Field Problem )
    The specified item was not found.
    You may also check the FCC documentation for Sender and Receiver:-
    http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm

  • How to send IDOC as IDOC XML with out touching IR

    Hi Guru's,
    I have a scenario, where i need to transfer IDOC into Just IDOC XML..
    No Mapping is done...
    I know v can do without touching repository objects..
    As Per Bhavesh said in one of the blog.....no need to import idoc into repository..
    I am just wondering how will it possible?
    My Understanding is as follows.........
    First Go to ID.
    Step 1)
    As sender is IDOC we will not create sender agreement & sender communication channel..
    Step 2)
    Goto Receiver Determination
    Sender:
    Service   : Business System for SAP R/3
    Interface : IDOC
    NameSpace: urn:sap-com:document:sap:idoc:messages
    Receiver:
    Service : Receiver Business system.
    Interface Determination
    Configured Inbound Interfaces:
    InboundInterface : IDOC
    Interface Mapping : NIL
    ReceiverAgreement :
    Sender Service : SAP R/3 Business system Name.
    ReceiverService: will give receiver Business system.
    ReceiverInterface : IDOC
    Receiver Namespace:urn:sap-com:document:sap:idoc:messages
    As Bhavesh said there is no need to import IDOC into Repository.
    main intention is no need to touch Repository..
    we are giving IDOC name in Receiver Interface and sender Interface.
    Here my doubt is from where this IDOC will come as u are not importing IDOC into Repository.
    Please need clarification..
    Thanks in Advance..........
    Regards,
    Reehan.

    Reehan,
    First of all thanks for following everything I had mentioned. I remember the thread quite well.
    Asnwering your question,
    ><i>Here my doubt is from where this IDOC will come as u are not importing IDOC into Repository.
    Please need clarification..</i>
    When the Idoc is triggered from the SAP system , the first thing that happens is that it tries to locate the Business System registered in the SLD for it. It uses the logical system name to be able to do this.
    After it locates the bsuiness system, this is used as the sender service and the idoc name and the idoc namespace are used as the Sender interface and interface namespace.
    Next, using these details, the runtime integration engine of XI is now able to fill the SOAP header for these details and these details are used in the pipeline steps of XI ( Receiver determination ) to determine the receiver and so on.
    The idoc imported in the IR is used just to allow us to have the Idoc metadata for mapping in the IR . The actual runtime metadata is not dependent on the Idoc improted in the IR.
    Regards
    Bhavesh
    PS : Did this scenario work?

  • IDOC testing: how to upload sample IDOC xml file while outbound IDOCtesting

    Hi experts,
    can any one tell me , how to upload a sample XML idoc xml(data) file while Outbound IDOC testing;
    in WE19 tcode ( insted of manually entering the sample data, i have to import the sample XML/text file into the idoc fields). say IDOC is  MATMAS.
    Thanks in advance;
    Kumar

    Hi Asit Purbey,
    can you clearly explain, how to upload the file and how can i genetare the IDOC no?
    i have seen that function module IDOC_XML_FROM_FILE, in that it is required a port no, what exactly it is, and what type of port is it?
    suppose i am having a XML/TEXT file with IDOC data, how can i upload it into the server and how can convert it into the IDOC and how can i generate the IDOC no for outbound testing?
    Thanks,
    Anil

  • How do you differentiate IDOC XML format and ordinary XML format

    how do you differentiate IDOC XML format and ordinary XML format since they are used by IDOC adapter and RFC adapter???

    Hi,
    Cremas Structure starts with Header and followed by Segments...
    Normally it begins like this
    <CREMAS03><IDOC BEGIN="1">
    The second node is Idoc in the header..
    Thanks
    Anju

  • How to keep incoming IDoc-No.?!

    Hi, i am a freshman and i need some help!
    Because we send IDoc from R/3 to R/3 across XI we want to have the same IDoc-No. in receiver system like it was given in sender system.
    We already activated the checkbox "Apply control record values from payload" but when we check in IDX5 the inbound and outbound idoc-no. differs.
    I read that this should be possible to achieve that the inbound and outbound no are the same! How can i achieve this solution?!
    Can u help me!?
    br

    Ok, now i want to do a RFC-Lookup to the Table IDXRCVPOR for getting the original incoming IDoc-Number.
    I use this code in field-mapping:
    String DBTABLE = a[0];
    String lookUpField = d[0];
    String WHERE_CLAUSE = b[0]+" = "+"'"+c[0]+"'" ;
    String sapClient = "100";
    String hostName = "server";
    String systemNumber = "00";
    String userName = "USER";
    String password = "PW";
    String language = "EN";
    JCO.Repository mRepository;
    JCO.Client mConnection = JCO.createClient(
                   sapClient,
                   userName,
                   password,
                   language,
                   hostName,
                   systemNumber );
    // connect to SAP
    mConnection.connect();
    // create repository
    mRepository = new JCO.Repository( "GenericRFCMappingLookup", mConnection );
    // create function template to select data from any table
    JCO.Function function = null;
    IFunctionTemplate ft = mRepository.getFunctionTemplate("RFC_READ_TABLE");
    function = ft.getFunction();
    // Obtain parameter list for function
    JCO.ParameterList input = function.getImportParameterList();
    // Pass function parameters
    // set import parameters table name and RFC
    input.setValue( DBTABLE, "QUERY_TABLE");
    input.setValue( "," , "DELIMITER");
    //Fill the where clause of the table
    JCO.ParameterList tabInput = function.getTableParameterList();
    JCO.Table inputTable = tabInput.getTable("OPTIONS");
    inputTable.appendRow();
    inputTable.setValue(WHERE_CLAUSE,"TEXT");
    mConnection.execute( function );
    //Find the position of the field that has to be lookedUp
    JCO.Table lookupFieldPos = function.getTableParameterList().getTable("FIELDS");
    int pos = -1;
    for (int i = 0; i < lookupFieldPos.getNumRows(); i++)
              lookupFieldPos.setRow(i);
              if (lookupFieldPos.getString("FIELDNAME").equals(lookUpField))
              pos = i;
    //Get the exact lookupvalue from the position obtained above
    JCO.Table valueSet = function.getTableParameterList().getTable("DATA");
    for (int i = 0; i < valueSet.getNumRows(); i++)
              valueSet.setRow(i);
              String resultSet [] = valueSet.getString("WA").split(",(?=(?:[^\"]*\"[^\"]*\")*(?![^\"]*\"))");
              result.addValue(resultSet[pos]);
    mConnection.disconnect();
    But when i try a test in mapping i am getting this error:
    Runtime exception during processing target field mapping /SYSTAT01/IDOC/E1STATS/DOCNUM. The message is: Exception:[com.sap.mw.jco.JCO$Exception: (104) RFC_ERROR_SYSTEM_FAILURE: A dynamically specified column name is unknown.]
    Can somebody help me again?!

  • How does a servlet read incoming XML??

    how does a servlet read incoming XML??
    thanks in advance
    annie
    Message was edited by:
    annie613

    Hi, anyone have an example code of sending a file to servlet and receiving the file in servlet?
    I have a JUNIT TEST wit the following code:
    ==========================================
                   HttpURLConnection connection = (HttpURLConnection) url.openConnection();
                   connection.setDoOutput(true);
                   connection.setDoInput(true);
                   connection.setAllowUserInteraction(false);
                   connection.setRequestMethod("POST");
                   out = new DataOutputStream(connection.getOutputStream());
                   BufferedReader reader = new BufferedReader(new FileReader(
                             "/Performance.zip"));
                   String line = null;
                   while ((line = reader.readLine()) != null) {
                        out.write((line + "\n").getBytes());
                   out.close();
                   // Read Response
                   InputStream in = connection.getInputStream();
                   int x;
                   while ((x = in.read()) != -1) {
                        System.out.write(x);
                   in.close();
                   BufferedReader r = new BufferedReader(new InputStreamReader(in));
                   StringBuffer buf = new StringBuffer();
                   while ((line = r.readLine()) != null) {
                        buf.append(line);
    =================================================
    and my SERVLET code is like following:
                   ServletInputStream in = request.getInputStream();
                   parameters = request.getParameterMap();
                   path += "file_" + request.getSession().getId() + ".zip";
                   // write the input stream to file
                   OutputStream fileOut = new FileOutputStream(path);
                   CRC32 crc = new CRC32();
                   long size = 0;
                   int read;
                   byte[] buf = new byte[8 * 1024];
                   while ((read = in.read(buf)) != -1) {
                        fileOut.write(buf, 0, read);
                        size += read;
                        crc.update(buf);
    Still when reading the InputStream, nothing is received in the servlet.
    Any idea how to fix it?
    thanks,
    Jari

  • How can i convert flat idoc to IDOC-xml

    Hi all,
    I want to convert flat idoc to Idoc-xml. Suggest some methods for that....
    K.S Grewal

    This is the sample idoc data which i have been provided. actually i dont have much knowledge abt structure of idocs. As i have to test my scenario hich is idoc to file, i need Idoc-xml format.
    ISA00          00          01006922827PCE1  126155214895     0612211736U004000004633020P|GSRE006922827PCE16155214895200612211736463302X004010ST9440001W17F20061221018085336610001 398456   1*83209N1WHWarehouseG620920061221W0740EA*PO5500203183PL000010*1MT42PF5321D/37~N9KK0180853366000001N9PEUS1TWHSW1440~SE90001~ST9440002~W17F20061221018085336710001 398448   183209N1WHWarehouseG620920061221W0756EA*PO5500203182PL000010*1MT*42PF7421D/37N9KK0180853367000001~N9PEUS1TWHS~W1456SE90002ST9440003W17F20061221018085338810001 398446   1*83209N1WHWarehouseG620920061221W071EA*PO5500205659PL000010*1MT50PF9731D/37~N9KK0180853388000001N9PEUS1TWHSW141~SE90003~GE3463302~IEA1*000463302~

  • How to park invoice ( Incoming Idoc )

    Hi,
    I have a requiremnt where i need to park the incoming idoc(INVOIC01).
    I am using the standard program
    "IDOC_INPUT_INVOIC_MRM".
    I made the copy of this FM into a Z Function Module and
    using "MRM_CREATE_INVOICE"
    passing RBSTAT_NEW = 'A'
    which is for parking and this is giving errors.
    Kindly give me the solution to this problem.
    Thanks & Regards
    Lakshmi

    would try with example from include LFMYC_CCLF16:
    **--Enable message handler
        CALL FUNCTION 'MESSAGES_INITIALIZE'.
        CALL FUNCTION 'MRM_INVOICE_PARK'
          EXPORTING
            i_rbkpv           = l_f_rbkpv
            i_xupda           = 'D'
            i_simulation      = l_simulation
            i_rbstat_new      = '2'
            ti_drseg          = l_t_drseg
         IMPORTING
           te_errprot        = l_t_mrm_errprot
          EXCEPTIONS
            invalid_status    = 1
            update_impossible = 2
            error_message     = 3
            OTHERS            = 4.
        IF sy-subrc <> 0.           "MM document parked?
          l_f_return-id         = sy-msgid.
          l_f_return-type       = sy-msgty.
          l_f_return-number     = sy-msgno.
          l_f_return-message_v1 = sy-msgv1.
          l_f_return-message_v2 = sy-msgv2.
          l_f_return-message_v3 = sy-msgv3.
          l_f_return-message_v4 = sy-msgv4.
    *----- write message into message text field
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
                INTO l_f_return-message.
          APPEND l_f_return TO c_t_returns.
        ENDIF.                   "MM document parked?
    Please let me know whether is worked for u not?a

  • File to IDoc : XML parsing in ABAP mapping

    Hi,
    In ABAP mapping I want to parse all of the incoming XML strings to internal table.Later I add few more fields to this table and transfer them to IDOC adapter in IDOC-XML format.In thsi case how do i get all of the input file data(converted from XML) into internal table using XML parsing in ABAP Mapping?
    Thansk in advance,
    RP

    Hi Amil,
    I insert into table but not immediately,I want all the parsed xml data into internal table and do something before I insert into DB /send it to IDOC.
    I knwo how to get single Xml parsing,but how to get multple records(looping xml parse) to internal table?
    Thanks,
    RP
    Edited by: RP@261 on Jun 3, 2009 2:14 PM

  • IDoc XML - Flat File Question

    Hello All,
    I've gone through the 'How To… Convert Between IDoc XML Structures and Flat Files in XI 3.0' guide.  What I am having trouble wrapping my head around is the creation of the interface mapping, in particular the 'Target Message' interface.  Obviously the 'Source Message' interface would be the incoming IDoc but what is the 'Target Message' interface that is used? 
    Looking forward to seeing the light,
    Mike

    Hi Mike,
    your target message will be a XML structure which will be written to your output file.
    The Structure will somewhat be of this type:
            <root>
                 <Sub structure>
                              <Data/>
                 </Sub structure>
            </root>
    And you need to configure the Receiver File Adapter to see your output, also you can use File Content Conversion to change the output to<i> text.</i>
    For that please go through this weblog by Mr. Arpit Seth:
    /people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion
    I hope it helps,
    Thanks & Regards,
    Varun Joshi

  • Need steps to find out the particular ( specific ) incoming IDOC.

    Dear ALL Experts,
    In our scenario , our SAP XI system is directly connected to customer SAP XI system and we did not import IDOC from R/3 to SAP XI. Instead of doing this we got the .XSD file and imported to SAP XI.
    Now, I need to know the particular incoming IDOC through IDOC NO or some other way where, as of now I need to run the
    sxmb_moni and from that I need check every IDOC.
    Pls revert with the way where we can retrieve the specific IDOC.
    Thanks and Regards
    Machindra Patade

    > pls guide how to check whether TREX have installled or not in our system ?
    You can apply a simple trick here to make suer if TREX has been installed or not.
    Go to RWB--->Message Monitoring, press Display button. Now in next screen you can see a input box "Search Text". Enter some value in the search text box (which you know is present in the system) and now press Start button after fill other filter criteria. So if you get some result then it means TREX is present in the system else not.
    > Also suggest if there is any way out to know the specific IDOC/XML message.
    In XI use transaction code IDX5 to search IDOC.
    Regards,
    Sarvesh

  • How to set the root path of XML document when calling Inserting procedure

    Hi,
    I was create a procedure to insert XML Document in to DBMS Tables, but i am not able to set the Start root element in calling procedure.
    My calling procedure is
    exec insXmldoc('pmc_sample.xml', 'pmc')
    When i am calling this procedure i got this error
    11:23:54 Error: ORA-29532: Java call terminated by uncaught Java exception: oracle.xml.sql.OracleXMLSQLException: Start of root element expected.
    ORA-06512: at "SYS.DBMS_XMLSAVE", line 65
    ORA-06512: at "SCOTT.INSPROC", line 8
    ORA-06512: at line 2
    I am checking my XML file using XML Validator. My XML file was parsed with out errors.
    Please give the solution,and tell me where i did wrong in my calling procedure.
    suppose i have this XML file in local E drive ,how to set the path for that XML file in my calling procedure.

    Hi, I am doing the code likthis,please give the solution.
    SQL> create or replace procedure insProc(xmlDoc IN CLOB, tableName IN VARCHAR2) is
    2 insCtx DBMS_XMLSave.ctxType;
    3 l_ctx dbms_xmlsave.ctxtype;
    4 rows number;
    5 begin
    6 insCtx := DBMS_XMLSave.newContext(tableName); -- get the context handle
    7 rows := DBMS_XMLSave.insertXML(insCtx,xmlDoc); -- this inserts the document
    8 DBMS_XMLSave.closeContext(insCtx); -- this closes the handle
    9 end;
    10 /
    Procedure created.
    SQL> begin
    2 insProc('/usr/tmp/ROWSET.xml', 'emp');
    3 end;
    4 /
    begin
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception: oracle.xml.sql.OracleXMLSQLException:
    Start of root element expected.
    ORA-06512: at "SYS.DBMS_XMLSAVE", line 65
    ORA-06512: at "SCOTT.INSPROC", line 7
    ORA-06512: at line 2
    Kishore B

  • Send / Receive Idoc(XML) in SAP ECC 5.0

    Hi Experts,
    We are using SAP standard idocs to exchanges master data and Sales data between SAP and non SAP system. currently all the idocs are generated and posted as flat file structure.
    There is possiblity to use idoc(XML) and HTTP service instead of standard process without XI?
    All info related with this is welcome. is it possible? how?
    all suggestion n helpful ans will be rewards with points.
    regards: gaurave.

    Hi Gaurave,
    I have comae accross this type of issue once and hope the below link will give you an idea.
    http://msdn2.microsoft.com/en-us/library/cc185479.aspx
    thanks,
    KIRAN

  • Get File name from incoming IDoc

    HI All,
    I am in an IDOC to File scenario using Fcc. (R/3 --> XI --> 3rd party)
    I need to use the  idoc-number(EDI_DC40-Docnum) as my output file name. I planned using variable substitution but there it expects me to get the idoc number from payload which I do not have it in. (refer c ode below)
    As I understand, variable substitution can be used only on payload(the FINAL data set that we will be writing to the file).
    Can we use the data which is part of incoming IDOC and not part of payload(final data what we are writing to file).??
    Other idea was to map this IDOC no to a field in final file, but this field should not be written in the output file, so am confused about how to achieve this.
    E.g
    *Incoming Data*
    IDOC
      |_EDI_DC40
        |_DOCNUM
    Final data (Payload)
    Header
    Data
    Trailer
    As seen in my example above I do not have the IDOC no in the final data so how do I use the Idoc no as my filename? Apprecaite your help on same.
    Regards
    Shirin

    Hi
    You can use dynamic configuration to get the file name .
    Use Adapter Specific Message Attributes for the target Comm Chanel check the indicator for filename in the advanced tab of CC
    create a UDF with i/p as file name  i.e the Idocnum field and
    paste this code
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    //conf.removeAll();
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    //String filename= conf.get(key);
    conf.put(key, fileName);
    key= null;
    return fileName;
    PS: use cache as value in UDF
    ands assign the o/p of this UDF to a root node

Maybe you are looking for

  • Crm- Contracts problem  with profit center!

    HI All, I am facing a problem in profit center posting, when billing a contract (VF01, VF44) and MIGO Contract Scenario, I am Creating   Contract  In CRM    and replicating it as a contract  in ECC to performe Billing(VF01) and Revenue recog(Vf44) th

  • Update Contract Account in Background - BOR "ISUACCOUNT" Method "Change"

    Hi Experts, We are trying to update the "Dispatch Control" & "Alternative Bill Recipient" fields on the Contract Account in background. We are using BOR - "ISUACCOUNT" and Method - "Change". The Method is unable to update the field values but not giv

  • Backup and restore a olite database.

    Hi, i would like to know, if is it possible to backup and restore a olite database on a MUC (mobile unite computer). Is there a war we can export/import, datapump or generate a xml file and put it back in the database on demand. Some clients can be m

  • Validation Numeric Field(very urgent please)

    Hi, Iam new to java. I have one JSP form. my question is : How do i validate that user has entered all numeric values in a particular column.? And if he has not entered the numeric data, do i have to throw NUMBERFORMATEXCEPTION. Please help ! Thanks

  • Pre version 8 takes - want to swipe and comp - but how?

    I'd like to comp lots of vocal takes recorded on separate tracks in an old Logic version so I can take advantage of the'swipe' and comp facility in version 8 - but I can't see how to do this. Anyone know? Kev