cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

Hi All,

I have a requirement where in i need to add one file header to a file in append mode .

The requirement is as follows :

In a day , SAP sends certain number of IDOCs to XI . For the first IDOC that comes in ,XI has to create a file and later for the rest of the IDOCs ,XI just has to append the file content .

- At the End of the Day , the target system picks this file for processing.

My file structure is as follows:

File Header

seg1

seg2

seg3

seg1

seg2

seg2

seg3

seg3

While creating a file in append mode at receiver , the header record gets appended multiple times which is not desirable.

Please suggest me ways to make sure that the file gets written in the above format with the file header only once .

Thanks for your help,

Pooja

0 Likes
View Entire Topic
Former Member
0 Likes

Thank you,

I achieved the desired output with the help of a UDF that checks the presence of target file (at the mentioned path) and the absence serves as an indicator to create the header.

Thanks,

Pooja

ambrish_mishra
Active Contributor
0 Likes

Nice one...

ambrish_mishra
Active Contributor
0 Likes

Pooja,

What if multiple IDocs hit PI at the same time and the while your UDF is executing the file is being written ?

Please test the solution by triggering multiple IDocs at the same time just to avoid surprises at Go live

Hope it helps!

Ambrish