cancel
Showing results for 
Search instead for 
Did you mean: 

Need to read the end of the file

allamudi_loordh
Active Participant
0 Kudos

Hi mates,

I have a scenario, where the huge file is coming of 2 million records, i am doing FCC with recordset per message.Now i have to send some flag to proxy saying end of the file at last message. In the message monitoring logs i can see like below.

Message 1--- Part of The file FCC is converted

Message 2-- Part of the file FCC is converted,

...

;;;

Last Message---Completed the File FCC.

so i have to read that last step and pass to abap that total file is transferred from PI. So that there is one job which runs after this in abap.

please give me an idea. I tried with chunk but there we should not use any Mapping.

I am working on PI7.3(Dual Stack) . Scenario is File(txt) to Proxy.

Regards,

Loordh.

Accepted Solutions (1)

Accepted Solutions (1)

allamudi_loordh
Active Participant
0 Kudos

thank you all,

Due to performance issue, i am not going with above approach. I did file to file in chunk mode without ESR objects(picking from legacy and placing in ECC application Server). So that ABAP people can read the file very easily.

once again thank you for inputs.

Regarsd,

Loordh.

Answers (2)

Answers (2)

nabendu_sen
Active Contributor
0 Kudos

Hi Loordh,

Its better if Source file contains some flag for the last record. Then you can read that in your message mapping and send the same to target system. If you use count in UDF, then it will incraese the overhead because you have to perform lookup.

Check the below thread:

http://scn.sap.com/thread/324359

Regards,

Nabendu.

allamudi_loordh
Active Participant
0 Kudos

thanks nabendu and baskar,

I gone through the above link. Can i go ahead with hash table approach storing the each message size and comparing with the total message size in PI. But my question is will it store all other values.

In the message log i can see clearly  that "completed the FCC" for the last message. Can i read this parameter inside PI mapping by any chance,

thanks once again,

Regards,

Loordh.

baskar_gopalakrishnan2
Active Contributor
0 Kudos

>In the message log i can see clearly  that "completed the FCC" for the last message. Can i read this parameter inside PI mapping by any chance,

This will happen after your mapping step. So you  might not able to  use during mapping

allamudi_loordh
Active Participant
0 Kudos

Hi Baskar,

No it is not happening after mapping. But it is happening at the beginning step of Sender channel.

Below is the log information.

Channel Filechunksender: File splitting - read last part of file content

Regards,

Loordh

ambrish_mishra
Active Contributor
0 Kudos

HI Loordh,

Try to read the header attribute which says end of file in a Java mapping before your graphical mapping and populate a flag for ABAP team in graphical mapping to determine end of file processing.

SAP note 801926 talks about the additional attributes.

Please check and revert back.

Ambrish

baskar_gopalakrishnan2
Active Contributor
0 Kudos

There are couple of ways to handle this. If the sender system sends say fixed records then it is still easy. You can create a counter using UDF in the mapping. This mapping sets value in a db table or in a file. The mapping reads the value and pass it to mapping field with increment 1  and after the mapping update the table with counter new value. You can create a field in the payload that tells the message number. In your mapping check that number is 2 million and if so don't increment and send it is last messge.

Only drawback with this design what if single message fails after mapping for some reason.