How to convert org hierarchy XML to CSV/Excel format using PI/XI

Hi All,
I am working with SAP PI/XI for the first time and need some help file conversion of complex hierarchy XML to CSV file using PI. I have done plenty of research on SDN and could find much related to what I want to do.
Here is the example of how my input XML would look like:
<?xml version="1.0" encoding="UTF-8"?>
<PartyMaster type="OrgHierarchy" name="Compass Group Owned">
<PartyMasterHierarchy>
<Hierarchy level="3" nodeName="Bon Appetit Sector" type="Sector" ID="A00000" refID="A00000">
<Hierarchy level="4" nodeName="BA Division" type="Division" ID="AB0000" refID="AB0000" >
<Hierarchy level="5" nodeName="BA East Coast Region" type="Region" ID="ABE000" refID="ABE000">
<Hierarchy level="6" nodeName="Engstrom, John RVP" type="District" ID="ABE01" refID="ABE01" >
</Hierarchy>
</Hierarchy>
</Hierarchy>
</Hierarchy>
<Hierarchy level="3" nodeName="Levy Sector" type="Sector" ID="K00000" refID="K00000".
<Hierarchy level="4" nodeName="Levy Sector Division" type="Division" ID="K90000" refID="K90000">
<Hierarchy level="5" nodeName="Levy Sector Region" type="Region" ID="K99000" refID="K99000">
<Hierarchy level="6" nodeName="TBA Total" type="District" ID="K9901" refID="K9901"> </Hierarchy>
</Hierarchy>
</Hierarchy>
</Hierarchy>
</PartyMasterHierarchy>
</PartyMaster>
I would like to get CSV output in the format below
DISPLAY_NAME, DOCUMENT_DESCRIPTION, PARENT, EXTERNAL_ID, ORG_UNIT_TYPE
Bon Appetit Sector, Bon Appetit Sector,constant value, A00000, constant value
Levy Sector, Levy Sector, constant value, K00000, constant value
BA Division, BA Division, A00000, AB0000, constant value
Levy Sector Division, Levy Sector Division, K00000, K90000, constant value
BA East Coast Region, BA East Coast Region, AB0000, ABE000, constant value
Levy Sector Region, Levy Sector Region, K90000, K99000, constant value
Engstrom John RVP, Engstrom John RVP, ABE000, ABE01, constant value
TBA Total ,TBA Total ,K99000, K9901, constant value
1) How do I go about this? I think I have to configure an adapter but which adapter would give me the desired result?
2) How do I tell PI when to pick the file from and where to place it after conversion? Could this be done in adapter configuration?
Any help will be greatly appreciated.
Thanks.
--Mithun

>>> 1) How do I go about this? I think I have to configure an adapter but which adapter would give me the desired result?
Use File adapter at the sender side to pick up the xml and use file adapter at the receiver side (message protocol file content conversion) to convert xml format to csv.
Basically you have to configure in the file adapter (FCC) on the receiver side to get desired csv structure from XML.
>>> 2) How do I tell PI when to pick the file from and where to place it after conversion? Could this be done in adapter configuration?
Configure sender file adapter to pick up the file from the specified directory. Configure receiver file (fcc adapter) to drop the csv file after conversion.
For sender adapter
http://help.sap.com/saphelp_nw04/helpdata/en/e3/94007075cae04f930cc4c034e411e1/content.htm
For receiver adapter in our case FCC (FILE content Conversion) follow the link
http://help.sap.com/saphelp_NW04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm
Hope answered your question.
Mapping area: simple suggestion. Keep input and output message same structure and do one to one mapping.  In the receiver fcc adapter configure for csv structure following instruction given in the above second link
Note: FCC adapter does not support nested structure more than 2. So in your case you can achieve using conversion agent tool. Otherwise you might have to achieve through some graphical mapping.

