Reg: File to Idoc Hierarchial mapping

Hi Experts,
We have a scenario of flat file to idoc where in we have 4 segments(01 to 04)(with hierarchies) in source file to be mapped to idoc. We have followed Riaz blog    http://www.riyaz.net/blog/xipi-convert-flat-file-to-deeply-nested-xml-structures-using-only-graphical-mapping/.on mapping flat file to deeply nested structures . 
   We have encountered one unique issue in the intermediate level mapping where, when assigning hte id numbers, the instances of one segment are grouped together.  This is creating a problem. 
Ex: in source str we have nodes in the order
01
02
03
04
02
03
04 and so on..
After the test of intermediate mapping, it shows teh follw sequence:
01
02
02
03
03
04..
The node seq in the target str should have been similar to that of the source.. but here its not so.. 
if i am using just one instance of 01 till 04 nodes.. the final xml str is created perfect.. Can any please let me know what could be the possible error??
Or please let me know if there is any other simple procedure to finish this.
Thanks in advance, awaiting your reply..
Best Regards,
Giri

Hi,
Please go through the following links..
http://wiki.sdn.sap.com/wiki/display/XI/SampleJAVAMappingcodeusingPI7.1+API
http://wiki.sdn.sap.com/wiki/display/XI/UsingPI7.1APIforJavamapping
and also,
http://help.sap.com/saphelp_nwpi71/helpdata/en/bd/c91241c738f423e10000000a155106/content.htm
If u get any doubt u can post the problem....
Babu

