cancel
Showing results for 
Search instead for 
Did you mean: 

The same filename from a sender to a receiver file adapter - SP14

Former Member
0 Kudos

Hi Expers,

I Have Gone through the link which is given bu Michal.

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

Here My Questions are.........

1.Should we give any file name in the receiver side Adapter in this scenario.?????

2.How wil be the Sender and Receiver Communication channel Parameters????

What Are they???????

Please Clarify me...

Regards

Khanna

Accepted Solutions (1)

Accepted Solutions (1)

bhavesh_kantilal
Active Contributor
0 Kudos

> 1.Should we give any file name in the receiver side

> Adapter in this scenario.?????

Yes. Give some dummy filename. This will be replaced by the source filename in the runtime.

> 2.How wil be the Sender and Receiver Communication

> channel Parameters????

> What Are they???????

In sender and receiver file adapters --> Select Adapter Specific Attributes --> File Name.

Regards

Bhavesh

PS: There have been multiple thread raised by you. People on SDN contribute to help people and the SDN way of thanking people is by awarding points. If you find any answer that helps you please award points as that is the true spirit of a true SDN'er. Close all your earlier threads and awar points to all those people to take time to read and help you solve your problem.

Answers (4)

Answers (4)

Former Member
0 Kudos

ANS

Former Member
0 Kudos

Hi Rajesh,

Is your query related to sending the file name from the source xml document to the reciever file adapter. If so this can be achieved.

Pls. do the following.

1. In the mapping program that you are using populate the filename coming from the source into the target root element.

2.Sender adapters can write adapter-specific attributes to the message header; these can then be evaluated at configuration time

3. To change the adapter-specific attributes of the message header by using message mappings, you access the required classes of the mapping API by using a mapping runtime constant.

<b>Note: You donot need to specify any filename in the receiver communication channel.</b>

To access the classes DynamicConfiguration and DynamicConfigurationKey by using the mapping runtime constant DYNAMIC_CONFIGURATION, use the method getTransformationParameters() of the container object.

Create an simple user defined function in the mapping and use the following code.

Imports: com.sap.aii.mapping.api.*;

Parameter: String filename

Paramter: String filename;

filename = fileName + ".DAT";

DynamicConfiguration conf = (DynamicConfiguration) container

.getTransformationParameters()

.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

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

conf.put(key, filename);

return filename;

You donot need to hard code the value of the filename in the file adapter for your interface.

In SXMB_MONI, when you see the pipeline services you would see that the value of the filename is populated in the message payload.

Thanks

Indranil

prabhu_s2
Active Contributor
0 Kudos

<b>1.Should we give any file name in the receiver side Adapter in this scenario.?????</b>

any name u give it will be taken from the message

<b>2.How wil be the Sender and Receiver Communication channel Parameters????

What Are they???????</b>

same entries as the what u give before for sender/recv CC

Former Member
0 Kudos

Hi ,

How to use this User Defined Function In Mapping.

Please Explain me

Regards

Khanna

Former Member
0 Kudos

No need to create any UDF in this case.If you want the file name in the mapping aslo,You have to write a user defined Function as specified in the blog.

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

The blog by Michal uses the User Defined Function to read the source filename and use it in some field in the target message.

In your case as you do just need to have the same source filename ad the target filename, then all you need to do is,

1. Select the Adapeter Specific Identifiers --> Filename in the sender file adapter and receiver file adapter.

2. In the receiver file adapter select filename.

This is all that is needed to send the source filename to the target filename.

If the filename is to be copied to some source field, then do the UDF, else no need for the udf.

Regards

Bhavesh

prabhu_s2
Active Contributor
0 Kudos

u need to create a UDF in message mapping ...for ref check this:

http://help.sap.com/saphelp_nw04/helpdata/en/d9/718e40496f6f1de10000000a1550b0/content.htm

Former Member
0 Kudos

Hi Bhavesh,

Here I wil Explain my doubt.......

<b>If i want to get the sender file name as the receiver file name in the destination....

what i need to do in the Mapping by using the UDF presented by Michal.

Which field i need to mapp to UDF..

How wil be the Mapping Source and target message structures</b>

Iam Working on the same Blog Which is given by Michal....

Regards

Khanna

Former Member
0 Kudos

HI,

In mapping create the UDF as michal said and map the left side root node to the right side root node.By using the UDF , we can get the source side filename into the payload and assign to the target side file name , this is to be configured in receiver CC, by selecting the Adapter specific message attributes -- select the File name check box.

Regards

Chilla

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

You do not need the UDF as shown in the blog by Michal.

Just follow my instructions in my previous reply to copy the source file name to the target side.

The actual mapping will be between your source and target structures.

Regards

Bhavesh

Former Member
0 Kudos

HI,

I hope we need to use the UDF to get the source file name into payload and to assign to target which will be cinfigured in recv CC,this is what Michal was expalined in his blog..

Regards

Chilla

Former Member
0 Kudos

Hi Bhavesh,

Thanks for ur Reply.....

Now My doubt is clear.

As u told If i want to get the source file name as it is in the receiver side means

I should follow the <b>Adapter Specific Message Properties</b>---->>><b>File name</b>. In both the sender and the Receiver Adapters

Its Fine in this case.

If i want to implement the Blog given By Michal means How i Should follow

How wil be the mapping in the Source and Target side.

To Which Filed I Should mapp this UDF in the mapping.....

<b>And what is the Exctaly Purpose of this Blog </b>

Please Explain me in Detail.

Regards

Khanna

Former Member
0 Kudos

Hi,

In mapping create the UDF as michal said and map the left side root node to the right side root node.

Because we also want to get the filename inside our mapping we have to create a user defined function

which will return the filename and map it to one of our XML tags

Regards

Chilla

former_member335553
Active Contributor
0 Kudos

Hi

1. The file name would be the one that is mentioned in the UDF in message mapping .

2. other parameters remain the same in communication channel parameters except for the activation of the adapter specific message attributes and the related terms under that like file / directory.......