cancel
Showing results for 
Search instead for 
Did you mean: 

What are the right content conversion parameter in this receiver ?

Former Member
0 Kudos

Hi experts,

Can someone help me with setting right Content conversion parameter in the Receiver of File adpater(FCC).The output file must be fixed length text file.

Here is the receiver structure:


<Recordset>
    <Header>
       <f1>01</f1>
       <f2> </f2>
       <f3> </f3>
    </Header>
     <Body>
        <SubBody1>
              <field1 />
              <field2 />
              <field3 />
              <field4 />
              <field5 />
        </SubBody1>
         <SubBody2>
              <field6 />
              <field7 />
              <field8 />
              <field9 />
              <field10/>
        </SubBody2>
     </Body>
    <Trailer>
        <f1>03</f1>
        <f2> </f2>
        <f3> </f3>
   </Trailer>
</Recordset>

Also Body can occure multiple times in the file but still will have this structure...Header and Trailer can occure only once in file.

What are the right content conversion perameters in this case?

Appreciate your help asap!T

Thanks

Jon

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Recordset:Header,Body,SubDody1,SubBody2,Trailer

Header.fieldFixedLengths - Specify a character string containing a list of fixed column widths that are separated by commas according to your structure.

SubBody1.fieldFixedLengths - based on you are structure

SubBody2.fieldFixedLengths - based on you are structure

Body.endSeparator - 'nl'

Trailer.fieldFixedLengths - based on you are structure

Cheers's

Former Member
0 Kudos

Thanks, for the tips,

Can you please be more specific when you say : based on you are structure??Well the structure is given - you can see it ? Each field in the output file will start from fixed position :

Body: 1pos- field1 20 pos field2 35pos field3 .....

Same is for Header and trailer - every field is fixed at exact position...

pls asap

thanks

Former Member
0 Kudos

What i mean by "based on your structure" is the length of the fields.

you have to specify the field coloum lengths separated by comma,

For example your first field length is 10 and second field length is 20 for your output structure.

In that case: Header.fieldFixedLengths --- 10,20

Former Member
0 Kudos

Thanks ,

and what do you do with SubBody.fieldNames ? Do I put Name/Value and if I do - do I enter field1 , field2, field3 ...etc . Actually do I need to enter all fields along with the fixed length or it is not needed? If I do need to enter them - do they have to give same namer for the field or it could be - f1 , f2, f3?

Thanks

Former Member
0 Kudos

No , you don't need to enter the fieldnames but will have to do a similar configuration as header for SubBody

SubBody1.fieldfixedLengths --- 10,15,10,25 ..etc(field lengths of all the fields under this node)

