cancel
Showing results for 
Search instead for 
Did you mean: 

Correlation using file name

Former Member
0 Kudos

Hi all

i have a scenario where I have to place a file at target with a particular file name, say, my_name_is_itisha.txt .After the target processes the file,it places an acknowledgement file with the name my_name_is_itisha_txt.ack.

In short, the ack file will replace the '.' with '_' and append '.ack' to the file placed by me at the target.

I know that we can correlate 2 files with similar fields but how to correlate 2 files with the same name ?

Please suggest a solution.

Edited by: itisha alok on Apr 28, 2009 1:39 PM

Edited by: itisha alok on Apr 28, 2009 1:40 PM

Edited by: itisha alok on Apr 28, 2009 1:40 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

abhisek

can you please tell me how to get the filename in the mapping?

i fail to understand the precise steps involved.

i have gone through the followign link:[]

However, i need more detailed explanation.

if possible can you tell me the step by step implementation?

former_member750652
Contributor
0 Kudos

Hi Ishita,

Please refer Step3 in the following blog to get file name dynamically in message mapping.

/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14

You need to define one more field in the target side, create UDF and write the standard code which gets the file name as mentioned in the blog.Map that to the newly created additional terget side field.So u have the file name available.You can do any manipulation you want to the file name inside the UDF it self.

Thanks,

Ram.

Former Member
0 Kudos

In ID sender communication channel

check the checkboxes for

setadapter- specific message attributes

filename

in message mapping---- create one target elemt for the filename

Write a UDF to pass the sender filename to the target element

The UDF is as below

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

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

String ourSourceFileName = conf.get(key);

return ourSourceFileName;

I think this may help you.

Srinivas

former_member200962
Active Contributor
0 Kudos

Hi,

Sorry for the late response....

can you please tell me how to get the filename in the mapping?

This is achieved by writing a UDF in the corresponding Message Maping.....this udf will do the function of extracting the filename during runtime....the UDF is already provided by Srini....even you can search SDN for Dynamic FileName and you will get lot many threads....you need to use Adapter Specific Message Attributes (ASMA) for this purpose.

The UDF need not have any arguments/ parameters.....as it does not need any input from any of the Source nodes.....it will extract the information (filename) from the message header....

For more info: http://help.sap.com/saphelp_nw70/helpdata/EN/43/03612cdecc6e76e10000000a422035/frameset.htm

Regards,

Abhishek.

Answers (2)

Answers (2)

former_member200962
Active Contributor
0 Kudos
I know that we can correlate 2 files with similar fields but how to correlate 2 files with the same name ?

correlation happens between fields with same value.....

Suppose we have receive a msg with EmpID = 111 and in further processing we need to develop a correlation using EmpID.....then we need to make sure that the further EmpIDs are having value 111...

So as long as the values of the field match correlation happens...if not then the queue gets stuck and we get an error message saying permanent error in BPE processing

So in your case get the filenames in some field before it enters the BPM and see correation happening..

Regards,

Abhishek.

Former Member
0 Kudos

use adapter specific message attribute

for detaile see this

[https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/70c89607-e4d9-2910-7280-f6746e964516]