Skip to Content
Receiver File Adapter and Problem with File content conversion? Well experience shows us that one of the easiest file adapters to configure is the Receiver File adapter for content conversion. But then why does frequent questions rise up with concerns mainly on the regard that a specific structure is not being content converted into what is desired? A close look into those questions reveal that developers actually are not quite sure about the capabilities or rather I would say limitations of the Content Conversion feature. This blog will focus and try to help the reader with getting the concepts clear and understand the limitations of file content conversion in the Receiver Adapter. That, I assume will lead to a better design of your developments, esp. the creation of the DT/MT for a particular File interface and the desgin of mappings.   Lets start off by having a quick peek into what SAP help defines for content conversion  (http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm).   First thing that needs to be considered is the XML structure that is the resultant of the mapping. It is a well known fact that files do not contain hierarchies (aint I right?), so your target structure generated should be a FLAT XML and not one with a hierarchy. Most of the queries that are found in the forums have basically one reason – An incorrect design of the DT/MT and that leads to an undesirable result in the content conversion. If we are aware that one of the limitation of the file adapter is handling hierarchies, the problem would never have come up and now when we realise that (some dont), our development would have come a long way and it might result in a total rework. So point to note: *MAINTAIN A FLAT XML FOR YOUR TARGET FILE IF YOU INTEND TO CONTENT CONVERT IT *  Now further down let us actually try to content convert a XML with multiple hierarchy and understand how it behaves. The below is the XML that we will be working on; XMLFor the above XML, we normally expect the result to be (considering it is going to be a comma separated file and the end separator being a new line) the following; HF1,HF2 IF1,IF2 IXF1,IXF2 IYF1,IFY2 IF11,IF22 IXF11,IXF22 TF1,TF2 but then is this how it really is going to behave? Lets find out.  For the above XML, lets try to generate it as a flat file with the fields searated by a ‘comma’ and the endSeparator being ‘$$’ . So naturally our ‘baisc instinct’ for FCC would be as follows;FCC
To report this post you need to login first.

7 Comments

You must be Logged on to comment or reply to a post.

  1. Former Member
    Hi Shabarish,

    I really appreciate for your active participation in SDN world but dont you think that whatever you have mentioned in your blog is already being explained in your old blogs in some other form.

    Content Conversion ( The Key Field Problem )
    Above link contains everything what you have explained and whatever is remaining is there in the link given in the blog.

    “”””” Blogging should be done for sharing knowledge not just for sake of capturing points and adding one more topic in the blog posting list “””””

    I hope you understand this and would come with some good blogs in sdn.

    Thanks.

    (0) 
    1. Shabarish Vijayakumar Post author
      Hi Pranav,

      I really appreciate your concern, but this is actually the first time i am writing about the receiver file adapter ๐Ÿ™‚ (Content Conversion ( The Key Field Problem ) as you mentioned actually doesnt have anything what i have covered in this blog). I hope you are aware that the sender and receiver adapters are different ๐Ÿ˜‰

      And then i guess what you missed out is the reason why this blog was written. The intension was to make the reader aware of the limitations of the flle adapter so that his design itself will be concrete.

      “”””” Blogging should be done for sharing knowledge not just for sake of capturing points and adding one more topic in the blog posting list “””””
      >>>>
      Yes, I hope a lot of us do keep those words in mind ๐Ÿ™‚

      Regards,
      Shabarish

      (0) 
      1. Former Member

        Hi Shabarish,

        I am following your blog to develop the below structure. Kindly help me with suggestions as it is not working in my case.

        <?xml version=”1.0″ encoding=”UTF-8″?>

        <ns1:MT_TargetMessage xmlns:ns0=”urn.aa.com:PYI083:AcknowledgementFileFromSAPPYtoEIWO_Out”>

           <RecordSet>

              <FileHeader>

                 <DocumentCode/>

                 <ControlNumber>000011</ControlNumber>

              </FileHeader>

              <Record>

                 <BatchHeader>

                    <DocumentCode/>

                    <ControlNumber>000012</ControlNumber>

                 </BatchHeader>

                 <DetailRecord>

                    <EmployeeLastName>Grace</EmployeeLastName>

                    <EmployeeFirstName>Lily</EmployeeFirstName>

                 </DetailRecord>

                 <DetailRecord>

                    <EmployeeLastName>Grace</EmployeeLastName>

                    <EmployeeFirstName>Lily</EmployeeFirstName>

                 </DetailRecord>

                 <BatchTrailer>

                    <DocumentCode/>

                    <ControlNumber>000012</ControlNumber>

                 </BatchTrailer>

              </Record>

              <Record>

                 <BatchHeader>

                  </BatchHeader>

                 <DetailRecord>

                  </DetailRecord>

                 <BatchTrailer>

                 </BatchTrailer>

              </Record>

              <FileTrailer>

                 <DocumentCode/>

                 <ControlNumber>000011</ControlNumber>

           </RecordSet>

        </ns1:MT_TargetMessage>

        File looks like below:

        FH

        BH

        DT

        DT

        BT

        BH

        DT

        BT

        FT

        In SFTP FCC channel i am using the below

        FileHeader,Record,BatchHeader,DetailRecord,BatchTrailer,FileTrailer and the field fixed length and end separator

        Error: XML parser error

        It is not working. Kindly suggest.

        (0) 
  2. Former Member
    Hi Shabarish

    I have the exact scenario that you are explaining.  However, I battle to convert the xml in hierarchy form to flat form.  Can you please point me in the right directions.

    There are so many postings about this subject, but I cannot seem to find a smart solution.

    Regards
    Philip

    (0) 

Leave a Reply