Mapping Editor using Multiple Structures

Hello all!
I am trying to implement complex mapping scenario in the Mapping Editor. The source structure has tree element tags, <ORDEMSERVICO>, <SERVICOS> and <PECA>, and xml root element <MT_OrdemServico_Dealer>. Translating this tags for English, we have <Service Order>, <Services> and <Parts>. So, we could be 1 or N orders, composed with services and services with parts.  We need to transform this source structure into a target structure like as EDI file, repeating  ID_CONC, ID_OS elements of <ORDEMSERVICO> into a <SERVICOS>, and repeating the same elements into a <PECA> and adding ID_CONC, ID_OS, ID_SERVICE.  It follows below both samples Source and Target Structure.
We have tried uses Mapping Editor with a Standard functions: SplitByValue and OneAsMany  in the lowest elements <SERVICOS> and <PECAS>.  Because, it is possible has  many services with parts, or one service with many parts. And both can have one or more Service Order.  But we couldnu2019t have success.
Please see the source and target xml files?
Please somebody could help me? To solve this problem? Is there other way to do this?
Thanks for your help!
Regards!
*Source Structure*
<?xml version="1.0" encoding="UTF-8"?>
<MT_OrdemServico_Dealer>
             <DEALER>
      <ID_CONC>ID_CONC</ID_CONC>
      <ORDEMSERVICO>
         <ID_OS>Service Order Number 1000</ID_OS>
         <TP_OS> Type Service Order - 10</TP_OS>
         <CHASSI>CHASSI Number 9090190HJJX</CHASSI>
         <MODELO>Car Model Honda CRV</MODELO>
         <SERVICOS>
            <TP_SERV>Type Service - Inspetion</TP_SERV>
            <DS_SERV>Description Service Inspetion car</DS_SERV>
            <PECA>
               <CD_PECA>Code Part - A</CD_PECA>
               <QT_PECA>Quantity part - 1</QT_PECA>
            </PECA>
            <PECA>
               <CD_PECA>Code Part - B</CD_PECA>
               <QT_PECA>Quantity part -2 </QT_PECA>
            </PECA>
         </SERVICOS>
         <SERVICOS>
            <TP_SERV>Type Service - Revsion</TP_SERV>
            <DS_SERV>Description Service RevisionCar</DS_SERV>
            <PECA>
               <CD_PECA>Code Part - C</CD_PECA>
               <QT_PECA>Quantity part -1</QT_PECA>
            </PECA>
         </SERVICOS>
      </ORDEMSERVICO>     
   </DEALER>
</MT_OrdemServico_Dealer>
*Target Structure*
<?xml version="1.0" encoding="UTF-8"?>
<MT_OrdemServico_Dealer>
      <ORDEMSERVICO>
         <ID_CONC>ID_CONC</ID_CONC>
         <ID_OS> Service Order Number 1000</ID_OS>
         <TP_OS> Type  Service Order - 10</TP_OS>
         <CHASSI>CHASSI Number 9090190HJJX</CHASSI>
         <MODELO>Car Model Honda CRV</MODELO>
         <SERVICOS>
           <ID_CONC>ID_CONC</ID_CONC>
           <ID_OS> Service  Order Number 1000</ID_OS>
            <TP_SERV>Type Service - Inspetion</TP_SERV>
            <DS_SERV>Description Service Inspetion car</DS_SERV>
            <PECA>
              <ID_CONC>ID_CONC</ID_CONC>
              <ID_OS> Service Order Number 1000</ID_OS>
              <TP_SERV>Type Service - Inspetion</TP_SERV>             
              <CD_PECA>Code Part - A</CD_PECA>
               <QT_PECA>Quantity part - 1</QT_PECA>
            </PECA>
            <PECA>
               <ID_CONC>ID_CONC</ID_CONC>
              <ID_OS> Service Order Number 1000</ID_OS>
              <TP_SERV>Type Service - Inspetion</TP_SERV>            
               <CD_PECA>Code Part - B</CD_PECA>
               <QT_PECA>Quantity part -2 </QT_PECA>
            </PECA>
         </SERVICOS>
         <SERVICOS>
            <TP_SERV>Type Service - Revsion</TP_SERV>
            <DS_SERV>Description Service RevisionCar</DS_SERV>
            <PECA>
               <CD_PECA>Code Part - C</CD_PECA>
               <QT_PECA>Quantity part -1</QT_PECA>
            </PECA>
         </SERVICOS>
      </ORDEMSERVICO> 
