cancel
Showing results for 
Search instead for 
Did you mean: 

Receiver File Content Conversion

former_member183909
Active Participant
0 Kudos

Hello

I have a classic problem with Receiver File Content Conversion. I have read all of the blogs and SAP help on the settings but I still cannot get it to correct result.

Source file can consist of multiple UNBOUNDED ORDER HEADERS and then within each multiple UNBOUNDED DETAILS

<?xml version="1.0" encoding="UTF-8" ?> 
  <ns0:mt_kac_order xmlns:ns0="urn:mypalce.com.au:pi:A_MPL_B2B_LTD_OTS:SAP_To_OTS">
  <OUT_HEADER>
   <PODSYUB>01</PODSYUB> 
   <PORKBN>1</PORKBN> 
   <PODSKBN>A</PODSKBN> 
   <POHGCOD>9361</POHGCOD> 
   <POPONO>0200000166</POPONO> 
   <FILLER>/</FILLER> 
      <OUT_DETAIL>
         <POATHIN>PC130_7</POATHIN> 
          <FILLER>/</FILLER> 
       </OUT_DETAIL>
      <OUT_DETAIL>
         <POATHIN>PC465_2</POATHIN> 
          <FILLER>/</FILLER> 
       </OUT_DETAIL>
  </OUT_HEADER>
  </ns0:mt_kac_order>

I want to output a fixlength flat file with HEADER followed by its DETAIL lines, then another HEADER followed by its DETAIL lines and so on...

My Settings in Receiver File Comms Channel

Record set structure: OUT_HEADER,OUT_DETAIL


OUT_HEADER.fieldSeparator     #
OUT_HEADER.endSeparator     ´nl´
OUT_DETAIL.fieldSeparator       #
OUT_DETAIL.endSeparator     ´nl´

It converts the file but it seems to ignore my record set structure as it write out a file will all of the fields

It should write out 1 line for header and another line for detail.

Why does it not do this ?

Edited by: Jonny Wellard on Mar 8, 2010 3:45 AM

I do not think it is possible to do this with the current strcture.

As just re-read the SAP help "The expected XML structure contains the structure as nodes filled with any number of elements without additional subnodes"

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

With the message interface you have used, it is not possible

to get the output of order header and order details in different line.

You have to change your message interface structure as follows:

After that you define FCC parameters as below:

Record set structure: OUT_HEADER,OUT_DETAIL

OUT_HEADER.fieldSeparator #

OUT_HEADER.endSeparator ´nl´

OUT_DETAIL.fieldSeparator #

OUT_DETAIL.endSeparator ´nl´

Now you will get header and detials in different line.

former_member183909
Active Participant
0 Kudos

Now understand that FCC cannot do complex "deep" structures such as that.

I just need to get the result into a format that FCC will use.

I can adjust the source XML but that will just output all the HEADERS followed by all the LINES.

eg.

HEADER

HEADER

HEADER

LINE

LINE

LINE

LINE

etc.

Another thing is that I really want to output them in fixed length (only did comma to keep the example simple).

Now I think I can do this in 2 steps

Step 1 - Map my IDOC to the complex deep structure

Step 2 - do XSLT to flatten the structure.

The XSLT should be easy to do...I need to go and find out how. Any sample XSLT on flatten would be nice.

thanks

Former Member
0 Kudos

Hi Jonny,

As per ur requirement... u want it as..

HEADER

LINE

HEADER

LINE................ rt???

Then the terget message also should have the contents as

HEADER

LINE

HEADER

LINE................

I mean these two should repeat.....

But it's unnecessary overhead in payload in target side....pl keep in mind.(adding header again and again)

If still nt solved pl do post

Babu.

Former Member
0 Kudos

Hi,

<?xml version="1.0" encoding="UTF-8" ?>

<ns0:mt_kac_order xmlns:ns0="urn:mypalce.com.au:pi:A_MPL_B2B_LTD_OTS:SAP_To_OTS">

<OUT_HEADER>

<PODSYUB>01</PODSYUB>

<PORKBN>1</PORKBN>

<PODSKBN>A</PODSKBN>

<POHGCOD>9361</POHGCOD>

<POPONO>0200000166</POPONO>

<FILLER>/</FILLER>

<OUT_DETAIL>

<POATHIN>PC130_7</POATHIN>

<FILLER>/</FILLER>

</OUT_DETAIL>

<OUT_DETAIL>

<POATHIN>PC465_2</POATHIN>

<FILLER>/</FILLER>

</OUT_DETAIL>

</OUT_HEADER>

</ns0:mt_kac_order>

The requirement u have cannot be satisfied, with the above structure....

But... u can solve this in two ways also..

1. Can u cahange the target message structure. If yes then u change as

OUT_DETAIL and OUT_HEADER will be in same level.

I think this is not a problem as ultimately u want to create a file.

So please change ur target structure like this.

<OUT_HEADER>

<PODSYUB>01</PODSYUB>

<PORKBN>1</PORKBN>

<PODSKBN>A</PODSKBN>

<POHGCOD>9361</POHGCOD>

<POPONO>0200000166</POPONO>

<FILLER>/</FILLER>

</OUT_HEADER>

<OUT_DETAIL>

<POATHIN>PC130_7</POATHIN>

<FILLER>/</FILLER>

</OUT_DETAIL>

<OUT_DETAIL>

<POATHIN>PC465_2</POATHIN>

<FILLER>/</FILLER>

</OUT_DETAIL>

and then change ur record structure as OUT_HEADER,OUT_DETAIL

and apply the FCC u have given.

Please note: Here u have to give the multiple Headers.i.e the header should mulyiply as many times as that of the Details.

Here the header is repeating unnecessarly.. though it's nt required...(But u have unusual requirements.. no escape)

2.Write an adapter module for Receiver File Adapter. And convert them as u required.

If still any doubt pl do post.

Babu

Edited by: hlbabu123 on Mar 8, 2010 9:51 AM