SubBody2.fieldfixedLengths --- 5,...etc (field lengths of all the fields under this node

Former Member
0 Kudos

So Body is not entered in the Parameters?Onlu SubBody is ? Correct?

How come the File Adapter knows that SubBody is substructre of Body ? Or it does not need to know it ?

Aslo under Adapter(Receiver) there is a field I have to enter - either Text or Binary ? I want the output file to be text - do I enter Text?

Thanks !!!

Former Member
0 Kudos

yeah it should take care of it with out you needing to enter any values for Body as there are no child fields directly under it.

Use Binary for file encoding. This parameter doesn't mean that you are going to get the output in "00011110011" format .. it is related to the encoding of the XML document which is created.

just give these parameters a try and share the output structure if possible.

Cheer's

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi John,

The file adapter does not support more than two levels.

Former Member
0 Kudos

Thanks Ian,

What do I do in such case? Look at my structure up , Under recordset I have - Header, Body and Trailer substructured - 1 lever , but under Body I have another Substructures and than the fields ? What do I do in this case ? Am I fine or not ?

I don't like to revise my Data Mapping and Data types...

If you'd like I can send you a screenshots with my Data definitions in the Receiver side?

Thanks !!

Former Member
0 Kudos

<Recordset>

<Header>

<f1>01</f1> F1F2F3SB1F1SB1F2..SB1F5SB2F1SB2F2..SB2F5TF1TF2TF3

<f2> </f2>

<f3> </f3>

</Header>

<Body>

<SubBody1>

<field1 />

<field2 />

<field3 />

<field4 />

<field5 />

</SubBody1>

<SubBody2>

<field6 />

<field7 />

<field8 />

<field9 />

<field10/>

</SubBody2>

</Body>

<Trailer>

<f1>03</f1>

<f2> </f2>

<f3> </f3>

</Trailer>

</Recordset>

Is the expected output something like this

F1F2F3---- Header

SB1F1SB1F2..SB1F5SB2F1SB2F2..SB2F5( multiple line items)

SB1F1SB1F2..SB1F5SB2F1SB2F2..SB2F5

TF1TF2TF3( Trailer)

Former Member
0 Kudos

I think you are very correct:

F1F2F3---- Header

SB1F1SB1F2..SB1F5SB2F1SB2F2..SB2F5( multiple line items)

SB1F1SB1F2..SB1F5SB2F1SB2F2..SB2F5

TF1TF2TF3( Trailer)

Actually Body is the Record – and within one file you can have multiple Records(Bodies) and only one Header and Trialer . I put only to for clarity but actually occurrence for Body is 0:unbound which means you can have 0 or many occurrence in the file…SubBody1 , SubBody2 …SubBodyN.

But In the file fields go on row one after another based in Fixed length of each field until first Body(records ) is printed , than follows the second Body start at new line, than third Body starts at new line and so on…Each line is given fixed length 500 which is enough to hold all fields in the body…

So you are exact right about the output structure the way you have it above !

So what do we do than?

Thanks much!

Former Member
0 Kudos

Sorry I have a mistake in my previous post :

This is the correction

...Actually Body is the Record – and within one file you can have multiple Records(Bodies) and only one Header and Trialer . I put only to for clarity but actually occurrence for Body is 0:unbound which means you can have 0 or many occurrence in the file…Body1 , Body2 …BodyN.....

But you are right in your structure - bottom line !

Former Member
0 Kudos

It would be graet if you could tell me how to set up conv parameters in if this is the way I want to print things in the file ..thanks!!

Former Member
0 Kudos

<Recordset>

<Header>

<f1>01</f1>

<f2> </f2>

<f3> </f3>

</Header>

<Body>

<SubBody>

<field1 />

<field2 />

</SubBody>

<SubBody>

<field1 />

<field2 />

</SubBody>

<SubBody>

<field1 />

<field2 />

</SubBody>

</Body>

<Trailer>

<f1>03</f1>

<f2> </f2>

<f3> </f3>

</Trailer>

</Recordset>

if this is the input structure then FCC goes like this ....

Recordset:Header,Body,SubBody,Trailer

Header.fieldFixedLengths – 10,20,30.. (based on you are structure fixed lengths)

Header.endSeparator - 'nl'

SubBody.fieldFixedLengths – 10,20,20 (based on you are structure fixed lengths)

Body.endSeparator - 'nl'

Trailer.fieldFixedLengths – 10,20,30….(based on you are structure fixed lengths)

Trailer.endSeparator - 'nl'

We might have to try out SubBody.endSeparator - 'nl' if Body.endSeparator - 'nl' does not insert a new line after each body record.

Cheer's

Former Member
0 Kudos

Ok Great - it is what I need and hope to work! let me try it - I will get back to you very soon ! Stay tunned ,

Thanks

J

P.S. again I wont enter field names , I will enter only lenght for each field ..

Former Member
0 Kudos

yes, you just need to enter the lengths...

Cheer's

Former Member
0 Kudos

I am getting error..Have any idea?

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

- <!-- Request Message Mapping

-->

- <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">

<SAP:Category>Application</SAP:Category>

<SAP:Code area="MAPPING">EXCEPTION_DURING_EXECUTE</SAP:Code>

<SAP:P1>com/sap/xi/tf/_MM_MAPPING_</SAP:P1>

<SAP:P2>com.sap.aii.utilxi.misc.api.BaseRuntimeException</SAP:P2>

<SAP:P3>Fatal Error: com.sap.engine.lib.xml.parser.Parser~</SAP:P3>

<SAP:P4 />

<SAP:AdditionalText />

<SAP:ApplicationFaultMessage namespace="" />

<SAP:Stack>During the application mapping com/sap/xi/tf/_MM_MAPPING_ a com.sap.aii.utilxi.misc.api.BaseRuntimeException was thrown: Fatal Error: com.sap.engine.lib.xml.parser.Parser~</SAP:Stack>

<SAP:Retry>M</SAP:Retry>

</SAP:Error>

Former Member
0 Kudos

did you try testing your mapping in the IR test tab.

Former Member
0 Kudos

YES , of course - Mapping passed succsfully ?!! Any idea ?Do u think it is a mapping problem - Mapping was just fine !

Pls help with ideas ,,,thanks much!

Former Member
0 Kudos

Atleast from what i can understand from the error msg is that your mapping is throwing an runtime excepti

Can you share your mapping, what is u r sender adapter

Former Member
0 Kudos

sure , do you want me to send mapping details to you ?

For sender I am just using pure XML Adapter .Actually my XML to XML conversion whent fine - i did it for test purposes...to make sure XML work fine,,And XML to XML is based on same mappings...So I wonder what coudl be wrong ?

I can sedn files if you want, just tell me what do u need ?

thanks

Former Member
0 Kudos

you can please send me the files at n.dreamcatcher26@gmail.com.

So you are saying that the same test file was working fine before FCC

Shabarish_Nair
Active Contributor
0 Kudos

/people/shabarish.vijayakumar/blog/2007/08/03/file-adapter-receiver--are-we-really-sure-about-the-concepts - read that weblog for a right understanding. It talks about the approach that you will require.