cancel
Showing results for 
Search instead for 
Did you mean: 

File deliverable concern in FTP

Former Member
0 Kudos

Hi All,

We have a scenario where we sending the files to FTP with comma delimeted.

Now requirement saying that : There is a another file (called .cksum) should write no.of records , filesize, filename in 2nd file based onfirst file(File1.txt) records.

Ex :

The Checksum file contains number of records, file size and the file name .

The checksum file for file2.cksum contains the following information

1425702217 387293337 File1.txt

Please share your ideas on this , how do we achieve this 2nd file with that information.

Thanks,

Shankar

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

To achieve this you have to do multimapping and then use Dynamic configuration.

Regards,

Sarvesh

Former Member
0 Kudos

Hi Sarvesh,

>>To achieve this you have to do multimapping and then use Dynamic configuration.

its nice idea , but in small confusion achieve this, can you elaborate some steps? for multimapping..

Thanks for your time.

Shankar

Former Member
0 Kudos

> >>To achieve this you have to do multimapping and then use Dynamic configuration.

>

> its nice idea , but in small confusion achieve this, can you elaborate some steps? for multimapping..

For multimapping steps use this blog... /people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible

Now, since you already have the data type for your csv structure, so now just create the data type for checksumfile.

The data type for checkusm should be made with just one field (as per your example given for checksum values) and then use Dynamic Configuration to get the FileNmae & Filesize. For counting the records just simply use count function and count all records (use RemoveContext).

Here is the Dynamic Configuration code for FileName & size..

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION); 

DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","SourceFileSize"); 

DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName"); 

String fileSize = conf.get(key); 

String fileName = conf.get(key1); 

String output = fileSize + "" + fileName; 

return output;

After counting the records just concatenate it with the output of the above udf and pass it to the target of your second mapping structure..

Rest of the steps you can see in above blog..

Regards,

Sarvesh

Former Member
0 Kudos

Hi Sarvesh,

>>Now, since you already have the data type for your csv structure, so now just create the data type for checksumfile.

>>The data type for checkusm should be made with just one field (as per your example given for checksum values) and then >>use Dynamic Configuration to get the FileNmae & Filesize. For counting the records just simply use count function and count all >>records (use RemoveContext).

here some confusion for map the source to target : my multimapping structure is like this:

target side structure :

<Messge>

--<Mesage1>

-


<Root(0:U)>

-


<Field1>

-


<Fileld2>

--<Message2>

-


<Checksum (0:U)>

-


<data>

Is this right structiure? When I test this I am able to generate 2 files, but confusion here where should i map my count funtion+ filesize+filetype?

- Shankar

Former Member
0 Kudos

> here some confusion for map the source to target : my multimapping structure is like this:

>

> target side structure :

>

> <Messge>

> --<Mesage1>

> -


<Root(0:U)>

> -


<Field1>

> -


<Fileld2>

> --<Message2>

> -


<Checksum (0:U)>

> -


<data>

>

> Is this right structiure? When I test this I am able to generate 2 files, but confusion here where should i map my count funtion+ filesize+filetype?

>

The structure looks ok. No need to make "Checksum" as 0:U. Just 0:1 will be ok.

You need to map count funtion+ filesize+filetype to "DATA" field. I couldn't understand what kind of problem you are facing? Because it is just simple.

For better understanding & explanation you can attach the screen shot of your mapping (if you still feel some confusion).

Former Member
0 Kudos

thanks sarveh ..got solved.

Answers (1)

Answers (1)

0 Kudos

Goto Advanced Tab and invoke Adapeter specific attributes and choose message size checkbox for message size and etc., fiedls.

there is a script option. Under processing tab you have commandline option. You can use this option and put some script which does your checksum activity.

Regards

chandra

Former Member
0 Kudos

Goto Advanced Tab and invoke Adapeter specific attributes and choose message size checkbox for message size and etc., fiedls.

there is a script option. Under processing tab you have commandline option. You can use this option and put some script which does your checksum activity.

I chaeked filiesize in adavanced selection , but how to write this filesize in other file?

command line option can use to achieve this, but i dont want do that..because script should placed in some folder and it is not recommended here..

Shankar

Former Member
0 Kudos

One more thing... Don't forget to set the ASMA settings in Sender Adapter under advanced tab.

Former Member
0 Kudos

Hi Sarveh,

Still I have a confusion , but thinking that I am almost achieved this after looking yoru replies, let me try and get back to you.

Thanks again..

Shankar