cancel
Showing results for 
Search instead for 
Did you mean: 

Directory for archiving files with errors

Former Member
0 Kudos

HI ,

My Scenario is file to RFC Asynch.

when ever the PI picks file from the source directory that file need to delete from the path and need to be archived to some other patch.

And if the file has wrong data it need to archive to error archive folder.

For this I used Archive processing in filesender adapter and I also used directory for archiving files with errors(for wrong data files).

Now the files are arching successfully in the given archive folder for successful messages. But the error files (wrong data which are throwing mapping error in MONI) are also archiving in the same archive folder.

But these error files need to archive in error archive folder.

How can I achieve this?

Thanks in Adv..

Vankadoath.

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi Vankadoath,

For Mapping errors, the files will not be archieved in the Directory for Archiving Files with Errors.

It only archived either during the conversion of the file content, or in a module in the module processor.

Ref: http://help.sap.com/saphelp_nwpi711/helpdata/en/44/655453b48a4ddfe10000000a1553f7/content.htm

If you would like to view that files that got failed, then select the option Add Timestamp for the archive folder, so that when the message fails then you can get the file using the timestamp.

Thanks,

naveen_chichili
Active Contributor
0 Kudos

HI Vankadoath,

In your file adapter you would be able to pick the file and archive those ...Also you can archive the files into Archive directory though the file is successful or failure...

If you need to Archive the error files into a separate folder then you need to handle it in mapping....

Thanks and Regards,

Naveen.

Former Member
0 Kudos

HI Hareen,

but my client want to move those files (which are not reached to target because of mapping errors or others also) in a separate folder like error archive files folder.

Is there any way to pick those files (Mapping error fies) from the success archive folder and again move to the error archive folder.

Thanks!

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi,

How you will identify file is having error?

follow this solution to archive error files:

Do multi mapping in PI add one more receiver as a file, have to write error validation logic in mapping, whenever validation logic not satisfies(for error files) send data to File receiver , in receiver specify error file directory in receiver channel.

this approch will solve your problem.

let us know if you have any issues.

Regards,

Raj

Former Member
0 Kudos

Yes, the solution provided by Raja is suits your requirement.

Follow the proceedure suggested.

Thanks,

former_member854360
Active Contributor
0 Kudos

you can use raja's logic ..........in addition in second receiver do a simple mapping UDF to delete the file from the SUCCESS folder. otherwise your file will be archived in both the folder success and errror

see this code.

DynamicConfiguration conf = (DynamicConfiguration) para.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
			
			DynamicConfigurationKey keyFileName1 = DynamicConfigurationKey
			.create("http://sap.com/xi/XI/System/File", "FileName");
	                inputFileName = conf.get(keyFileName1); 

  *File f1 = new File("/usr/sap/XX/"+keyFileName1);*
  *boolean success = f1.delete();*
  *if (!success){*
  *System.out.println("Deletion failed.");*
  *System.exit(0);*
  *}else{*
  *System.out.println("File deleted.");*
    *}*
  *}*

Former Member
0 Kudos

HI Vankadoath,

IF the file has been picked up it means it not errored file so it is not possible to put file in a diff archive directory .

However you can put a check like that if the file is not picked for 1 min or 2 min then it can be archived in some other directory say Error Archive directory . IF suppose a file with wrong name/wrong source format came which you adapter is not able to pick so you can write a script that if file is not picked by adapter in 2 min then put it to a Error archive directory. That script can be called in OS command of sender communication channel .

Regards,

Saurabh

Former Member
0 Kudos

Hi Vankadoath

That option is used in case file adapter throws errors while procesithat file (content conversion or module processing).

It's not used to archive messages in error during mapping.

What kind of errors are your wrong data files throwing?

Regards,

Giuseppe

former_member854360
Active Contributor
0 Kudos

Hi once files have picked up by the channel and transfered to intregartion engine then it will be archived into success folder only.

Because error is in IE means Mapping not in adapter level

Former Member
0 Kudos

HI Debashish,

Thanks for your reply.

i understand that the files will not archived which are failed due to the reasons of mapping errors or others.

Because error is in IE means Mapping not in adapter level.

Files which are not picked by the adapeters are sucessfully moved to error archive folder. its working great. but i need to move the files which are mapping errors files to error archive folder.

Is there any way to pick those files (Mapping error fies) from the success archive folder and again move to the error archive folder.

how to approach this requirement. Thanks

Vankadoath

Former Member
0 Kudos

Hi,

We have only one archive parameter in sender file adapter. By using that you can archive one type of files it coud be either error files or picked files. Do one thing use adapeter archive parameter for archiving fetched files and use UDF for archiving errored files.

Regards,

Raju