</MT_OrdemServico_Dealer>

That should work with useOneAsMany
It should be:
ID_OS                     \
PECA                      - useOneAsMany - ID_OS
PECA - splitbyvalue /

Similar Messages

  • Is it possible LSMW recording method using multiple structures

    Hi,
    can any body tell me, is it possible LSMW recording method using multiple structures
    i,e using Header details one flat file structure and Item details another flat file structures

    Hi,
    Check this link..
    LSMW multiple structure migration

  • Multiple structures in BEx used in CR

    hi,
    I have a BEx-query (P&L) which uses multiple structures.
    When I open it in CR I see my key figures OK, but the other structure is displayed as one field.
    I want to format my report in CR so that some fields in the structure are indented, some should be bold etc etc.
    When my list of fields in the structure are displayed as only ONE field in CR this formatting will be set on all fields in the structure and that's not what I want.
    I have a workaorund for this, but it's quite complex for the end users so I wonder if you have any news on if and when we will be able to get a BEx-query with multiple sttructures in CR and in CR be able to format each field in the structure in an easy way.
    Kind regards
    /martin

    hey, i have the same problem.. whats your workaround? Can you give me a hint?

  • Manage multiple structure mapping

    Hello all,
    i have a scenario MAIL -> PI -> MAIL.
    I am working with standard XSD with multiple external references and namespaces for my outbound and inbound structureq. All messages have different structures that i cannot merge because of different namespace untouchable.
    I have a Sender Mail Adapter in order to read my mailbox with an interface filling in it.
    I know the interface i need to use only when i am reading a specific field in the mail attachment.
    My problem is that the interface in the CC refers to one Interface mapping while i need something dynamic. I cannot use also condition in receiver determination or interface determination due to my standard structure.
    I would like something to allow me to choose what Interface mapping i use... I recall that each XSD structure are different, this is the main problem for me.
    It must be a way to do it but i don't find it, someone got an idea ?
    Thanks,
    Jean-Philippe

    OK, if you always have the same receiver, you should give the condition in the interface determination. On which PI version are you working?
    In fact PI doesn't care as much about real fitting interface structures as long as you do not wish to do validation or so. You just have to configure things right. E.g. you can chose as interface the IDoc WBBDLD04, but you give the PI an INVOIC01. If you just transport the message, nobody cares.
    Now, if you read the mails from your mailbox with a dummy interface, you actually don't know, what's in your message. You're sending the message always to the same receiver system, so you don't have to give any condition here. Now in interface determination, you give all the interfaces that possibly could be on the inbound side. For each interface you now have to put a condition, where you check with an xpath expression, if it is maybe a WBBDLD04 or an INVOIC01 or a DELVRY03 or whatever you have to check.

  • Coverage Strategy use multiple Category Structures

    Hi AFS Expert,
    In the same Coverage Strategy, does it allow to use multiple Category Structures to do the transfer from requirement category to stock category?
    E.g Category Structure: AA, BB
    "Category Structure AA --&gt; Coverage Strategy CS1 --&gt; Requirement category" transfer to "Category Structure BB --&gt; Coverage Strategy CS1 --&gt; Stock category"
    Is it possible to do?
    Looking forward your kind advise.
    Thanks,
    Mag

    Hello Mag,
    The coverage strategy is configured for a single category structure and it maps the category values of that category structure. We can define the sequence in which the stock categories map the requirement categories. We will not be able to map the requirement category to stock category across category structures.
    Hope this information helps.
    Regards
    Sudha
    >
    Mag Sai wrote:
    > Hi AFS Expert,
    >
    > In the same Coverage Strategy, does it allow to use multiple Category Structures to do the transfer from requirement category to stock category?
    >
    > E.g Category Structure: AA, BB
    >
    > "Category Structure AA --&gt; Coverage Strategy CS1 --&gt; Requirement category" transfer to "Category Structure BB --&gt; Coverage Strategy CS1 --&gt; Stock category"
    >
    > Is it possible to do?
    >
    > Looking forward your kind advise.
    >
    > Thanks,
    > Mag

  • Using multiple joiners in a mapping

    Is it possible to use multiple joiners in a mapping? Or should we use a single joiner with multiple INGROUPs?
    Here is a scenario.
    I have tables A, B and C and I want to join all three
    I joined A and B with joiner1
    Now I use joiner2 to join table C with output of first joiner
    The mapping did not give any error, but when I executed, it consumed all temp table space and disk usage became 100%

    Hi,
    Usually this Temp issue comes in picture when u have some problem with your join its not a issue with number of joiners, i guess its a problem with you join condition which must be generating some Cartesian more number of rows than expected , it happens when u miss some join condition , please review you join condition again. you may want to run the intermediate results of the joins individually , run the first join query and see what happens , please check the explain plan when you do this some times poor execution plan may kill you box and temp spaces
    Suresh
    Edited by: Suresh_G on Jun 3, 2009 12:03 PM

  • APD using Query with multiple structures as a data source

    All,
    I want to set up an automatic process which executes a query and exports it to a shared drive as a csv file. I have tried various options , when I try to use APD to set up the extract, I get an error and this is because the query that I am trying to use has Strucutres in both rows and columns. Hence, I am unable to use this option. I tried RSCRM_BAPI, It works well, but there is an issue with scheduling this in Process chain. I created an event and scheduled this as a job to trigger after "event" as per SAP instructions, but the job does not exist and it is not possible to trigger it through the Process chain unless the variables are hard coded in the query which I do not want to do.
    Can any one tell me if there is a way to deal with APD using Query with multiple structures?
    Would really appreciate if some one can give me the right solution...
    Thanks

    Hi Tanu ,
    APD is an option but its not very good with large amount of data or hiearachies or if you have attributes in you query structure .
    One more option for this requirement is use of report program using function module RRW3_GET_QUERY_VIEW_DATA .
    This will work fine with multiple structure etc .
    There are some overheads with this FM  ex: if amount of data is too much then program will give dump .Solution for that is we call the FM in LOOP by diving amount of data need to be fetched .ex:  we can read data quarter wise.
    For using this function module what you can do is write an ABAP program (At SE38 ) .which will call this FM and then write the output into a flat file which you can save at application server (AL11) .From there other system can read it .
    To automate this whole process you can further add all the report programs into a process chain (RSPC) which can be schedule as per requirement .
    To pass input parameters you can use variants that will pass the values to the report .
    Check thi link for sample code :
    [http://www.tricktresor.de/content/index.php?navID=696&aID=496]
    Hope this will be helpful .
    Regards,
    Jaya Tiwari

  • Using multiple events structure inside state machine to control the Tab

    Hi y'all,
    Anne here.I have a Tab indicator in my front panel and I want to be able to control the flow of my program based on what controls I clicked inside the tab. I am using a state machine architecture and inside every state, I use an event structure to check for user interaction  to determine the next state and what tab page is going to be displayed next. This means that I am actually using multiple event structures in my application and I use them in just one while loop, but just that they are not running in parallel since I am only using "one event structure per state" which means that only one event structure is running at one time. My questions is, programming technique wise, am I doing it correctly? So far, I am not facing any problem (I am still in the early stage of the project) but I want to check with you all first on your opinion regarding this architecture. Will there be any issue on using multiple event structures in a vi? Since I will be using a tab, and the controls available in the tab will be the controls that will control my event structure for that state, by right, there should be no issue. Am I correct to assume this? Is there any limit on the use of event structures? I have attached here a simple sample of the architecture that I am talking about for your reference. I have attached a 2010 version and a 8.6 version. Let me know what you think or any opinions that you may have.
    Hoping to hear from you soon! Thanks so much in advance!
    Cheers!
    Anne
    Attachments:
    State Machine-Event Structure Sample_2010.vi ‏19 KB
    State Machine-Event Structure Sample_8.5.vi ‏25 KB

    Hi jak888,
    I decided to use tabs cause I don't want to have subvi pop ups every time i need to perform the process in the state and show an update in the front panel. This is actually going to be more of an ATE where you will have to choose first whether the one using is the operator or the engineer. If the operator is logged in, she will proceed to choose what test to run (this state will have its own event structure). This part, I don't want a pop up, so what happens is that from Login page, if the user logs in as operator, the tab will automatically switch to the Test Selection page. After selecting the test, it will proceed to Start Test state and the tab will show the Result Summary page. If the user logs in as engineer, then a totally different tab will be automatically shown next and so on. By doing this, I will be able to show an update on the front panel objects without having the subvis pop up. I will also just need to use the call reference functions to call my subvis, making my Main VI more generic. The tab Page header will be hidden so the operator will actually not see that there is a tab and that there are a lot of controls and indicators cause they are hidden in the tabs and that page will only be shown based on what they selected from the main tab. 
    I appreciate your thoughts! thanks so much!

  • How to use multiple Interfaces for the same BS?

    Hi @ ,
    Is it possible to have a scenarion where i am using multiple interfaces in the same BS based upon some conditional field in the message.
    I amnot able to get the solution I know with condition editor I can have multiple receivers but in my scenarion based upon message fiels i have to decide which BAPI to be used and wht mapping and then post it to the same System
    Any help will be highly rewarded
    Regards

    Hi-
    Yes it is possible you can use multimapping for mapping the interfaces.
    To know more about multimapping see
    http://help.sap.com/saphelp_nw04/helpdata/en/21/6faf35c2d74295a3cb97f6f3ccf43c/content.htm
    Some more helpful links
    /people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible

  • Problem in mapping while using Do not Use SOAP Envelope

    Hi All,
    This is wrt my thread 'Removing and adding SOAP Envelope'
    I am currently working on SOAP-XI-Proxy Scenario.
    For some un avoiadable reason, I had to use the option 'DO not use SOAP Envelope' .So the SOAP Envelope came withen the payload and in the pipeline, I can see the payload prefixed by '<?xml version="1.0" ?>' .
    Now my payload looks like
    <?xml version="1.0" ?> ( no more the encoding="utf-8" notation is there)
      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
       xmlns:xsd="http://www.w3.org/2001/XMLSchema"    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <soapenv:Body>
      <Complaint_Request xmlns="urn:******createserviceticket">
      <CaseNo>12345</CaseNo>
      <CustomerNo>12345</CustomerNo>
      </Complaint_Request>
      </soapenv:Body>
      </soapenv:Envelope>
    To accomodate the change, I also changed my request structure as
      <Complaint_Request> (My new message Type)
        <Envelope>
         <Body>
           <Complaint_Request> (My previous message Type)
            <caseNo>
            <CustomerNo>
    But I am facing problem in mapping the values to the target structure (which is a flat structure),
    as the payload doesnot start with ' ns1: ' notation any more . Even XSLT mapping is not working.
    When I am pasting the payload in the Testing Mapping Editor, the Source Node are correctly
    formed, but all come in RED . But as the root node , ie 'ns0' is not there, the value
    from child nodes are not getting mapped to the target fields.
    Regards,
    Subhendu

    Hi Joel,
    SAP says, when we use the option 'DO Not Use SOAP Envelope', the payload also contains the SOAP
    Envelope. So it is obvious that the payload wont start with 'ns0' notation.
    So I am searching for a solution, when we use that option.
    Regards,
    Subhendu

  • Message Mapping of Recursive Source Structure?

    Hello,
    a mapping needs to be implemented from a custom source structure to an IDoc. An XSD has been provided for the source structures which contains recursive elements --> an element of a specific type contains another element with the same type.
    If I import the XSD then the type of the recursive element is displayed in "red", but I still can expand it. If I want to use the source structure in the message mapping I cannot expand the recursive elements anymore. Does anyone of you have an idea how to handle this? I want to avoid XSLT if possible.
    Thank you!

    Hi again Florian,
    please have a look at [Structure Overview in Message Mappings on SAP help|http://help.sap.com/saphelp_nwpi71/helpdata/en/e3/92be7c6cd34fd485c967144e302fb6/content.htm]. There is a paragraph on Recursive Structures:
    ...It is possible to map these elements in the mapping editor in a rudimentary fashion by using the context menu to expand a specific number of subnodes and then use them in target-field mappings...
    That works for both source and target message.

  • N:1 Mapping Possible using Java Mapping?

    All,
    Is it possible to do a N:1 mapping using Java Mapping?
    If yes , how?
    Reason for this question is that the execute() of the Java Mapping is going to take the source / request message as the InputStream . In the case of N:1 mapping , as we have multiple messages , how will they be send to the InputStream? Will both the messages be sent combined into the InputStream? Will the MESSAGES tag be embedded into the input stream?
    Regards,
    Bhavesh

    Hi @ll;
    i try the same.
    to conduct a java mapping with 2 input structures that fills one target structure.
    This mapping is part of a Integrationprocess.
    I tested the mapping at the Integration Repository (Interface mapping) with the structure given by henrique and it works fine without any error.
    At runtime this structure looks like this (different prefix)
    <?xml version="1.0" encoding="UTF-8"?>
    <sxi:Messages xmlns:sxi="http://sap.com/xi/XI/SplitAndMerge">
         <sxi:Message1>
              <YOURXML1>...</YOURXML1>
         </sxi:Message1>
         <sxi:Message2>
              <YOURXML2>...</YOURXML2>
         </sxi:Message2>
    </sxi:Messages>
    As I put it in the Integrationprocess unfortunately a strange error arises.
    The trace Workflow-Protocoll shows following error.
    <Trace level="2" type="T">Call method execute of the application Java mapping com.endress.infoserve.xi.mapping.MergeConfigStore_IdocOrder </Trace>
    <Trace level="2" type="T">Java mapping com/endress/infoserve/xi/mapping/MergeConfigStore_IdocOrder completed. (executeStep() of com.endress.infoserve.xi.mapping.MergeConfigStore_IdocOrder </Trace>
    <Trace level="1" type="T">Parsing error after multi mapping.Expected Message<i> instead of IDOC </Trace>
    I can't make head nor tail of it.
    what´s the mistake?
    can anybody please help me?
    Thanks in advance
    Kind regards

  • Generation/Acquisition using multiple HSDIO PXI 6556 with bi-directional signals

    Hi,
    I would like to run vectors to test some ICs using multiple (three) PXI6556 cards. The vectors have multiple (>20) bi-directional signals.
    Questions:
    1. The NI Examples library shows multiple-device generation and acquisition VIs. However, it seems the examples are on single direction signals. Could you show me some example on how to configure bi-directional signals?
    2. The pin mapping in the vectors are not in the same order as the HSDIO card pin mapping. Is there an easy way or any tool to help channel mapping? I have 10+ vectors with 90+ digital signals. Manually remapping them is quite tedious.
    3. Since we have three PXI6556 cards in the tester, is the "Multi-Device dynamic generation and acquisition" example VI the one to follow? Just to double check if there is any better way to do the configuration.
    Thank you for your help!
    Jing

    hello jcao,
    I have adressed your questions individually below:
    1. bi-directional examples can be found in two locations Hardware Input and Output >> Modular Instruments >> Demos >> Dynamic Acquisition and Generation Demo.vi and Hardware Input and Output >> Modular Instruments >> Dynamic Acquisition and Generation >> Stimulus and Response Load from HWS File.vi . Both of these examples utilize the bi-directional functionality of our HSDIO cards.
    2. The easiest way to map the pins is to use the Digital Waveform Editor software. You can import a VCD (Value Change Dump) file and save it as a NI-HWS file to be imported and used in LabVIEW (the second example above will show you how to use the HWS file). A VCD file should allow you to specify a signal name and assign it to a particular line.
    3. The  "Multi-Device dynamic generation and acquisition" example VI is the best to follow for syncing across multiple HSDIO devices. The examples use TCLK which is the recomended syncing method. I have also provided a link explaining TClk a little more thoroughly.
    http://www.ni.com/white-paper/3675/en/
    Applications/Systems/Test
    National Instruments | AWR Group

  • How to use multiple xmlforest() function within xmlagg() function

    I need to create following XML structure by reading multiple tables from DB .
    The tables are relational and joined by keys.
    <Invoice>
    <CaseOrdrId>0000022359</CaseOrdrId>
    <Id>100065117</Id>
    <Prescription>
    <CaseOrdrItmId>0000005684</CaseOrdrItmId>
    <RxId>1104900686</RxId>
    <Prescriber>
         <CasePartyIdDEA>0000000000</CasePartyIdDEA>
         <CasePartyIdNPI>0000000000</CasePartyIdNPI>
         <CasePartyIdSLic>0000000000</CasePartyIdSLic>
         </Prescriber>
         <PatInfo>
              <CasePartyId>0000000000</CasePartyId>
              </PatInfo>
    </Prescription>
    </Invoice>
    <Invoice>
    <Invoice>
    <Invoice>
    <Invoice>
    <Invoice> tag can repeat 5times , So,I am using xmlagg().
    To create the tree structure within <Invoice> I am using multiple xmlforest().
    But getting error : SQL Error: ORA-06553: PLS-306: wrong number or types of arguments in call to 'SYS_IXMLAGG' . code added today marked in yellow.
    Any help on this would be really helpful.

    Hi , I could fix the previous issue with xmlagg().
    My query is as follows :
    select
    xmlelement( "Response", xmlforest( b.StatusCode as "StatusCode", b.StatusMessage as "StatusMessage",
    b.ServiceAction as "ServiceAction",
    select
    xmlforest( a.id as "Id", a.ExternalId as "ExternalId", a.Source as "Source", a.UserID as "UserID", xmlforest(b.id as
    "Id")"Note", xmlforest(
    select
    Xmlforest(P.Case_Party_Id As "CasePartyId",Xmlelement("CaseGeoAddrId",S.Address_Id )as "Address"
    from
    v44139.party p,
    v44139.patient_address s
    where
    p.case_party_id = s.case_party_id
    and p.party_id_type_cde = 'MBR'
    AND s.individual_agn_id = 0
    ) as "Membership")"Group",
    select
    xmlagg(xmlelement("Invoice",xmlelement( "CaseOrdrId",d.case_order_id),
    xmlelement("Id" ,d.invoice_nbr) ,xmlelement("Prescription",
    xmlforest(e.case_order_item_id as "CaseOrdrItmId", e.rx_nbr as "RxId"),
    xmlelement("Prescriber",
    xmlforest(169629 as "CasePartyIdDEA", 169630 as "CasePartyIdNPI",169631
    as "CasePartyIdSLic")),xmlelement("PatInfo",xmlforest(e.case_party_id as "CasePartyId") )) ) )
    --AS ID
    from
    v44139.patient_order d ,
    v44139.order_rx e
    where
    d.case_id = a.id
    and d.case_order_id = e.case_order_id
    as "Invoice"
    from
    select
    '142' as id,
    'CMRT' as source,
    'V44042' as userid,
    'EMG-7788' as externalid ,
    361 as case_party_id
    from
    dual
    a
    "Case") ) as "XML_QUERY"
    from
    select
    200 as statuscode,
    'SUCCESS' as statusmessage,
    '0000000000' as id,
    'Update' serviceaction
    from
    dual
    b;
    ===============================================================================================
    The result is as follows :
    <Response><StatusCode>200</StatusCode><StatusMessage>SUCCESS</StatusMessage><ServiceAction>Update</ServiceAction><Case><Id>142</Id><ExternalId>EMG-7788</ExternalId><Source>CMRT</Source><UserID>V44042</UserID><Note><Id>0000000000</Id></Note><Group><Membership><CasePartyId>382</CasePartyId><Address><CaseGeoAddrId>144</CaseGeoAddrId></Address></Membership></Group_*><Invoice><Invoice><*_CaseOrdrId>202</CaseOrdrId><Id>999999993                                         </Id><Prescription><CaseOrdrItmId>105</CaseOrdrItmId><RxId>1118800008</RxId><Prescriber><CasePartyIdDEA>169629</CasePartyIdDEA><CasePartyIdNPI>169630</CasePartyIdNPI><CasePartyIdSLic>169631</CasePartyIdSLic></Prescriber><PatInfo><CasePartyId>382               </CasePartyId></PatInfo></Prescription></Invoice><Invoice><CaseOrdrId>203</CaseOrdrId><Id>825478795                                         </Id><Prescription><CaseOrdrItmId>106</CaseOrdrItmId><RxId>1118800005</RxId><Prescriber><CasePartyIdDEA>169629</CasePartyIdDEA><CasePartyIdNPI>169630</CasePartyIdNPI><CasePartyIdSLic>169631</CasePartyIdSLic></Prescriber><PatInfo><CasePartyId>382               </CasePartyId></PatInfo></Prescription></Invoice><Invoice><CaseOrdrId>204</CaseOrdrId><Id>999999992                                         </Id><Prescription><CaseOrdrItmId>107</CaseOrdrItmId><RxId>1118800007</RxId><Prescriber><CasePartyIdDEA>169629</CasePartyIdDEA><CasePartyIdNPI>169630</CasePartyIdNPI><CasePartyIdSLic>169631</CasePartyIdSLic></Prescriber><PatInfo><CasePartyId>382               </CasePartyId></PatInfo></Prescription></Invoice><Invoice><CaseOrdrId>205</CaseOrdrId><Id>999999991                                         </Id><Prescription><CaseOrdrItmId>108</CaseOrdrItmId><RxId>1118800006</RxId><Prescriber><CasePartyIdDEA>169629</CasePartyIdDEA><CasePartyIdNPI>169630</CasePartyIdNPI><CasePartyIdSLic>169631</CasePartyIdSLic></Prescriber><PatInfo><CasePartyId>382               </CasePartyId></PatInfo></Prescription></Invoice></Invoice></Case></Response>
    The ISSUE : <Invoice> tag repeating twice in 3 rd line . How to correct this ?

  • [Forum FAQ] How to use multiple field terminators in BULK INSERT or BCP command line

    Introduction
    Some people want to know if we can have multiple field terminators in BULK INSERT or BCP commands, and how to implement multiple field terminators in BULK INSERT or BCP commands.
    Solution
    For character data fields, optional terminating characters allow you to mark the end of each field in a data file with a field terminator, as well as the end of each row with a row terminator. If a terminator character occurs within the data, it is interpreted
    as a terminator, not as data, and the data after that character is interpreted and belongs to the next field or record. I have done a test, if you use BULK INSERT or BCP commands and set the multiple field terminators, you can refer to the following command.
    In Windows command line,
    bcp <Databasename.schema.tablename> out “<path>” –c –t –r –T
    For example, you can export data from the Department table with bcp command and use the comma and colon (,:) as one field terminator.
    bcp AdventureWorks.HumanResources.Department out C:\myDepartment.txt -c -t ,: -r \n –T
    The txt file as follows:
    However, if you want to bcp by using multiple field terminators the same as the following command, which will still use the last terminator defined by default.
    bcp AdventureWorks.HumanResources.Department in C:\myDepartment.txt -c -t , -r \n -t: –T
    The txt file as follows:
    When multiple field terminators means multiple fields, you use the below comma separated format,
    column1,,column2,,,column3
    In this occasion, you only separate 3 fields (column1, column2 and column3). In fact, after testing, there will be 6 fields here. That is the significance of a field terminator (comma in this case).
    Meanwhile, using BULK INSERT to import the data of the data file into the SQL table, if you specify terminator for BULK import, you can only set multiple characters as one terminator in the BULK INSERT statement.
    USE <testdatabase>;
    GO
    BULK INSERT <your table> FROM ‘<Path>’
     WITH (
    DATAFILETYPE = ' char/native/ widechar /widenative',
     FIELDTERMINATOR = ' field_terminator',
    For example, using BULK INSERT to import the data of C:\myDepartment.txt data file into the DepartmentTest table, the field terminator (,:) must be declared in the statement.
    In SQL Server Management Studio Query Editor:
    BULK INSERT AdventureWorks.HumanResources.DepartmentTest FROM ‘C:\myDepartment.txt’
     WITH (
    DATAFILETYPE = ‘char',
    FIELDTERMINATOR = ‘,:’,
    The new table contains like as follows:  
    We could not declare multiple field terminators (, and :) in the Query statement,  as the following format, a duplicate error will occur.
    In SQL Server Management Studio Query Editor:
    BULK INSERT AdventureWorks.HumanResources.DepartmentTest FROM ‘C:\myDepartment.txt’
     WITH (
    DATAFILETYPE = ‘char',
    FIELDTERMINATOR = ‘,’,
    FIELDTERMINATOR = ‘:’
    However, if you want to use a data file with fewer or more fields, we can implement via setting extra field length to 0 for fewer fields or omitting or skipping more fields during the bulk copy procedure.  
    More Information
    For more information about filed terminators, you can review the following article.
    http://technet.microsoft.com/en-us/library/aa196735(v=sql.80).aspx
    http://social.technet.microsoft.com/Forums/en-US/d2fa4b1e-3bd4-4379-bc30-389202a99ae2/multiple-field-terminators-in-bulk-insert-or-bcp?forum=sqlgetsta
    http://technet.microsoft.com/en-us/library/ms191485.aspx
    http://technet.microsoft.com/en-us/library/aa173858(v=sql.80).aspx
    http://technet.microsoft.com/en-us/library/aa173842(v=sql.80).aspx
    Applies to
    SQL Server 2012
    SQL Server 2008R2
    SQL Server 2005
    SQL Server 2000
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    Thanks,
    Is this a supported scenario, or does it use unsupported features?
    For example, can we call exec [ReportServer].dbo.AddEvent @EventType='TimedSubscription', @EventData='b64ce7ec-d598-45cd-bbc2-ea202e0c129d'
    in a supported way?
    Thanks! Josh

Maybe you are looking for

  • My iphone shuts off by itself, and refuses to charge to any source.

    I bought an ulnocked iPhone 4 a week ago in Hawaii. I'm from Argentina, so I got back and asked for a microsim card in my local carrier (Claro), which took about 4 days (they're annoying). When I finally activated my iPhone, I tried to charge it in a

  • Problem print all pages on my HP Laserjet 1320 from my Mac

    I am having a strange printing problem. Happens in almost any program (Mail / Excel /Preview/Word/TextEdit/etc.).   I can ask it to print a one page document.  It spools, the printer flashes.  The computer said it is done but nothing printed.   On th

  • SCCM Client on Site Server from Different Site within Same Domain

    Our desktop team has a site to manage desktops. We have a site to manage servers. Do you see any issue with the Server site managing the Desktop teams servers as their clients? In other words, desktop wants us to patch and manage their SCCM servers w

  • Table footer when page break in smartform

    I put a table component into a loop control, and in the table footer, there are some texts in several lines and a command component. the problem is that, when there's not enough space to print the whole table footer texts in one page, the extra part

  • IOS4 Has messed up my equalizer settings

    Ever since updating to iOS4 on my 3GS, my equalizer settings are all very, VERY quiet. Even the setting Loudness is about half as quiet as when I have the Equalizer turned off completely. All other settings are acting similarly. Anyone else having th