Similar Messages

  • How to convert hierarchy XML to CSV/Excel format using PI/XI

    posted in PI forum but not many replies, please bear with me as I am in crunch time*
    Hi All,
    I am working with SAP PI/XI for the first time and need some help file conversion of complex hierarchy XML to CSV file using PI. I have done plenty of research on SDN and could find much related to what I want to do.
    Here is the example of how my input XML would look like:
    <?xml version="1.0" encoding="UTF-8"?>
    <PartyMaster type="OrgHierarchy" name="Compass Group Owned">
    <PartyMasterHierarchy>
    <Hierarchy level="3" nodeName="Bon Appetit Sector" type="Sector" ID="A00000" refID="A00000">
    <Hierarchy level="4" nodeName="BA Division" type="Division" ID="AB0000" refID="AB0000" >
    <Hierarchy level="5" nodeName="BA East Coast Region" type="Region" ID="ABE000" refID="ABE000">
    <Hierarchy level="6" nodeName="Engstrom, John RVP" type="District" ID="ABE01" refID="ABE01" >
    </Hierarchy>
    </Hierarchy>
    </Hierarchy>
    </Hierarchy>
    <Hierarchy level="3" nodeName="Levy Sector" type="Sector" ID="K00000" refID="K00000".
    <Hierarchy level="4" nodeName="Levy Sector Division" type="Division" ID="K90000" refID="K90000">
    <Hierarchy level="5" nodeName="Levy Sector Region" type="Region" ID="K99000" refID="K99000">
    <Hierarchy level="6" nodeName="TBA Total" type="District" ID="K9901" refID="K9901"> </Hierarchy>
    </Hierarchy>
    </Hierarchy>
    </Hierarchy>
    </PartyMasterHierarchy>
    </PartyMaster>
    I would like to get CSV output in the format below
    DISPLAY_NAME, DOCUMENT_DESCRIPTION, PARENT, EXTERNAL_ID, ORG_UNIT_TYPE
    Bon Appetit Sector, Bon Appetit Sector,constant value, A00000, constant value
    Levy Sector, Levy Sector, constant value, K00000, constant value
    BA Division, BA Division, A00000, AB0000, constant value
    Levy Sector Division, Levy Sector Division, K00000, K90000, constant value
    BA East Coast Region, BA East Coast Region, AB0000, ABE000, constant value
    Levy Sector Region, Levy Sector Region, K90000, K99000, constant value
    Engstrom John RVP, Engstrom John RVP, ABE000, ABE01, constant value
    TBA Total ,TBA Total ,K99000, K9901, constant value
    1) How do I go about this? I think I have to configure an adapter but which adapter would give me the desired result?
    2) How do I tell PI when to pick the file from and where to place it after conversion? Could this be done in adapter configuration?
    Any help will be greatly appreciated.
    Thanks.
    --Mithun

    Hi Mithun,
    You might try this step below :
    1. As for xsd schema fo the xml or create xsd schema base on the sample xml file using tools like xmlspy or others free tools.
    2. import you xsd schema as outbound Data type
    3. apply mapping from source to target (csv).
    Configuration
    Sender file adapter (without content conversion)
    Receiver file adapter (with content conversion).
    so the sender adapter will be monitoring inbound directory and write the result to another directory.
    Thank You and Best Regards
    Fernand.

  • How to read from a xml file(in String format) using a java program

    hi friends
    i have a string , which is xml format. i want read the values and display it.can any one suggest how to read a xml file of string format using a javaprogram
    thanks

            final DocumentBuilder db =  DocumentBuilderFactory.newInstance().newDocumentBuilder();      
            final InputStream documentStream = new ByteArrayInputStream(documentXMLSourceString.getBytes("utf-8"));
            final Document document = db.parse(documentStream);

  • How to convert .wav to .mp4 with H.264 format using iTunes?

    Hi All,
    Can i convert .WAV to .Mp4 file with H.264 code format using iTunes Windows or Mac OS X? if it is possible, please suggest me how to convert?
    Thanks and Regards,
    Suresh Balakrishnan.

    iTunes application can only convert files to .WAV, .MP3, Apple Lossless Encoder, AIFF, AAC.

  • How to convert hierarchy XML to CSV format using PI/XI

    Hi All,
         I am working with SAP PI/XI for the first time and need some help file conversion of complex hierarchy XML to CSV file using PI. I have done plenty of research on SDN and could find much related to what I want to do.
    Here is the example of how my input XML would look like:
    <?xml version="1.0" encoding="UTF-8"?>
    <PartyMaster type="OrgHierarchy" name="Compass Group Owned">
        <PartyMasterHierarchy>
             <Hierarchy level="3" nodeName="Bon Appetit Sector" type="Sector" ID="A00000" refID="A00000">     
                   <Hierarchy level="4" nodeName="BA Division" type="Division" ID="AB0000" refID="AB0000" >               <Hierarchy level="5" nodeName="BA East Coast Region" type="Region" ID="ABE000" refID="ABE000">
                             <Hierarchy level="6" nodeName="Engstrom, John RVP" type="District" ID="ABE01" refID="ABE01" >
                             </Hierarchy>
                           </Hierarchy>
         </Hierarchy>
                    </Hierarchy>
                    <Hierarchy level="3" nodeName="Levy Sector" type="Sector" ID="K00000" refID="K00000".               <Hierarchy level="4" nodeName="Levy Sector Division" type="Division" ID="K90000" refID="K90000">              <Hierarchy level="5" nodeName="Levy Sector Region" type="Region" ID="K99000" refID="K99000">                   <Hierarchy level="6" nodeName="TBA Total" type="District" ID="K9901" refID="K9901">                        </Hierarchy>
              </Hierarchy>
         </Hierarchy>
                     </Hierarchy>
            </PartyMasterHierarchy>
    </PartyMaster>
    I would like to get CSV output in the format below
    *DISPLAY_NAME     DOCUMENT_DESCRIPTION      PARENT           EXTERNAL_ID     ORG_UNIT_TYPE*     
    Bon Appetit Sector     Bon Appetit Sector      constant value    A00000                       constant value
    Levy Sector          Levy Sector           constant value    K00000                 constant value
    BA Division          BA Division            A00000                 AB0000                       constant value
    Levy Sector Division         Levy Sector Division       K00000              K90000                       constant value
    BA East Coast Region     BA East Coast Region          AB0000             ABE000                        constant value
    Levy Sector Region     Levy Sector Region       K90000              K99000                        constant value
    Engstrom, John RVP     Engstrom, John RVP        ABE000               ABE01              constant value
    TBA Total                    TBA Total             K99000               K9901             constant value
    1) How do I go about this? I think I have to configure an adapter but which adapter would give me the desired result?
    2) How do I tell PI when to pick the file from and where to place it after conversion? Could this be done in adapter configuration?
    Any help will be greatly appreciated.
    Thanks.
    --Mithun

    Mithun,
    you would get lot of answers if you looking in the PI (process integration forum)... There is something calles File content coversion in XI file adapter (which can convert the xml to csv and viceversa)

  • Hi, how to convert pdf to xml

    hi, how to convert pdf to xml

    Hi Sunil,
    You have to use Acrobat for this.
    Open the pdf, go to File > Save as other > More options > select xml and save the file.

  • How to convert idoc into xml/edifact

    hi everyone just now i have started to work on edi, i want to kno how to convert idoc into xml/edifact. plz  reply asap

    Firstly, I will reply when and if I choose to. I do not require the asap nonsense at the end of your sentence.
    EDIFACT - You will need a subsystem.
    XML - I am not 100%. It may also depend on what version of SAP you are on. As I do not know if later versions of SAP can convert IDoc to XML.

  • How to convert org.dom4j.Document into org.w3c.dom.Document  ?

    Hi,
    I have done googling for how to convert org.dom4j.Document into org.w3c.dom.Document , but could not get any usefull data.
    If any one is having solution or any idea, please reply.
    Thanks in advance
    <!--Session data-->

    Note: This thread was originally posted in the [Java Programming|http://forums.sun.com/forum.jspa?forumID=31] forum, but moved to this forum for closer topic alignment.

  • How can I create an csv/excel file using pl/sql and then sending that file

    How can I create an csv/excel file using pl/sql and then sending that file to a clients site using pl/sql?
    I know how to create the csv/excel file but I can't figure out how I would get it to the clients site.

    968776 wrote:
    How can I create an csv/excel file using pl/sql and then sending that file to a clients site using pl/sql?
    I know how to create the csv/excel file but I can't figure out how I would get it to the clients site.You are trying to do it at a wrong place..
    Whay do you want database (pl/sql) code to do these things?
    Anyhow, you may be interested in :
    {message:id=9360007}
    {message:id=9984244}

  • How can i convert oracle report in excel format using 8i

    hi,
    I want to convert oracle report in excel format using 6i reports. please give the solution with emp table.
    millons of thanks in advance.

    You'll have to use the destype DELIMITEDDATA to render your Report in CSV format. Then set the mime type to Excel. I don't know the exact syntax, so please do a search in metalink for "reports excel" for examples and more info.
    Regards,
    Martin Malmstrom

  • How to convert my MM alias into an AppleID to use it with iCloud?

    I used MobileMe and created a mail that became my Apple ID. Then I created an alias that became my main e-mail so now with iCloud I wish that aslias could become my Apple ID. I don't care to loose the first Apple ID but "How to convert my MM alias into an AppleID to use it with iCloud?"

    You cannot convert an alias to Apple ID.
    You can transfer your MM to iCloud with your main Apple ID.
    There will be your alias as well.
    Regards

  • How can I send an XML request to the server using servlets

    How can I send an XML request to the server using servlets

    http://forum.java.sun.com/thread.jspa?threadID=5158333
    http://forum.java.sun.com/thread.jspa?threadID=5158705
    Crossposting is lame.

  • How to convert system Date into DD-MMM-YYYY Format

    hi friends,
    please help me How to convert system Date into DD-MMM-YYYY Format.
    Regards
    Yogesh

    HI..
    data: w_dt(11) type c,
             w_month(2),
             w_mon(3).
    w_month = p_date+4(2). **p_date = given date**
    case w_month.
    when '01'.
    w_mon = 'Jan'.
    when '02'.
    w_mon = 'Feb'.
    when '03'.
    w_mon = 'Mar'.
    when '04'.
    w_mon = 'Apr'.
    when '05'.
    w_mon = 'May'.
    when '06'.
    w_mon = 'Jun'.
    when '07'.
    w_mon = 'Jul'.
    when '08'.
    w_mon = 'Aug'.
    when '09'.
    w_mon = 'Sep'.
    when '10'.
    w_mon = 'Oct'.
    when '11'.
    w_mon = 'Nov'.
    when '12'.
    w_mon = 'Dec'.
    endcase.
    Now...
      concatenate p_date6(2)  '-'  w_mon  '-'   p_date0(4)  into w_dt.
    write w_dt.

  • How to convert a word document into the PDF format?

    Please instruct me step by step on how to convert several Word documents into the PDF format?

    If properly installed and updated (depending on the WORD version), you can simply do any of the following:
    1. Open the doc in WORD and select Print, choose the Adobe PDF printer, print.
    2. Open the doc in WORD and go to the Acrobat menu in WORD and select create PDF (this uses PDF Maker).
    3. Open the doc in Acrobat and the conversion should be done based on PDF Maker.

  • Need to convert AP Invoice Aging Report in Excel format

    Hi,
    Need to convert AP Invoice Aging Report in excel format..there was an existing Invoice Aging report in AP and that was in paper format. That we need to convert to rtf template..
    There was an other concurrent program called 'Invoice Aging Report (XML) - Reserveed for future use', when i am using that rtf template..to get the report output it was taking more than 1 hr time.
    1)Is there any way/patch to get that XML report to be used in 12.1.3 EBS version
    2) is there any other way to get the report output faster.
    Thanks..

    Hi,
    When submitting the request, you may change the output to Excel and get the output in Excel. Otherwise as you mention if you getting the output in text format, you may download the text format and open the document in excel and use the delimitation to format in excel as per your requirement.
    1)Is there any way/patch to get that XML report to be used in 12.1.3 EBS version
    2) is there any other way to get the report output faster.
    Is your statistics up to date, when did you last run gather schema statistics program in Sysadmin responsibility.
    Also what is the record quantity that you are expecting here? Is date range parameter available in the report and if yes, did you try running the report for a day to check the output.
    Thanks &
    Best Regards,

Maybe you are looking for

  • Goods return account document error

    Hi guys I created normal sales order, delivery and and released it thr VF01. Then I created the RE document without order reference and PGR. But while checking the accounting documents in VL02N it gives the error as follows Material document 49000000

  • Can't open PDF files online???

    Hi,  I'm very new to this and haven't gone through all the history so maybe someone could point me in the right direction.  I'm on latest Windows version but can't seem to open any pdf files through websites.  I keep getting the message Internet Expl

  • Open multiple pdfs in one acrobat window

    There are many things annoying about Acrobat, but the one that really gets me is that the option to open multiple pdfs in the same window, rather than splattering them all over the toolbar, apparently has been removed in the latest versions.  I have

  • Max() function in Data services

    Hi Experts,      i'm using Data services (etl), and working on budget table(ms sql table), 1. the table has a field [budget amount] and [version_no], 2. before i extract the budget amount i need to know the highest version in [version_no] fields 3. c

  • VisualAge for Java - generated error handling code

    The code that VAJ generates to handle errors is getting on my nerves, and I'd like to know if someone else is experiencing this difficulty. It's not possible to specify which exception you're handling. The generated catch code produced is of the form