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
ambrish_mishra
Active Contributor
0 Likes

Hi Pooja,

You can try like below:

You need an indicator to make sure you don't populate the header the second time. You can ask ABAP team to populate this indicator. So the second time, don't populate the header data based on this indicator. Is the target file fixed length or delimited ?

Ambrish

Former Member
0 Likes

Hi Ambrish,

Thanks for the approach

The ABAP team is collecting IDOCs and then processing it in batch. In Batch processing, the IDocs need not be passed to XI in sequence; therefore the indicator for the first record may not work in this case (the sequence is not maintained).

The target file is fixed length.

Pooja

ambrish_mishra
Active Contributor
0 Likes

Hi Pooja,

In that case, work with a property file. so for a particular day maintain the values in property file like current date       dateValue

Header              Y/N

In the first run, check the property file if cuuent date is null && header date is N, then update date as today's date and header as Y... in subsequent runs, since it is Y for a particular day, then don't update the header in the target.

hope it helps!

Ambrish

ambrish_mishra
Active Contributor
0 Likes

Pooja,

If you need any further inputs on the above, do revert back.

Ambrish