EDI flat file to X12 xml using XSLT mapping

Hi all,
I have a scenario EDI File -> XI -> file. Here on the source side, it is a txt IDOC document. I have created an XSLT mapping to convert txt document to X12 xml.
Can any body please suggest that what should be the message type that i need to choose at source inbound message?
Thanks
-Kulwant

Hi
It is not very clear from what you have explained above..
1) whats the format when the msg enters XI?
2) which stage of the flow this XSLT mapping is located...??
3) when you say that your XSLT converts txt to xml, then whats the ROOT tag you use??
4) whats your incoming msg structure??
make the above clear for better answers
Regards
Vishnu

Similar Messages

  • Convert XML using XSLT mapping

    Hi,
    I have an XML in the following format and would want to cnvert it in the target format shown below. Kindly let me know the XSLT mapping to conert from hierarchy to flat structure.
    <u><b>Source XML:</b></u>
    <group Level1="Mac Tools Item Classifications">
        <group Level2="6-Other Merchandise">
            <group Level3="61-Racing">
         <group Level4="011-Collectibles">
             <group Level5="001-NASCAR"/>
             <group Level5="002-NHRA"/>
             <group Level5="003-Other"/>
         </group>
         <group Level4="012-Apparel">
             <group Level5="001-Jackets"/>
             <group Level5="002-Shirts"/>
             <group Level5="003-Other">
                 <group PartNumber="SHOE823-060"/>
                 <group PartNumber="SHOE823-070"/>
                 <group PartNumber="SHOE823-080"/>
                 <group PartNumber="SHOE823-085"/>
                    <group PartNumber="SHOE823-090"/>
                        </group>
         </group>
                 </group>
           </group>
    </group>
    <u><b>Target XML:</b></u>
    <Group>
          <part>
         <Level1/>
         <Level2/>
         <Level3/>
         <Level4/>
         <PartNumber/>
           </part>
           <part>
                    <Level1/>
         <Level2/>
         <Level3/>
         <Level4/>
         <PartNumber/>
            </part>
    </Group>
    I am not clear how to capture level1, level 2, etc. till the end node.
    Regards,
    Swaroopa

    HI,
      This is a sample
    <b>
    <xsl:variable name="var0_floatToString" select="user0:floatToString(/body/getQuote/inputGetQuote/@customerIDFloatAttr)"/>
                <xsl:if test="@customerIDFloatAttr">
                    <xsl:attribute name="customerIDFloatAttr">
                        <xsl:value-of select="@customerIDFloatAttr"/>
                    </xsl:attribute>
                </xsl:if>
                <xsl:attribute name="customerIDAttr">
                    <xsl:value-of select="$var0_floatToString"/>
                </xsl:attribute></b>
    using  <xsl:attribute name      here name ="leval1" like that u can use  in XSLT Mapping .
         Hope it helps
    Regards.,
    V.Rangrajan

  • Converting Idoc flat file representation to XML

    Hi ,
    I went through the guide for How To Convert Between IDoc and XML in XI 3.0. I'm concerned with the second part of the guide which says convert from falt file representation of Idoc to XML. Can anyone tell me what are the other design and configuration objects to be created for this scenario ( message types,interfaces, mapping , etc )
    Also which step of the pipeline does the converted XML goes to ?
    The program also expects a filename, what if I want to pass the file name dynamically ? Any ideas on this one.
    Hope someone replies this time.........:)
    Thanks for you help and improving my knowledge
    Thanks
    Advait Gode.

    Hi Advait,
    Let me give you a small overview on how inbound IDOCs work before answering your question-
    The control record is the key in identifying the routing of the IDOC. If you try to think IDOCs as normal mails(post), the control record is the envolope. It contains information like who the sender is and who the receiver should be and what the envelope contains (no different than receiving mails/letters by post).
    Then the data records contain the actual data, in our example would be the actual letter. The status records contain the tracking information.
    Traditionally SAP's IDOC interface (even before XI comes in picture) has utility programs to post incoming IDOCs in to SAP. One such program is RSEINB00 which basically takes  the IDOC file name and the port as input. This program opens the file and posts the contents to the SAP IDOC interface (which is a set of function modules) via the port. The idea is to read the control record and determine the routing and further posting to application. Note that one information in the control record is the message type/idoc type which decides how the data records need to be parsed.
    Now in XI scenario, what happens if we receive data as flat file? Normally, we use flat file adapter and in the file adapter we provide information on how to parse the file. But, if the incoming file is flat and in IDOC structure, why do we have to configure the file adapter, when the parsing capability is already available using RSEINB00/Standard IDOC interface.
    This the reason, the guide suggests you to use RSEINB00. Now, your concern is what if you need to provide a dynamic filename. My idea is to write a wrapper program. This would be an ABAP program in your integration engine. This program will determine the file name (based on a logic which should be known to you) and then call program RSEINB00 using a SUBMIT/RETURN. You would then schedule this ABAP program in background to run in fixed schedules.
    There are other ways of handling your scenario as well but from limited information from your request, I will stop with this now. Post me if you have any more queries.
    KK

  • Using XSLT mapping to avoid File content conversion

    Hi all,
    Can we avoid FCC by using XSLT mapping? I have a scenario in which I have to avoid FCC in the adapter and save the file in a excel/csv format. I have been through the different blogs and forums in SDN.
    I have been through Michal Krawczyk's Blog https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/2803. [original link is broken] [original link is broken] [original link is broken] [original link is broken]
    Got a bit confused whether that blog serves my purpose. Expecting your valid inputs.
    Thanks and regards,
    Harikumar. S

    Hi,
    There are multiple ways in which you can avoid Content Conversion in the Sender / Receiver File adapters.
    I think there was a heated discussion already regarding this in one of your earlier threads,
    Read/Write csv files without file converter
    Basically, if you want to avoid content conversion on the sender file adapter,
    1. Write an Adapter Module. or,
    2. Use a Java Mapping.
    If you want to avoid content conversion on the receiver File adapter,
    1,. Use a Adapter Modules or,
    2. Use Java Or XSLTmapping ( XSLT can be used if the input to the mapping is XML and output needs to be say a Excel File etc).
    Regards
    Bhavesh

  • How to skip first TWO Lines of   .txt  file    using XSLT Mapping

    Hi Friends  ,
                              I have an .txt file in has the format as
                               <TEST>
                                4564564545
                                56456444566
                                56465
                                    How can i skip the first two Lines when i am writing the XSLT Mapping ?
                              That <TEST> and empty line shouldn't go the rfc  .
                             How can i skip and sent to rfc  using XSLT Mapping ?
    Best Regards .,
    V.Rangarajan

    you can avoid the empty lines in your File Content Conversion by defining offset.
    <i>Under Document Offset, specify the number of lines that are to be ignored at the beginning of the document.
    This enables you to skip comment lines or column names during processing. If you do not make an entry, the default value is zero lines.</i>
    ref: http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm
    then the generated XML after FCC will not have the empty lines.

  • File TO File-Using XSLT mapping (for Beginners) --- Error in XSLT

    Hi,
    I am following this wiki (TO File-Using XSLT mapping (for Beginners))
    https://wiki.sdn.sap.com/wiki/display/XI/FileTOFile-UsingXSLTmapping%28forBeginners%29
    When creating  Xslt from the MapForce, when I click on the XSLT Tab I am getting the following error
    http://www.flickr.com/photo_zoom.gne?id=1216715484&size=o
    How to correct this error ?.....
    Thanks
    srini
    Message was edited by:
            srinivas

    Hello,
    The XSD you are using is from Data Type and you are using it for mapping.
    Instead export XSD for Message Type and also pass the XML schema for source that will solve the issue and your XSLT will be generated.
    Regards,

  • Facing Problem in IDOC to EDI FLAT File Scenario

    Hi,
    I am working on a scenario IDOC to EDI FLAT File. For this I have used ABAP mapping.
    The problem i am facing is that the EDI FILE contains the segment name as E1EDK01 for eg. while I need the name as per the latest segment definiton released. I have also tried this using File port and it gives the required segment names in file.  But we dont have to use File ports. Please suggest me if something is missing in PI Abap stack ?? Why I am not getting the segments name as per latest segment definition mainatined in R3.
    Thanks
    Neha

    Hi Neha,
                   Please check the segment name in sxmb_moni. Is this showing new value or the old value?
    If SXMB_MONI shows old value then the source SAP (R/3) system which is sending the idoc may not have released the segment after changing the name. You need to ensure that the idoc segment has been released properly. Then re-import the iodc into PI server again. Finally delete entry of the iodc structure in idx2 transaction, no need to re-import the idoc structute again in idx2, since once you run the scenario the metadata automatically gets imported.
    regards
    Anupam

  • Flat files data comma separated using SSIS.

    Hi,
    I have multiple flat files which come in comma separated columns. See example below :
    Customer Data
    CustID,FName,LName,Disease,Email,Phone
    12345,Xyz,Smit,Bronchitis, Asthma and fever,[email protected],80000000
    12346,Abc,Doe,fever Headache,[email protected],90000000
    12347,Klu,joe,Sugar, cough and fever,[email protected],12345678
    Please look at the ID's 12345 and 12347. The disease column has a internal comma space between. How do i remove the comma spaces in the disease column, so that it can be loaded from flat file to sql table using SSIS. ?
    Please help !
    Thanks

    Here is a full solution base on my post above (first option)
    1. create temp table (Give it a unique name):
    create table #T (Txt NVARCHAR(MAX))
    GO
    2. Insert all the data into temporary table. Each line in the text file, is a value for one column in a row in the table.
    -- I will jump to the table and use simple insert.
    -- If you have problem with step 1 then please inform us (this is simple bulk insert basically)
    insert #T (Txt) values
    ('1234435,Xyz,Stemit,Brfsdonchitis, Asthma and fever,[email protected],80000000'),
    ('12346,Agjdfjbc,Doge,fevhhhher Headsxdshhache,[email protected],90000000'),
    ('123447,Klu,joe,Sugar, cough and fever,[email protected],12345678')
    GO
    the result should be like this:
    Txt
    1234435,Xyz,Stemit,Brfsdonchitis, Asthma and fever,[email protected],80000000
    12346,Agjdfjbc,Doge,fevhhhher Headsxdshhache,[email protected],90000000
    123447,Klu,joe,Sugar, cough and fever,[email protected],12345678
    I use a SPLIT Function named Split_CLR_Fn. This is a CLR Split function that get input <string to split> and <string as delimiter,> and it return table with 2 columns ID, SplitData
    For example if you use: SELECT * from Split_CLR_Fn('text1,text2,text3,',') then you get result:
    ID SplitData
    1 Text1
    2 Text2
    3 Text3
    ** You can find in the internet several good functions, I HIGHLY RECOMMENDED NOT TO USE T-SQL FUNCTIONS but CLR FUNCTION. Check thi link to understand why:
    http://sqlperformance.com/2012/07/t-sql-queries/split-strings
    ** This is the best function that I know about and I use it, but I change the code a bit to return 2 columns and not just the SplitData as in this blog: http://sqlblog.com/blogs/adam_machanic/archive/2009/04/28/sqlclr-string-splitting-part-2-even-faster-even-more-scalable.aspx
    That's it :-) we are ready for the solution which is very simple
    Solution 1 (BAD solution but easy to write):
    select
    (select SplitData from Split_CLR_Fn(Txt,',') where ID = 1) CustID,
    (select SplitData from Split_CLR_Fn(Txt,',') where ID = 2) FName,
    (select SplitData from Split_CLR_Fn(Txt,',') where ID = 3) LName,
    STUFF((select ',' + SplitData from Split_CLR_Fn(Txt,',') where ID > 3 and ID < (select MAX(ID) from Split_CLR_Fn(Txt,',')) - 1 for XML path('')), 1 , 1,'') Disease,
    (select SplitData from Split_CLR_Fn(Txt,',') where ID = (select MAX(ID) from Split_CLR_Fn(Txt,',')) - 1) Email,
    (select SplitData from Split_CLR_Fn(Txt,',') where ID = (select MAX(ID) from Split_CLR_Fn(Txt,','))) Phone
    from #T
    GO
    Solution 2: better in this case since the format is constant (this is the solution I wrote about above)
    ;With MyCTE as (
    select
    Txt,
    SUBSTRING(Txt, 1, CHARINDEX(',', Txt, 1) - 1) as CustID
    , SUBSTRING(
    Txt
    ,CHARINDEX(',', Txt, 1) + 1 -- I start from the end of preview len
    , CHARINDEX(',', Txt, CHARINDEX(',', Txt, 1)+1)- CHARINDEX(',', Txt, 1) - 1
    ) as FName
    , SUBSTRING(
    Txt
    ,CHARINDEX(',', Txt, CHARINDEX(',', Txt, 1)+1)+1 -- I start from the end of preview len
    , CHARINDEX(',', Txt, CHARINDEX(',', Txt, CHARINDEX(',', Txt, 1)+1)+1) - CHARINDEX(',', Txt, CHARINDEX(',', Txt, 1)+1) - 1
    ) as LName
    , RIGHT(Txt, CHARINDEX(',', REVERSE(Txt), 1) - 1) as Phone
    , RIGHT(LEFT(Txt, Len(Txt) - Len(RIGHT(Txt, CHARINDEX(',', REVERSE(Txt), 1) - 1)) - 1), CHARINDEX(',', REVERSE(LEFT(Txt, Len(Txt) - Len(RIGHT(Txt, CHARINDEX(',', REVERSE(Txt), 1) - 1)) - 1)), 1) - 1) as Email
    from #T
    select CustID,FName,LName, Phone, Email, SUBSTRING(Txt, Len(CustID) + Len(FName) + Len(LName) + 4, Len(Txt) - Len(Email) - LEN(Phone) - Len(CustID) - Len(FName) - Len(LName) - 5) as Disease
    from MyCTE
    I hope that this is useful :-)
      Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]

  • Load a flat file into BW-BPS using SAP GUI

    Hi,
    We are using BW BPS 3.5 version, i implemented how to guide  " How to load a flat file into BW-BPS using SAP GUI" successfully without any errors.
    I inlcuded three infoobjects in the text file   costelemt, Posting period and amount. the same three infoobjects i inlcuded the file structure in the global data as specified in the how to document
    The flat file format is like this
    Costelmnt      Postingperiod         Amount   
    XXXXX             #      
    XXXXX             1                          100
    XXXXX             2                           800
    XXXXX             3                           700
    XXXXX             4                           500
    XXXXX             5                           300
    XXXXX             6                           200
    XXXXX             7                           270
    XXXXX             8                           120
    XXXXX             9                           145 
    XXXXX            10                           340
    XXXXX            11                           147
    XXXXX            12                           900 
    I successfully loaded above flat file in to BPS cube and it dispalyed in the layout also.
    But users are requesting to load  flatfile in the below format
    Costelmnt        Annual(PP=#)   Jan(PP=1)   Feb(PP=2) ........................................Dec(PP=12)  
    XXXXX              Blank                       100           800                                                   900
    Is it possible to load a flat file like this
    They wants load a single row instead of 13 rows for each costelement
    How to do this. Please suggest me if anybody accorss this requirment.
    In the infocube we have got only one Info object 0FISCPER3(Posting period) and one 0AMOUNT(Amount)
    do we need 13 Infobjects for each posting period and amount.
    Is there any possiblity we can implement any user exit which we use in BEX Quer's
    Please share your ideas on this.
    Thanks in advance
    Best regards
    SS

    Hi,
    There are 2 ways to do this.
    One is to change the structure of the cube to have 12 key figures for the 12 posting periods.
    Another way is to write an ABAP Function Module to fetch the values from each record based on the posting period and store it in the cube for the corresponding characteristic. This way, you dont have to change the structure of the cube.
    If this particular cube is not used anywhere else, I would suggest to change the structure itself.
    Hope this helps.

  • Get the file name using XSLT mapping

    Hi
    How to get the file Name at receiver side using XSLT mapping.
    Could any one please help me
    Regards
    sowmya

    Sowmya
    If you will use Grpahical Mesage Mapping then this can be achieved using Adapter-Specific Attribute u201CFileNameu201D
    http://help.sap.com/saphelp_nw04/helpdata/en/43/03612cdecc6e76e10000000a422035/content.htm
    Code Snippet -->
    DynamicConfiguration conf = (DynamicConfiguration) container
    .getTransformationParameters()
    .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create(
    u201Chttp://sap.com/xi/XI/System/Fileu201D,
    u201CFileNameu201D);
    But in case you have to ONLY use XSLT mapping then I would suggest to use the same jave code & call it from your XSLT mapping. I never tried such thing you might use couple of jar files too.
    - lalit -

  • Query on sorting  XML using XSLT and getting the same XML as output !

    Hi,
    Looking for one information regarding sorting XML using XSLT , with the sorted XML as output. For eg. my XML is :
    <?xml version="1.0"?>
    <?xml-stylesheet type="text/xsl" href="sort1.xsl"?>
    <levelone>
         <child ID="1" sort="5">
              <name>Paul</name>
         </child>
         <child ID="2" sort="1">
              <name>Adam</name>
         </child>
         <child ID="3" sort="2">
              <name>Will</name>
         </child>
    </levelone>
    and XSL :
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/levelone">
         <xsl:copy>
         <xsl:apply-templates>
              <xsl:sort select="@sort"/>
         </xsl:apply-templates>
              </xsl:copy>
         </xsl:template>
         <xsl:template match="child">
              <xsl:copy-of select="."/>
         </xsl:template>
    </xsl:stylesheet>
    This does the sort based on Name. But I want to get the same xml as output with the name sorted. Eg.
    <?xml version="1.0"?>
    <?xml-stylesheet type="text/xsl" href="sort1.xsl"?>
    <levelone>
         <child ID="2" sort="1">
              <name>Adam</name>
         </child>
         <child ID="1" sort="5">
              <name>Paul</name>
         </child>
         <child ID="3" sort="2">
              <name>Will</name>
         </child>
    </levelone>
    Any pointers will be highly appreciated.
    - Thanks

    Don't you want <xsl:sort select="name"/> rather than <xsl:sort select="@sort"/>?

  • Uregnt - How to Load Flat File into BW-BPS using Web Browser

    Hello,
    We have followed the 'How to Load Flat File into BW-BPS using Web Browser' guide to build BSP web front-end to upload flat file.  Everything works great but we have a requirement to populate the Planning Area Variables based on BSP drop down list with values.  Does anyone know how to do this?  We have the BSP coded with drop down list all we need to do now is populate variables.  We can populate the variables through the planning level (hardcoded) but we need to populate them through the web interface.
    Thanks,
    Gary

    Hello Gary,
    We have acheived the desired result by not too a clean method but it works for us.
    What we have done is, we have the link to load file in a page where the variables can be input. The user would then have the option to choose the link to load a file for the layout in that page.
    By entering the variable values in the page, we are able to read the variables for the file input directly in the load program.
    Maybe this approach might help.
    Sunil

  • ERROR WHILE USING XSLT MAPPING IN INTERFACE MAPPING

    Hi,
      We are using an xslt mapping in our scenario but while i load the XSLT mapping in the interface mapping i get a message :
    Transformer configuration exception occurred when loading XSLT
    sorce interface :outbound and asyncronous.
    mapping : XSLT mapping (imported as a zip file)
    target interface: abstract,asyncronous.
    The xslt runs well in standalone and its well formed and there is no name space issue.
    please help if any one has faced such a situation while using XSLT mapping.
    regards,
    Anirban.

    Hi Anirban
    When you say it runs well <i>standalone</i> what exactly do you mean? Which XSLT processor are you using to run it? There are subtle difference between XSTL processors that can sometimes result in incompatibilities. For instance, I have seen XSLTs run correctly in XMLSpy but incorrectly (or at least slightly differently) in XI.
    Regards,
    Thorsten

  • Advantages of using XSLT mapping

    Can any one explain me the advantages of using XSLT mapping compare to graphical.java and abap mappings

    Hi
    Please go through the below links for details on XSLT Mappings..
    XSLT Mapping
    /people/udo.martens/blog/2006/04/26/xslt-recursive-templates
    Thread:
    Sample XSLT mapping required
    XSLT Mapping Links::->
    /people/prasadbabu.nemalikanti3/blog/2006/03/30/xpath-functions-in-xslt-mapping
    /people/sreekanth.babu2/blog/2005/01/05/design-time-value-mappings-in-xslt
    /people/anish.abraham2/blog/2005/12/22/file-to-multiple-idocs-xslt-mapping
    XSLT Mapping with java enhancement
    /people/pooja.pandey/blog/2005/06/27/xslt-mapping-with-java-enhancement-for-beginners
    XSLT - ABAP.
    /people/r.eijpe/blog/2005/11/04/using-abap-xslt-extensions-for-xi-mapping
    exception handling errors in respect with XSLT mapping
    http://help.sap.com/saphelp_nw2004s/helpdata/en/8a/7672f7d7e444439fd7024f806221a4/content.htm
    Hope this will help
    Regards
    Piyush
    **reward points if found useful.

  • Change Filename using XSLT mapping without variable subtitution

    Hi,
    My scenario is IDOC to file...i am using XSLT mapping, i want to change the filename format to OUT_<Purchase Number>_<DDMMYYYYhhmmss>_KKKK.txt, i cannot use UDF function as i do XSLT mapping i also i cannot use variable substitution as the target structure doesn't have PO and timestamp as tag elements. Can i acheive using writing a adapter module? I appreciate if anyone could help me with this..
    Many thanks

    >
    Ravibabu Adari wrote:
    > Hi,
    > If i go with Option1: what changes i need to do in the file adapter to tell the adapter to pick the filename from XSLT ?
    > If i go with Option2: To which element to the target structure should i map the filename using UDF ? do i have to add additional element to the target structure? what changes i need to do in the file adapter to tell the adapter to pick the filename from Message mapping ?
    >
    > Many thanks
    Hi,
         in both cases you need to enable file adapter specific properties and enable the file name...
    for this you need to use the dynamic configuration properties for the same...
    usage of this option using udf in message mapping is rather easy than to use in XSLT...for this you dont need to change the structure in the message mapping...message mapping is just needed for execution of the udf.. thats it..
    HTH
    Rajesh

Maybe you are looking for

  • Problem when using keyfield in sender file content conversion

    Hi all, I am using FCC at sender side. My recordset structure is as follow:: <MT_TW_TLOG>   <Transaction>    ---<SalesItem> 1...unbounded        <XF_SOURCESYS>        <XF_STORECODE>        <XF_TYPE>        <XF_VOIDFLAG>    ---</saleItem>    ---<Sales

  • Automator problem parsing variable as filename in disc image

    Dear apple/automator forum. I have just recently started using Automator, and i am experiencing a little problem which im hoping to get a helping hand with. First, heres my screenshot (sorry its in danish, ill explain what iwe done): www.bergsorensen

  • To send the Payload as PDF Attachment in mail in PI 7.1

    Hi All, I have to send a file as PDF attachment using a mail adapter. I gave the Content_Type as 'application.pdf'. I am receiving the mail, but I am unable to open the PDF. It says 'Could not open because the type is not supported or unable to decod

  • Can't import raw images

    I want to import RAW images. Have always been able to import JPEG's to iPhoto. Reformatted memory card. Took picture. Picture appears visible on playback. When I import, iPhoto says the image is unreadable. What to do?

  • Poor Color on TV after Transcoding with Encore

    The color is bad when I view the DVD on my (Panasonic) DVD/VCR-TV that I created with PP/Encore; whereas, when the same DVD is run on my computer the colors are fine. They look just like the originals I worked on in Photoshop. So the problem appears