cancel
Showing results for 
Search instead for 
Did you mean: 

Reading severl files in file adapter sender

Naama
Participant
0 Kudos

Hi all,

I need to read several files and perform checks on there attributes,

like name and date of creation.

and only if the checks are o.k i need to transfer them to, otherwise i need to send an email reporting the error.

I saw in the sender file adapter an option of reading several files, how does it work, how can i perform the checks.

I thing that i can also perform this task using BPM, but from whet I understand it can be problematic when reading big files.

Thanks,

Naama

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

You can refer to below link

http://saptechnical.com/Tutorials/XI/Fileadapter/page1.htm

Gaurav Jain

santhosh_kumarv
Active Contributor
0 Kudos

>>I need to read several files and

Give the source file name in the file adapter as

*.*.

>>perform checks on there attributes, like name and date of creation.

Check the option Adapter-Specific Message Attribute in the sender file adapter.

>>and only if the checks are o.k i need to transfer them to, otherwise i need to send an email reporting the error.

Have a look at my article which addresses a similar requirement..

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a08e8c15-682d-2b10-7798-c4592a41...

Thanks

SaNv...

Former Member
0 Kudos

Hi,

What u mean by several file --> Is it from different Folder .

Well File Adapter can read Files and it polls periodically based on u r polling time.

To read it's attributes use the Advance Option and check mark on the Filename and time stamp.

rthis can be captured by u r dynamic config and used for further verification

rgds

srini

Naama
Participant
0 Kudos

thanks,

the files are in the same folder,

and where do i perform the checks?

santhosh_kumarv
Active Contributor
0 Kudos

>>and where do i perform the checks?

Read the file.... validate the filename and the date using a java mapping....

Thanks

SaNv...

Naama
Participant
0 Kudos

can you pleas explain more,

how in the mapping i perform the checks on all the files?

how will the mapping look like? how will the message tyoe look like?

santhosh_kumarv
Active Contributor
0 Kudos

Hi,

>>can you pleas explain more,

Read the article.. It has the procedre in detail..

>>how in the mapping i perform the checks on all the files?

Read the file name using the Dynamic Configuration and perform the check against the file name as per your requirement....

>>how will the message tyoe look like?

Design your Data type as like your source file structure in additon add one more element i.e. status that will be used by the java mapping to set the validation result.

Thanks

SaNv...

Naama
Participant
0 Kudos

but in the example there is only one file,

how the fact that i have to check several files effect the contructing?

santhosh_kumarv
Active Contributor
0 Kudos

The same validation will be performed on all the files....

What exactly do u mean as several files....

multiple files of same structure and type(*.txt) or

files with multiple structure and multiple types(.)....

Thanks

SaNv...

Naama
Participant
0 Kudos

every file has a different structure, but the same type.

i see in the example that you are using BPM, i heared that BPM can be problematic with big files, is it true? the sum of the size of the files can be up to 250 MB.

Former Member
0 Kudos

Naama,

You can check the file name but not the file creation date with in XI. What exactly are the parameters you want to check?

Why do you want to process multiple files in a single message? This could be very complex development in XI.

Naama
Participant
0 Kudos

Thanks,

i need to check the name and the creation date, and the number of files (the interface should work only if ther are 4 files in the directory)

there is in the file adapter an option of reading several files and there is an option of using more attributes like source file time stamp (maybe its the creation date?)

I need to tranfer the files data to sap only if the checks on the name and date and the number is correct.

do you knwo if BPM will work here, even if the total size of the file can be up to 250MB?

Former Member
0 Kudos

>>there is in the file adapter an option of reading several files

Only one file will be picked as payload and others will be part of Attachments in the SOAP message.

>>there is an option of using more attributes like source file time stamp (maybe its the creation date?)

Correct. Again. You can select one of the option at a time. This will select files one at a time. For handling multiple files you need to use "Advanced selection" which will add the files as attachments.

>>do you knwo if BPM will work here, even if the total size of the file can be up to 250MB?

Even with out a BPM, this size will be a problem.

Naama
Participant
0 Kudos

Thanks,

and when the files are as an attachment can i check ther properties in the message mapping? how will it look like?

Do you have a suggestion how to solve the problem regarding the size issue?

Former Member
0 Kudos

>>and when the files are as an attachment can i check ther properties in the message mapping?

Nope. You dont have access to attachments in Mapping. You need to handle this with in adapter modules.

Is it not possible that you pick one file at a time and process?

Naama
Participant
0 Kudos

what does it mean handle in adapter modules?

no I cant process them one at a time , the file should not be proccess if the checks faild

Former Member
0 Kudos

You are going to use FTP or NFS ?

Thanks

Farooq

Naama
Participant
0 Kudos

NFS

Former Member
0 Kudos

>>NFS

You are going to pick the files of same types or different types?

If it is of same type: Use below informtion.

file.sourceFileName=<filename>

Specify the name of the file that you want to process.

The name can contain a placeholder (*) at any point, so as to be able to select a list of files for processing.

The following are valid examples for filename:

myFile.txt

my*.txt

*.txt

[Read Multiple Files from File Adapter.|http://help.sap.com/saphelp_nw04/helpdata/en/0d/00453c91f37151e10000000a11402f/frameset.htm]

Names that comprise more than two parts are also permitted.

If the files are of different types the use this approach:

Thanks

Farooq.