Similar Messages

  • File to Idoc : Java Mapping

    Hi Experts,
    The scenario is file to idoc. In the file i'll be getting name,value pairs. For ex:
    Structure is
    MT
    ....Root(1..unbounded)
    ............Name
    ............Value
    File contains:
    Vishal....1
    Raj.........2
    RFC......10
    Rahul.....20
    Azhar....15 and so on..
    I need to loop through the file. When Name="RFC", I need to make an RFC call with Value as it's input. RFC returns 4 values which will be used for mapping.
    Then I need to continue looping through the file. On encountering a particular Name, I need to map corresponding Value to target field.
    For this, I should have 2 mappings. One to read the file and the other for mapping. I've never used RFC and Java mapping, Can someone provide me a link or a solution for this?
    Thanks,
    Vishal

    Hi,
    You can do this using a UDF.
    first let the source message contain first line and last line which you want to eliminate.
    change the context of the Value to MT ..
    start a for loop in UDF ignoring first & last line like
    for(int i = 1; i< input.length() - 1; i++)  // here i = 1 & not zero  & input length is -1 so that first & last field eliminates
           //carry on string operation to separate name & value on delimeter space
    String name = input<i>.subString(0,.... to the indexOf space);
    //similar for value also....
    now you have name & value
    check for name == 0052
    if(name == 0052)
      perform rfc lookup
    else

  • ATTRIBUTE_IDOC_METADEATA Error: File  to IDOC Java Mapping

    I have done a Java Mapping from File to Idoc and I get the following error in sxmb_moni:
    <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
    <SAP:Category>XIAdapter</SAP:Category>
    <SAP:Code area="IDOC_ADAPTER">ATTRIBUTE_IDOC_METADATA</SAP:Code>
    <SAP:P1>I::000</SAP:P1>
    <SAP:P2 />
    <SAP:P3 />
    <SAP:P4 />
    <SAP:AdditionalText />
    <SAP:ApplicationFaultMessage namespace="" />
    <SAP:Stack>Fehler: I::000</SAP:Stack>
    <SAP:Retry>M</SAP:Retry>
    </SAP:Error>
    The Idoc structure that I generate in my mapping makes no fullfil of the IDOC tags.
    For example:
    <IDOC BEGIN="1">
                   <EDI_DC40 SEGMENT="1">
                        <TABNAM/>
                        <MANDT/>
                        <DOCNUM/>
                        <DOCREL/>
                        <STATUS/>
                        <DIRECT/>
                        <OUTMOD/>
                        <EXPRSS/>
                        <TEST/>
                        <IDCOTYP/>
                        <CIMTYP/>
                        <MESTYP/>
                        <MESCOD/>
                        <MESFCT/>
                        <STD/>
                        <STDVRS/>
                        <STDMES/>
                        <SNDPOR/>
                        <SNDPRT/>
                        <SNDPFC/>
                        <SNDPRN/>
                        <SNDSAD/>
                        <SNDLAD/>
                        <RCVPOR/>
                        <RCVPRT/>
                        <RCVPFC/>
                        <RCVPRN/>
                        <RCVSAD/>
                        <RCVLAD/>
                        <CREDAT/>
                        <CRETIM/>
                        <REFINT/>
                        <REFGRP/>
                        <REFMES/>
                        <ARCKEY/>
                        <SERIAL/>
                   </EDI_DC40>
    Should I complete these values in my mapping program?
    Which values should I complete?
    Thank You.

    Antonio,
    you can ignore whole EDIDC Segement make disabled in our mapping still it works . but the problem is not with this is our meta data chekc in IDX2 t/c code of XI box.
          it has some problem the strcuture you generate and R/3 accepts are not same their is mismatch in structure
    Regards
    Sreeram.G.Reddy
    Message was edited by:
            Sreeram Reddy

  • File to IDOC. Mapping doubts...

    Hi XI Gurus..
    I'm doing a file to IDOC scenario.. I've a filed called Master Number and Sequence number..
    First I've to sort the file based on Master number. based on this sorted file I must sort the sequence numbers.
    For example:
    0011232      01
    0011232      00
    0011231      01
    0011232      01
    0011231      00
    after first sort
    0011232      01
    0011232      00
    0011232      01
    0011231      01
    0011231      00
    after second sort
    0011231      00
    0011231      01
    0011232      00
    0011232      01
    0011232      01
    Now in mapping I must create one IDOC for every set of Master number. In the IDOC a segment must repeat for every sequence number.. i.e For 0011231 there must 2  sequence segments i.e 00 and 01, and 0011232 also must have 2 sequence segments i.e 00 and 01

    hi,
    please try the following mapping,
    for creating the IDOC based on Message  Number
    message No-->removecontext->sort>spiltbyvalue(for value change)-->collapscontext---->EDIDD(IDOC TAB).
    to create the SEGMENT based on the Sequence number please try the following mapping.
    Sequence no-->removecontext---->sortbykey(key as messageNo)
    >formatbyexample(first queue is message no and second queue is sequence no)---->splitbyvalue(for  each value)-->segment(IDOCsegment).
    regards,
    navneet

  • File to IDOC: mesage mapping

    Hi!
    I am implementing File to Idoc scenario.
    I use in file a element "createdate". The same one does exist on Idoc side and hase type "xsd:string".
    Which type should have the element in data type?
    a) xsd:string
    b) xsd: date
    c) it does no matter
    Thank you!

    Hi!
    Thank you!
    Could you please explain why the option within message mapping "map the same structure..." is inactive in my case?
    Is that a bug?
    I am on SAP NetWeaver 7.0 SP 14 .
    Thank you!

  • File to IDOC aggsales mapping doubt Urgnt

    Hello,
    Im working for a retail client and the requirement is the File to IDOC scenario where Im stuck up in the mapping.
    The inbound is a flat file of structure
    EDI_DC40
    E1WPU01
    E1WPU02
    E1WPU03
    E1WPU04
    The target IDOC structure is as follows
    WPUUMS01
    --IDOC
    EDIDC40
    E1WPU01
    E1WPU02
    E1WPU03
    E1WPU04
    The problem is with the target segment E1WPU03. This E1WPU03 is actually an optional one in the source inbound flatfile.
    So the source will be like this
    EDI_DC40
    E1WPU01
    E1WPU02
    E1WPU03
    E1WPU04
    E1WPU02
    E1WPU04
    E1WPU02
    E1WPU03
    E1WPU04
    So in the target I need to create the 03 segment if and only if it occurs in the source.
    I tired these following but didnt work for me.. what happens is The 03 segment which should come in the third 02 segment actually comes int he second one.
    any suggestions if this is possible in message mapping or should I go for an xslt
    I tried this one.
    SourceE1WPU03 >exists> if withoutelse>then "constant'> targetE1WPU03
    Thanks
    Prasanna

    > any suggestions if this is possible in message mapping or should I go for an xslt
    No, this is not possible with graphical mapping tool.
    You need to have a pre-mapping for this.
    I recommend Java mapping with SAX parser.
    you can easily change the input structure to:
    EDI_DC40
    -E1WPU01
    --E1WPU02
    ---E1WPU03
    E1WPU04
    --E1WPU02
    E1WPU04
    --E1WPU02
    ---E1WPU03
    E1WPU04

  • Reg:file to idoc scenario

    In a file-xi-idoc scenario i created a business service for legacy
    system and a business system for R/3 receiver system
    i didn't assign logical system for the sender business service
    and assigned a logical system for the reciver business system
    so while maintaining partner profile in the R/3 system
    i have to give partner no:
                        partner type:
    here the problem is my sender business service i didn't assign any logical system,and it is not of LS type
    so then what do i need to give in the above two fields?
    answers required briefly

    Hello,
    you know this pdf:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c09b775e-e56e-2910-1187-d8eba09c7a4a
    Could be helpful.
    Regards
    Patrick

  • Reg File to IDOC scenario with Acknowledgment

    Hi Experts!
    In  a File to IDOC scenario , how to get the  acknowledgment back to PI after posting the IDOC to SAP system and send the acknowledgment to the sender system.
    What setting needs to be done in Sap  and PI? Is it better if we have a BPM or is it good to have another interface to pass the acknowledgment IDOC back to the file sender.
    Regards,
    Srini

    Dear All,
    For file to idoc scenario is there any possibility to get line items details or xml details i.e the segments and its related field details using reference id, transaction id or interface name or message id in SAP PI 7.0. I know we need to click each and every message in sxi_monitor and look for details.
    For SAP(R3 System) I can create a report and set the job for specific time period so automatically it throws the details(like reference no, document date, invoice no from) in ftp path as .csv file. The same ftp path is maintained in program.
    I wanted to check FTP--->PI postings and I have set the job at r3 system it is working fine and Im monitoring it too.
    Now the end to end scenario is FTP--->PI--->ECC(R3 system). Please help.Many Thanks.

  • File to idoc HRMD_A06 mapping

    Hi,
        My scnerio is to map file with an idoc. In my file I hav infotype 14 records. With following file structure.
    mesgtype
      item
         pernr
         begda
         endda
         lgart
         betrg
    I have taken this simple infotype instead of taking complex one's like actions. once I am through with this thn I will consider other infotypes.
    Idoc which I am using is very complicated HRMD_A06. There are many mandatory fieldin the idoc.
    Now during mapping I have mapped the above fields of file withe corressponding fields of idoc.
    And for For the E1PLOG E1PORIG E1PITYP segments I have provided following data :
    Plan Version ( 01 )
    Object Type (P- Person),
    Object ID (mapped with PERNR ),
    Operation (I - Insert Mode)
    But when I test the mapping I get the following error:
    :39:56 Start of test Mapping object MM_FILE2IDOC incomplete. Unable to continue execution
    Structure with min!=max without mapping
    16:39:56 End of test
    Kindly assist me with this scneario, if possible provide me the proper mapping details.
    Regards,
    Lokesh

    Hi,
    TABNAM, DIRECT, IDOCTYPE,CIMTYPE, MESTYPE, SNDPRT,SNDPOR, SNDPRN, RCVPRT,RCVPRN,RCVPOR are all mandatory fields.
    Map them with constants according to their type.
    Thanks,
    Sonalisa

  • File to Idoc Nodes mapping

    My sender File structure is like this..
    MT_Sender
    -Recordset 0 to Unbound
    --Header 1 to 1
    ---field1
    ---field2
    ---fieldx
    --GL_Account 0 to Unbound
    ---field1
    ---field2
    ---fieldx
    ---Cust_Item 0 to Unbound
    field1
    field2
    fieldx
    Curr_Item 0 to Unbound
    field1
    field2
    fieldx
    and I am mapping it to Idoc segments..
    Here my confusion is for Header segment in  Idoc I am mapping Header in my structure ..but it is giving mapping conversion error.
    I tried node to node and Recordset to node both are giving error.
    Can any one clear it NODE  level mapping to IDOC structute.
    ACC_document
      IDOC
       Begin
       NODE1
       NODE2
       NODE3
       NODEx
    Regards,
    Ramesh.

    ..Any inputs on it
    This info from sxmb_moni
    com.sap.aii.utilxi.misc.api.BaseRuntimeException: RuntimeException in Message-Mapping transformation: Cannot produce target element /ACC_DOCUMENT03/IDOC. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd at
    com.sap.aii.mappingtool.tf3.AMappingProgram.start(AMappingProgram.java:406) at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java:142) at com.sap.aii.mappingtool.tf3.AMappingProgram.execute(AMapp.....
    SXMB_MONI payload is
      <?xml version="1.0" encoding="utf-8" ?>
    - <ns:MT_FI_SENDER xmlns:ns="Http://xyz.com">
    - <ns:Recordset xmlns:ns="Http://xyz.com">
    - <Header>
      <USERNAME>OBTE-MM</USERNAME>
      <COMP_CODE>2000</COMP_CODE>
      <DOC_DATE>20091015</DOC_DATE>
      <PSTNG_DATE>20091015</PSTNG_DATE>
      <DOC_TYPE>DR</DOC_TYPE>
      <REF_DOC_NO_LONG>7578</REF_DOC_NO_LONG>
      </Header>
    - <GL_account_item>
      <ITEMNO_ACC>0000000001</ITEMNO_ACC>
      <GL_ACCOUNT>0003101110</GL_ACCOUNT>
      <ACCT_TYPE>S</ACCT_TYPE>
      <DOC_TYPE>DR</DOC_TYPE>
      <COMP_CODE>2000</COMP_CODE>
      <FISC_YEAR>2009</FISC_YEAR>
      <PROFIT_CTR>0000002002</PROFIT_CTR>
      <DE_CRE_IND>H</DE_CRE_IND>
      </GL_account_item>
    - <Customer_Item>
      <ITEMNO_ACC>0000000002</ITEMNO_ACC>
      <CUSTOMER>0000000092</CUSTOMER>
      <COMP_CODE>2000</COMP_CODE>
      </Customer_Item>
    - <GL_Currency_Items>
      <ITEMNO_ACC>0000000001</ITEMNO_ACC>
      <CURR_TYPE>00</CURR_TYPE>
      <CURRENCY>INR</CURRENCY>
      <AMT_DOCCUR>6000</AMT_DOCCUR>
      </GL_Currency_Items>
      </ns:Recordset>
      </ns:MT_FI_SENDER>
    Regards,
    Ramesh.
    Edited by: Sreeramoju Ramesh on Oct 15, 2009 1:28 PM

  • XML to IDOC : Hierarchy mapping help needed

    Hi All,
    I am trying to complete graphical mapping for an XML to IDOC structure. Both structures are EXACTLY same, but data is not populating in IDOC as desired.
    My incoming XML structure and IDOC structure is
    Header
    Data_header  (1 -- 999)
      |_Data_item (1 -- 3)
    Trailer
    If I have only 1 header, then IDOC data is populated correctly.
    But when I have multiple headers and theer items, the Headers are getting populated, but items do not get populated correctly.
    *Example  My Input is:*
    Header
    Data_header
      |_Item_1
      |_item_2
    Data_header
      |_item_3
    Trailer
    My output is (IDOC)
    Header
    Data_header
      |_Item_1
    Data_header
      |_Item_2
    Trailer
    As seen above Item3 of Data_header2 has gone missing._
    For Data Header, I am using REMOVE_CONTEXT function and for ITEM I am using SPLITBYVALUE. Thought this should have helped, but am struggling.
    Any tips, help, greatly appreciated.
    Many thanks
    Shirin

    Hello,
    Have you done one to one mapping, as u mentiong they are exactly same..
    if that's the case, then mapping test should be successful.
    If there is any diffrence in occurences of target structure or any other difference and let me know.
    If possible send me the target structure...
    Regards,
    Sreenivas.

  • Flat file to idoc MATMAS05 - mapping

    Hi,
    I want to create 2 Idocs from one recordset.
    Can any one tell me how do I map this Recordset to an Idoc?
    Example source and target IDOC structures:
    Source:-
       <Recordset>
          <SA010>
             <IDENTS>1234</IDENTS>
             <BEZ>Dummytxt</BEZ>
          </SA010>
          <SA088>
             <IDENTS>1234</IDENTS>
             <MARC1>010</ MARC1>
             <MARC2>020</MARC2>
          </SA088>
       </Recordset>
    Target:-
        <MATMAS05>
             <IDOC BEGIN="1">
                <E1MARAM SEGMENT="1">
                   <MATNR>1234</MATNR>
                   <E1MARCM SEGMENT="2">
                      <WERKS>010</WERKS>
                   </E1MARCM>
                </E1MARAM>
             </IDOC>
          </MATMAS05>
        <MATMAS05>
             <IDOC BEGIN="1">
                <E1MARAM SEGMENT="1">
                   <MATNR>1234</MATNR>
                   <E1MARCM SEGMENT="2">
                      <WERKS>020</WERKS>
                   </E1MARCM>
                </E1MARAM>
             </IDOC>
          </MATMAS05>
    Thanks and Regards,
    Eren

    Hello Varun,
    My flat structure:
    <Recordset>
    <b><SA010></b>
    <i><IDENTS>1234</IDENTS>
    <BEZ>Dummytxt</BEZ></i>
    <b></SA010></b>
    <b><SA088></b>
    <IDENTS>1234</IDENTS>
    <i><MARC1>010<>
    <MARC2>020</MARC2></i>
    <b></SA088></b>
    </Recordset>
    The MATNR field is <IDENTS>. I can pick the value from node <SA010> or <SA088>.
    Thanks

  • File to IDOC ( need advise on how to map file fields )

    Hello friends,
    I spent quite some time reading all the helpful blogs and threads regarding File to Idoc scenario. However I had a very basic question ( maybe its trivial as I am just new to XI).
    In my scenario I have Bank Master data (in a CSV file) and it does not correspond exactly to Bank Master IDOC structure BANK_CREATE01.
    I understand that I will need to use File adapter to get this file into XI and then use an IDOC adapter to send it to R/3. (Pl correct me if I am wrong)
    Now when I use file adapter, how will I do the data mapping. I mean do I need to create a structure which corresponds to file fields and then XI will automatically load my file fields into this structure and then I can use this structure to map fields to IDOC.
    My only issue seems to be how will I see the FLAT FILE data in XML FORM in XI.
    To explain it further my CSV file looks like
    "GB,123456,11223344,GBP, London,.."
    where
    GB corresponds to country,
    123456 corresponds to Bank key,
    112233445566 corresponds to Bank account,
    GBP is currency and so on
    So should I create a data type maintaining same sequence of fields above without using any hierarchy like in the IDOC.
    If this is not possible then will I need to transform my input file exactly into IDOC structure and then use it.
    Hope I have manged to explain it.
    Appreciate your help on same.
    Thanks
    Shirin

    Hello Shrini,
    First of all The CSV file has to be changed in to an XML file , To achieve this File Content Conversion has to be done.Once this is done, please make the following changes in R/3 and PI to push Idoc in to PI.
    Configuration required at Xi side:
    Go to IDX1: configure the port.
    Go to IDX2: load the DOC metadata.
    Go to SM59: Create RFC destination which points to R3 system this is require in the case where your IDOC is sent to R 3 system,
    Configiration required at R3 side:
    Maintain Logical System for PI (SALE transaction):
    Maintain Partner Profile for XI system(WE20):
    Thanks,
    Kiran.

  • Doubt in fields - message mapping (file 2 idoc scenario)

    while doing message mapping in file 2 idoc scenario, i could not able find the values for some field names
    ( i am following this wiki help
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/profile/2007/05/11/fileToIDOC& )
    cremas04 idoc
    vendorNo LIFNR
    vendor name Name1
    Pur_org   ? ( I could not able locate field with the similar desc in idoc MT side)
    Company code  ?
    Acc_Grp  ?
    Search term MCOD1
    Address ADRNR
    City ORT01
    Pin_code PSLTZ
    could you help me out with this?
    Message was edited by: praba
            praba

    hi,
    I got the answer.

  • 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

Maybe you are looking for