File to IDOC scenario : Error with mapping due to Context handling

Hi Experts.
I have a file to IDOC scenario which need your advice.
Source File structure as follows:
Control_Header     <1:1>
Invoice_Header     <1:unbounded)
Invoice_Line          <1:unbounded)
Trailer                    <1:1>
Payload as follows capture from SXMB_MONI
- <Control_Header>
        <Key>999</Key>
        <TransactionID>RCTV</TransactionID>
  </Control_Header>
- <Invoice_Header>
    <Key>000</Key>
    <BusinessUnit>HDB05</BusinessUnit>
    <InvoiceNo>64471</InvoiceNo>  
</Invoice_Header>
- <Invoice_Line>
      <Key>001</Key>
      <UnitPrice>7.00000</UnitPrice>
      <Quantity>1.0000</Quantity>
      <GSTAmount>0.49</GSTAmount>
      <GSTRate>0.07</GSTRate>
  </Invoice_Line>
- <Invoice_Line>
      <Key>001</Key>
      <UnitPrice>8.00000</UnitPrice>
      <Quantity>1.0000</Quantity>
      <GSTAmount>0.56</GSTAmount>
      <GSTRate>0.07</GSTRate>  
</Invoice_Line>
- <Invoice_Header>
      <Key>000</Key>
     <BusinessUnit>HDB21</BusinessUnit>
     <InvoiceNo>6Y0575</InvoiceNo>
</Invoice_Header>
- <Invoice_Line>
    <Key>001</Key>
    <UnitPrice>49.50000</UnitPrice>
    <Quantity>1.0000</Quantity>
    <GSTAmount>3.47</GSTAmount>
    <GSTRate>0.07</GSTRate>
</Invoice_Line>
- <Trailer>
     <Key>TRL</Key>
     <TransactionID>RCTV</TransactionID>
     <TotalFeedLine>96</TotalFeedLine>
     <HashTotalValue>212.00</HashTotalValue>
</Trailer>
  </ns:MT_EINVOICE>
Mapping as follow:
                                               IDOC
<Control_Header>   ->    <Control_Header>
<Invoice_Header>   -->  <Header_Invoice>
<Invoice_Line>      --->        removeContext  -->  <Line_Invoice>       this is the child node of <Header_Invoice>
<Trailer>               -
>    <Trailer>
The result of the using the above Payload get the following result which not wht I seek
<Control_Header>
<Header_Invoice>
      <Line_Invoice>
      <Line_Invoice>
     <Line_Invoice>   *** This belong to the Invoice_Line of the second <Header_Invoice> at the payload
<Header_Invoice>
     <Line_Invoice>   *** THis segment is empty
<Trailer>
I required the Line_Invoice to belong to the child of the second <Header_Invoice>, I have tried using
removecontext with splitVaue and collaspeContext but to no avail.
May I know what is my mistake on the mapping of the Invoice_Line to Line_Invoice>
Rgds
FNG

Hello,
There should be something that could correlate the Invoice_Header/Key and Invoice_Line/Key. In your example, both are the same for the first and data set. If the sample looks like the one below, it is possible to sort things by correlating the Invoice_Header key and Invoice_Line key
<Invoice_Header>
  <Key>000<Key>
</Invoice_Header>
<Invoice_Line>
  <Key>000<Key>
</Invoice_Line>
<Invoice_Line>
  <Key>000<Key>
</Invoice_Line>
<Invoice_Header>
  <Key>001<Key>
</Invoice_Header>
<Invoice_Line>
  <Key>001<Key>
</Invoice_Line>
An example mapping could look like this
For Header
Invoice_Header --> Header_Invoice
For Line
/InvoiceLine/Key --> removeContext --> splitByValue:valueChanged --> Invoice_Line
The subfields of the invoice line would also follow a similar logic, you just need to use formatByExample --> splitByValue:eachValue so that the context levels are the same.
Hope this helps,
Mark

