cancel
Showing results for 
Search instead for 
Did you mean: 

how to remove first two headerlines while appending files

Former Member
0 Kudos

Hi,

Currently the requirement is client only needs the file name without any time stamp or counter. They do not want to overwrite the records.

They need the csv file structure as:

Customer

Custnum,Custname

123,ABC

While I am using append, it is also appending the first two header lines.

Can you please suggest how to append without headers.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Swapna

One option is of course to have the flag in the source structure so that you can identify whether it is first run or not. But if there is no such flag in source structure then the only possible solution will be done

based on a look up.

You can perform the same in java mapping using a hash table which will be updated with the file name in its first run and in the next run you will check whether the file name exists in the has table or not.Depending on that you have to pass the header value.

Next solution can be maintaining a table in ABAP and perform a RFC look up in message mapping.

When the file arrives, its will check whether the name is already there in the table or not. If the file not exists, then it will insert the file name in the table and return true. Based on this you will pass the header names.

When the next file will arrive with the same name , The look up will find that file has already present in the table so it will return false and no header information will be sent. Only data will be sent.

Former Member
0 Kudos

Thanks. My scenario is File to File. The File is coming from SAP. It is getting generated with time stamp. Then how to give the exact file name.

Former Member
0 Kudos

Hi Swapna

You can choose adapter specific attribute in sender file adapter and read the file name using dynamic configuration.

Then you can use substring function to get the exact file name without time stamp. Use the same for the look up.

Let me know if you have any doubts.

Former Member
0 Kudos

The client requirement is they only need the file name in their folder not any time stamp or Counter attached with the file name. They are scheduling their job once in a day. In PI we have used overwrite the file in receiver channel configuration.

Situation is - In case PI is down or channel gets failed for say 2/3 days 2/3 files are stucked in PI and once channel restarted it will automatically send those files at a time and they will miss first 2 files data and get the last file.

We can give wait time at sender channel so that it will pick file one after another and send. But if receiver channel fails how to get all 3 files.

Can we schedule any job so that it will process first one file at one time and then process other two at receiver end or append is the only solution for this.

Former Member
0 Kudos

Hi Swapna

You can use the combination of both.

1. Include wait time in the sender communication channel.

2. Use EOIO as the processing mode.

So that all files will be put in one queue and will be executed on by one.

Former Member
0 Kudos

Thank you . If receiver channel is failed and say 3 files are stucked in PI. If I will use ATP in communication channel and schedule it say 8 PM and then it will process all 3 one after another.

Actually at client end Job is scheduled at 8 PM and it is once a day. If my first job will run at 7.50 and processing time 10 minutes, they will receive the first file, then I will again job twice.. so that In that day they will receive 3 files at that day without missing any.

Can I use ATP for this in communication channel monitoring or any chance if for that particular day they will receive one file containing all 3 file data.Please let me know.

Former Member
0 Kudos

Hi Swapna,

Refer below blog and check reply from Hari

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

Regards,

Mastan

iaki_vila
Active Contributor
0 Kudos

Hi Nayak,

AFAIK there is not a standard way. You can try another approximation. Why is you sender channel?, depending of the channel you can find out if the sender lets to control it. However, i was thinking that you can create the file in the mapping level with the header only in the first call (UDF or java mapping), all subsequent calls will see that the file is created and will not change anything. The receiver file channel will never insert the header fields, only the data.

Regards.

Former Member
0 Kudos

Thanks.. can you please tell how to achieve that.

allamudi_loordh
Active Participant
0 Kudos

Hi Swapna,

If it is proxy to file.  Create one field called " FLAG" in the outbound proxy structure.If it is the first run ask them to put "FIRST" so that based this value you create header fields in receiver structure. for other values of FLAG you can ignore creating Header segments.so that always you get Details only.

regards,

Loordh.