cancel
Showing results for 
Search instead for 
Did you mean: 

Footer record in File Receiver channel

Former Member
0 Kudos

Hi PI Gurus.

I am a novice in PI.

We have an IDOC to file scenario.

After the file is generated, we want to add a footer to the file which will have some information about no of records generated.

Is it possible to do so?

If so, how can I achieve it?

Also, can I persist my message? that is, IDOC comes in, but the receiver is down. Will my IDOC message go as soon as the receiever is up? If not immediate, what do I need to do to send it?

3rd scenario: I can have more than one idoc coming in for the same file. Lets say one idoc comes in at 5 PM. Other one comes at 11 PM. For 11 PM IDOC, I want to take only those records which were NOT processed at 5 PM. Is this possible?

Thanks in adv.

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member207622
Contributor
0 Kudos

After the file is generated, we want to add a footer to the file which will have some information about no of records generated.

Is it possible to do so?

Create a field in your target file structure and enter the count of records into that field by node function or by UDF

then create a file receiver channel and in file content conversion mention that field and automaticlly when file will be generated it will have the value of number of records

For point no 2 >>>> There are settings in SXMB_ADM which you can do to hold the messages in database you can do archiving and deletion as well

but for there will not be any automatic restart you have to do manually

For Point no 3 >> you have to develope a scenario using synchronous BPM

Regards

Ninad

Former Member
0 Kudos

Hi,

About your first question... yes it's possible to add a record to the file with the number of records generated.

To do this, you must modify your target structure and append a new node that will not appear in your file.

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

... YOUR SCHEMA ...

<xsd:element name="NOTHING" form="qualified">

<xsd:complexType>

<xsd:sequence>

<xsd:element name="Counter" type="xsd:string" form="qualified" />

</xsd:sequence>

</xsd:complexType>

</xsd:element>

</xsd:sequence>

</xsd:complexType>

</xsd:element>

</xsd:schema>

In your message mapping calculate field Counter with the number of lines of your file (detail + headers + footers)

In your target cc, reject node NOTHING if you don't want it appears in file content:

NOTHING..fieldFixedLengths --> 0

NOTHING.fixedLengthTooShortHandling --> Cut

NOTHING.endSeparator --> '0'

Regards,

Carme.