Similar Messages

  • File to IDOC scenario error...

    Hi all,
    we hhave created an File to Idoc scenario .
    we are getting the following error in SXMB_MONI t-code.
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <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_INV_SND_SERV</SAP:Code>
      <SAP:P1>BUS_SENDER</SAP:P1>
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>Unable to convert sender service BUS_SENDER to an ALE logical system</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    can any one plz say wat this error might be..
    TIA
    Regards,
    Raj

    Hi,
    The problem occurs when sender and receiver business system or business service does not have a logical system name.
    ID - Integration Directory
    Posting the IDOC'S into SAP R/3 System, sender and receiver business system or business service requires the logical system name. If the business system (Web As ABAP) does not have the logical system name, then add the logical system for business system.
    If business system type = Web AS ABAP, then add the Logical system in Technical System level and Save.
    If business system type = Third-Party, then add the logical system in business system level and Save.
    If the business service does not have the logical system name in ID, it needs to be configured as follows.
    Go to ID and click the Business service -> Services -> Adapter Specific Identifiers. Enter the logical system name and Save.
    Apply and activate.
    hope this will help you.
    regards
    Aashish Sinha
    PS : reward points if helpful

  • File to idoc scenario error - not working yet :(

    Hello! I'm trying to make changes in business partner record in CRM using idoc CRMXIF_PARTNER_SAVE_M01
    I have an error 56 EDI: Partner profile not available.
    In Control record in we02 transaction, I have right Partner number for Recipient information - logical system name like CRM has in SLD.  But there is no Port.
    In Sender information I have right Partner number, like my filesystem business system has in SLD and have a port SAPP1D - but  I have nowhere entered it!
    And one more little question. In we20 transaction am entering inbound parameters for partner:
    CRMXIF_PARTNER_SAVE
    CRMXIF_PARTNER_SAVE_M
    1) Is this right inbound parameters for my idoc?
    2) What Process code should I use ?

    Hi,
    in XI in IDX1 transaction, maintain a port for CRM system specifying the CRM port and the client and the RFC destination from XI to CRM system.......moreover if you are using apply control record values from payload option in reciver IDOC comm channel, then in the IDOC control record in msg mapping map the sender port to CRM port, partner number as logical system of CRM ie C2DCLNT100 and partner type as LS..........then when you will re-run your scenario, your IDOC will have CRM port also in the control record..........
    in CRM system your WE20 for LS for XI should have as an inbound parameter your IDOC - which i think you have already done.........
    One more thing - put everything in uppercase letters everywhere in msg mapping in control record data, in we20 setting etc.
    Regards,
    Rajeev Gupta

  • File to IDOC scenario-no messages in SXMB_MONI

    Hi all,
       I know this is asked so many times ,I checked some links but couldn;t find out the gap where it happened.
    I am doing a File to IDOC scenario through XI mapping.
    I am not getting any messages in SXMB_MONI.
    When I check Communication Channel monitering in Runtime Workbench, it shows processing successfully, then it should generate messages in SXMB_MONI and intimate whether the scenario created is correct or not right!
    Please help.
    My scenario goes like this:
    Sender : Business service(Some file location)
    Used File adapter for sender communication channnel.
    Receiver : Business system(SAP R/3)
    Used IDOC Adapter for receiver communication channel.
    One more thing is,do I need to create logical system for Business service also?If so, where do I maintain it?(In SAP R/3 or in XI system?)
    Till now,I maintained my XI system as logical system in WE20 and I didn't create any logical system for business service in any system.Does it create main problem?

    Hi , I am able to poll the files from file location now.and I am receiving IDOC into SAP R/3 with status 56.I already created partner for file path as a logical system and assigned inbound parameters with respective message type . Even the status shows :
    An inbound partner profile could not be found with the following key:
    /LSDEMO/LS//DEBMAS////
    This involves the key fields of table EDP21:
    -SNDPRN  partner number of sender
    -SNDPRT  partner type of sender
    -SNDPFC  partner function of sender
    -MESTYP  logical message type
    -MESCOD  logical message code
    -MESFCT  logical message function
    -TEST    test flag
    I already manitained following data and there is one record in EDP21.
    SNDPRN  = LSDEMO  
    SNDPRT  = LS
    SNDPFC = LS
    MESTYP   =  DEBMAS
    MESCOD = space
    MESFCT = space
    TEST = space
    EVCODE   = DEBM
    SYNCHK = X
    METHOD = space
    USRTYP = space
    USRLNG = space
    INMOD = space
    DCART = space
    And please let me know whether I have to maintain outbound parameters  also for my partner in XI system.I didn't see any difference even I maintained it.
    And my IDOC takes another port rather than I mentioned in my SNDPRN(sender port) of my IDOC control record in message mapping.Let me know whether it's mandatory to maintain port name with SAP<XXX>convension,because IDOC in R/3 is picking the port with that naming convension.
    Edited by: Jaya on Feb 26, 2010 10:17 AM
    Edited by: Jaya on Feb 26, 2010 10:27 AM

  • IDOC is posting with Errors in File to IDOC scenario

    Hi,
       I did the File  to IDOC scenario for CREMAS  . IDOC is posting with Errors .. i.e. in the status record it was showing  56- EDI: Partner profile inbound not available  ..
    If I manually process that IDOC in WE19 , then it was processing successfully..    and in the  we19 it was showing Inbound Processing : Port Not Maintained    but even though manually it was posting fine...
    any ideas regarding this will be appriciated..... 
    Regards
    Babu

    Please check whether you had done the following assuming your doing File to Idoc
    Settings in your Business service for the receiving system
    Please specify the RFC detination, SAP System and Client of the Receiving System in the adapter specific detials.
    Settings in R/3
    WE20 - Add the partner profile for the particular message type cremas and process code.
    Your statement
    " and that same logical system name  had given as Message Specific Attributes in the Sender Business Sevice parameters in I.D "
    Please do mention R/3 Details in the receiver business service or system.
    Thnz

  • Idocs with errors added status-56 in file to idoc scenario- how to rectify

    hi ,
    in file to idoc scenario when i m sending the file from ftp server to IS Retail,  file is successfully getting processed but the idoc is showing error ,when we see using WE05 tcode or BD87 , pl sugggest how to rectify it to make the status 53

    Hi,
    Have you configured the partner profile details? check these steps..
    1. In the receiver system you must configure the partner profile for your sender system in WE20.
    2. Add the IDoc message type to inbound parameters of the partner profile and configure the appropriate process code.
    2. Fill the Logical system name for your senderservice-->Adapter Specific identifiers in ID.
    <a href="/people/venugopalarao.immadisetty/blog/2007/01/24/troubleshooting-file-to-idoc-scenario-in-xi File-to-IDOC Scenario</a> By Venugopalarao
    <a href="/people/ravikumar.allampallam/blog/2005/02/23/configuration-steps-required-for-posting-idocsxi Steps for Posting IDOC's</a> By Ravikumar Allampalam
    Regards
    San

  • File to idoc scenario with controls

    I am working on file to idic scenario.
    file has four types of lines :
    Begin of file.
    header.
    items.
    end of file.
    each line has a element Record type and some other elements.for header record type is A , for item its B , for Begin of file its C and for end of file its D.
    we have to check for every line that it should have record type as one of these four and if not so we have to send a mail through alert functionality.we have to send a mail which has all errors by checking the whole file for record types.we have to ignore these lines in the file and proceed with the rest.
    how can we implement this?
    regards,
    rohit

    Hi,
    Please go through these links
    /people/prateek.shah/blog/2005/06/08/introduction-to-idoc-xi-file-scenario-and-complete-walk-through-for-starters
    /people/venugopalarao.immadisetty/blog/2007/01/24/troubleshooting-file-to-idoc-scenario-in-xi
    /people/ravikumar.allampallam/blog/2005/06/24/convert-any-flat-file-to-any-idoc-java-mapping
    /people/pooja.pandey/blog/2005/07/27/idocs-multiple-types-collection-in-bpm
    /people/sravya.talanki2/blog/2005/08/17/outbound-idocs--work-around-using-party
    /people/venugopalarao.immadisetty/blog/2007/01/24/troubleshooting-file-to-idoc-scenario-in-xi
    Thanks
    Vikranth Khimavath

  • Problem with Sender service in File to IDOC scenario

    Hello All,
    Am doing a file to IDOC scenario.
    I have configured the sending system as a party and added a business component, to the BC attached the service interface and also configured the sender Communication channel(CC) as file.
    On the receiving end configured the R/3 system from SLD as the business system and configured the receiver CCl. Can see the R/3 logical system in the Adapter specific identifiers at business system.
    Pushing the file get an error "Unable to convert the sender service  to an ALE Logical System".  But choosing "Take sender from Payload" in the receiver CC is resolving the problem, however the sender partner number remains the same as what I have mapped to the control record in message mapping (which is like hard coding).
    My questions are:
    1. Am I doing the correct config in terms of the scenario. (like using  "Take sender from Payload")
    2. I tried using identifiers at the party level to convert the sending system, but nothing seems to work. But sending system remains the same as the constant from mapping.
    Suggestions would be very much helpful..
    --Prashanth
    PS: Have gone through many blogs and posts on the forums, but may be I did not see the correct thread. Apologies if I am asking this again.

    Hi Prashanth,
    refer the below discussion i think it will solve your problem.
    File To Idoc scenario
    Thanks

  • 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.

  • How to catch Posting error in File to IDoc Scenario?

    I have successfully completed File to IDoc Scenario. Now I am interested in catching posting error. i.e., if mapping goes well and when IDoc is being sent to Recipient system then if any posting error is encountered, then a mail should go to a recipient.
    Can anybody suggest the solution.
    Regards,
    Suraj Kumar

    Hi Suraj,
    this can be done by triggerring an alert to the recipient.chk out these links to trigger a alert
    /people/sap.user72/blog/2005/01/14/alert-management--improving-monitoring-of-your-landscape
    /people/sap.user72/blog/2005/01/14/alert-management--improving-monitoring-of-your-landscape
    regards
    jithesh

  • Mapping of Control records in file to idoc scenario

    Hi,
    In the mapping part of file to idoc scenario is it necessary to provide the exact control record details
    or will it pick what ever is mentioned ? Can any one please explain regarding the same?
    Many Thanks,
    Sharath

    hi,
    in case of apply control records from payload
    It is indeed very simple to do it and the feature is available from SP10. I have seen lot of posts on the forum for the same and that is the reason for this blog. We can manipulate the control record in the mapping editor and map the EDI_DC40 segment of Idoc as required. Most of the times we need to map only SNDPRN, RCVPRN, SNDPRT, RCVPRT for posting Idocs with appropriate partner profiles in SAP R/3 destination systems. We can disable the rest of the fields as shown below. We need to manually change the control record of idoc for populating partner profiles in the control records while dealing with non-sap sender system, which will be used by receiver SAP system for posting idocs with appropriate ALE configurations.
    check this blog
    /people/sravya.talanki2/blog/2005/12/02/manipulating-idoc-control-records-from-payload
    regards
    chandra

  • Error values in Idoc Control Records in File to Idoc Scenarios

    Hi All,
       I am posting 2 different types of Idocs in 2 different File-to-Idoc Scenarios. In many cases both these files may get picked at the same time. One is an Orders Idoc and the other one is Shipment Idoc. The Orders Idoc has a control record value in the Sender Partner Fn as 'ZC' while as for Shipment Idoc that value is not passed. The other Sender parameters are passed and are different for both these idocs. But when the files are processed, the value 'ZC' get populated for the Shipment Idoc also. When 100 files are sent with 90 orders and 10 shipments, the shipments get created with 'ZC' partner fn. This is visible in the Call Adapter Pipeline Step under the node IDocOutbound. . I have 2 different Idoc receiver adapters.Can anybody help me out here?
    Thanks,
    Geetha

    Hey,
    >'ZC' while as for Shipment Idoc that value is not passed
    Check whether the Source/ Mapping  populates the 'ZC' , Did you checked Apply Control record in Receiver Adapter for Shipment, What is the name  you have mentioned for the in the SLD -Logical system  for Sender system
    Cheers
    Agasthuri

  • Error:IDOC_ADAPTER" ATTRIBUTE_INV_SND_PARTY : File to IDOC scenario .

    Dear XI experts ,
    Issue : Error to a new implementated SAP ERP SYSTEM . File to IDOC Scenario
    Business Scenario :  Exchange Rates from Thomas REuters (XML) - > XI-> SAP 1 , SAP 2  ERP Systems ( 2 diff SAP ERP systems)
    SAP 2 is a new  system set up for a new plant  of our Organization.
    The Excahnge rate is gettiong updated  by IDOC: EXCHANGERATE.EXCHANGE_RATE01 in  two SAP Systems
    Each one is configured with  diffrent IDOC receiver .
    The Error is :       for the SAP 2 system  . The MEssage gets branched and one  message is successfully sent to SAP1 , and turns an error :    in SXMB_MONI for SAP2  system
    I had been thropugh few blogs have performed the below steps:
    -IDOC metadata : IDX2  have configured in XI
    -checked the port of EGP , Partner Profile in SAP 2 ERP system
    -Checked IDX1 , IDX2 of SAPEGP in XI .
    -Refreshed business system .
    -Tried to send the xml data from the start point through File Zilla(FTP)
    Could somehow help as this is Production issue  ans this is affecting the business.
    Error from 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_INV_SND_PARTY</SAP:Code>
      <SAP:P1>http://sap.com/xi/XI</SAP:P1>
      <SAP:P2>XIParty</SAP:P2>
      <SAP:P3>Reuters</SAP:P3>
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>Unable to convert sender XI party http://sap.com/xi/XI / XIParty / Reuters to an IDoc partner</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
    Reuters : is the Sender Party of Exchange Rates. I have seen in blogs to craete agency / schema , but since thsi scenario is 2 seperate SAP ERP systems , my question is do i need to create agency , schema for sender party .
    Appreciate your Input
    Thank you,
    Vara
    Edited by: Varalakshmi SB on Oct 26, 2011 12:14 PM
    Edited by: Varalakshmi SB on Oct 26, 2011 12:16 PM

    agency and scheme are used when your doing B2B scenarios.

  • File to IDoc scenario( Bypass)-- Error ( Segment is missing) -- urgent pls.

    Hi All,
    I am doing File to IDoc scenario( Bypass) for Orders05.
    File is picking succesfully and not posting the idoc in the SAP..
    My source file(idoc-xml) consists of all the required data to post the idoc including the segment 'E1EDK01'.
    but the error it is showing is <b>" Obligatory node 'E1EDK01' missing in the structure ORDERS05 "</b>
    Please suggest me ASAP what is going wrong .
    Thanks in Advance.
    Regards
    Seema.

    The source File is not the idoc XML. It is invalid. You might need to ask the source to change the XML or use a Mapping to do this.
    This is how it should look, ( check the parts in bold),
    <?xml version="1.0"?>
    <ORDERS05>
    <IDOC <b>BEGIN ="1"</b>>
    <EDI_DC40 SEGMENT="EDI_DC40">
    <DOCNUM>1</DOCNUM>
    <DIRECT>2</DIRECT>
    <IDOCTYP>ORDERS05</IDOCTYP>
    <CIMTYP></CIMTYP>
    <MESTYP>ORDERS</MESTYP>
    <SNDPOR>XXXXXXXXX</SNDPOR>
    <SNDPRT>LS</SNDPRT>
    <SNDPFC></SNDPFC>
    <SNDPRN>XXXXXXXX</SNDPRN>
    <RCVPOR>XXXXXX</RCVPOR>
    <RCVPRT>LS</RCVPRT>
    <RCVPFC></RCVPFC>
    <RCVPRN>XXXXXXXX</RCVPRN>
    <CREDAT>20070511</CREDAT>
    <CRETIM>152803</CRETIM>
    </EDI_DC40>
    <E1EDK01 <b>SEGMENT = "1"</b>><BELNR>AAAAAAAAA123</BELNR>
    </E1EDK01<b>SEGMENT = "1"</b>>
    <E1EDKA1 ><PARVW>EK</PARVW> <ILNNR>231654845121</ILNNR>
    </E1EDKA1>
    <E1EDKA1 <b>SEGMENT = "1"</b>><PARVW>LF</PARVW>
    <NAME1>international</NAME1>
    <NAME2>Delhi</NAME2>
    <ILNNR>2121211545</ILNNR>
    </E1EDKA1><E1EDK02 <b>SEGMENT = "1"</b>><QUALF>001</QUALF>
    <BELNR>AAAAAAAAA123</BELNR>
    </E1EDK02><E1EDK02 <b>SEGMENT = "1"</b>><QUALF>002</QUALF>
    <BELNR>AAAAAAAAA123</BELNR>
    </E1EDK02><E1EDP01><POSEX>45</POSEX>
    <E1EDP19 <b>SEGMENT = "1"</b>><QUALF>001</QUALF>
    <IDTNR>00000000002150059</IDTNR>
    <KTEXT>Reddy</KTEXT>
    </E1EDP19><E1EDP19>
    <QUALF>003</QUALF>
    <IDTNR>5484218521214</IDTNR>
    </E1EDP19></E1EDP01>
    </IDOC></ORDERS05>
    Regards
    Bhavesh
    PS : You need to add SEGMENT = "1" for every segment. Please do add it if I have missed in the XML above.

  • FILE TO IDOC  SCENARIO WITH SCREEN SHOTS

    can u please send me  FILE TO IDOC  SCENARIO WITH SCREEN SHOTS and do the needful for me

    /people/ravikumar.allampallam/blog/2005/03/03/creating-purchase-order-idoc-through-xi
    /people/michal.krawczyk2/blog/2005/03/29/xi-error--unable-to-convert-the-sender-service-to-an-ale-logical-system
    /people/prateek.shah/blog/2005/06/08/introduction-to-idoc-xi-file-scenario-and-complete-walk-through-for-starters
    /people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions
    Also have a look at these forum threads...
    IDOC TO FILE SCENARIO
    idoc to file scenario
    I hope this answers your query.
    regards
    Sreeram.G.Reddy
    Message was edited by:
            Sreeram Reddy

Maybe you are looking for

  • MIGO Goods receipt Error

    Dear All                At the time of goods receipt with reference to 303 movement type system through out the error as " In consistancy in classifycation Data" after that its terminating the session ..what is the problem and solution.. for this Reg

  • Unable to open links in new window when using servicedesk app. it was ok in ver 3.6

    there was no issue until firefox was upgraded to 6.02

  • 6.1 to 5.1

    Can a servlet/JSP in 6.1 talk to a EJB in 5.1. http://edocs.bea.com/wls/docs61/interop/interop.html This article says although it is possinle with WL 5.1 Servicepack 11, they need to make another JAR file available for this. Any ideas when this will

  • Convert PDF; why can't I use the annual purchase after 5 converts and 7 months?

    I purchased export PDF convert to word see invoice below. I used the system successfully 5 times and now I can't, I am asked to purchase the ability to convert again. Page 1 of 1 Comments: 19.99 Invoice Total USD Currency Sales Tax 0.00 0.00 S & H In

  • Problems with numbers

    I purchased the application numbers, I restored the IPAD and now I can not download new numbers, how can I pay again?