cancel
Showing results for 
Search instead for 
Did you mean: 

Using adapter specific parameters in a multiple receiver scenario.

Former Member
0 Kudos

Hi all,

I have a scenario in which I am sending a binary file from one folder to another using a file sender and file receiver adapter.

But, I have another file receiver to this message which expects the filename of the above binary file in the form of an XML file.

I want to know is this possible to receive an adapter specific value in the form of XML when we havent sent any xml from source side?

Please reply.

Sumit

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi all,

Thanks for showing the interest.

The Structure of my source message is:

Message -:

Binary File - of type 64basebinary 1:1

Filename - of type String 0:1 (as it will be empty initially)

Target Message 1 -:

Binary File - of type 64basebinary 1:1

Target Message 2 -:

FileName - of type String 1:1

I have two mappings

Mapping 1-:

Source - Binary to target 1 Binary File

Mapping 2-:

Source-FileName to Tarfet 2 Filename.

When i activate the chages the Binary file reaches the destination.

But, I am not getting any target 2 message.

All channels are working fine.

Please Help

Sumit

justin_santhanam
Active Contributor
0 Kudos

Sumit,

I configured the scenario ,as per your requirement. Kindly have a look at the below URL and reply back, if you have any issues on that.

http://sapient.xi.googlepages.com/xi-excellentintegration

Best regards,

raj.

Former Member
0 Kudos

Good one Raj,just a small question,is it possible to do this in a bypass manner and check the adapter specific message attributes.

i can give filename as . and use ASMA,won't that make sure that the any files is picked up and delivered with the same name as sender?

keep up the good work

thanx

Ahmad

justin_santhanam
Active Contributor
0 Kudos

Ahmad,

Thanks a lot for your valuable support. I couldn't get the question can u please describe more?

<i>i can give filename as . and use ASMA,won't that make sure that the any files is picked up and delivered with the same name as sender?</i>

Best regards,

raj.

Former Member
0 Kudos

don't worry:)

i actually didn't read the first question,i thought he just wants to send any file and receive it with the same name,didn't notice he wants to have an XML too on the receiver side alongwith it.

thanx

Ahmad

Former Member
0 Kudos

Raj,

I am very thankful to you for your excelent reply. I have followed that and have done that scenario but I am getting the binary file at both receivers not the

"METADATA.XML"

Please tell me the possible mistake.

I have awarded you 6 points for now.

Thanks

Sumit

justin_santhanam
Active Contributor
0 Kudos

Sumit,

For the receiver which will be recieving Metadata.xml - do mapping and check for comm channel whether u have given Metadata.xml and not * . Please ensure and kindly reply back.

Best regards,

raj.

Former Member
0 Kudos

Hi Raj,

Excellent work!!!!.

Regards,

Ram

Former Member
0 Kudos

One question.

What do you want to have in the METADATA.XML file?

1. Any valid XML data (but what is the use of this?) - If so, just create a mapping with all constants filling it and pass it to receiver.

2. Some XML based on input .tiff file - If so, then use a Java mapping and populate the target msg and pass it to receiver.

Regards,

Jai Shankar

justin_santhanam
Active Contributor
0 Kudos

Thanks Ram!!!!

Best regards,

raj.

Former Member
0 Kudos

Raj,

I am getting the following error when I look into the SXMB_MONI for XML receiver.

<b><?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

- <!-- Request Message Mapping

-->

- <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">

<SAP:Category>Application</SAP:Category>

<SAP:Code area="MAPPING">EXCEPTION_DURING_EXECUTE</SAP:Code>

<SAP:P1>com/sap/xi/tf/_MM_Invoice_to_Name_</SAP:P1>

<SAP:P2>java.lang.NullPointerException</SAP:P2>

<SAP:P3 />

<SAP:P4 />

<SAP:AdditionalText />

<SAP:ApplicationFaultMessage namespace="" />

<SAP:Stack>During the application mapping com/sap/xi/tf/_MM_Invoice_to_Name_ a java.lang.NullPointerException was thrown:</SAP:Stack>

<SAP:Retry>M</SAP:Retry>

</SAP:Error></b></b>

Answers (7)

Answers (7)

Former Member
0 Kudos

Hi Raj,

I just want to enquire one thing. We have mentioned

file name = *

But if I use FTP it doesnt work.

Is there a way to make . work with FTP.

Please reply.

Sumit

Former Member
0 Kudos

Raj,

Thanks a lot man.

There was some internal problem in my scenario.

I have changed the ponts to 10.

Sumit

Former Member
0 Kudos

Hi Raj,

I am sending the .tiff file. Paste???

Sumit

justin_santhanam
Active Contributor
0 Kudos

Sumit,

I'm really sorry, if I misunderstoo ur scenario. Basically u are receiving Tiff(Image file) do u want the file to convert into XML ? Can u please be little bit more specific.

<b> just want the name of the binary file sent to be passed through the second(non-binary) file receiver as a XML file</b>

The above line is little bit confusing.

Best regards,

raj.

Former Member
0 Kudos

Raj,

Thanks for taking interest!

I have two file receiver aadapters.

One is receiving the plain binary file.

Other is also a file receiver adapter which is configured to receive a text file(

File Name scheme: xi_meta.xml

This file is supposed to contain the Name of the "Binary File" as a field.

If the scenario is still not clear. I am ready to explain again :).

Sumit

Former Member
0 Kudos

you need to write a UDF and use mapping based message split.

Here is the link for mapping based message split:

/people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible

Here is the code for UDF:

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

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

String FName = conf.get(key);

return FName;

Hope this helps,

Regards,

Ravi

justin_santhanam
Active Contributor
0 Kudos

Sumit,

I got ur sceario.

I'm sure u have designed the data type for the target file am I right.

Let say it looks like

DT_Filename

File 1..1

Filename 1..1

U might have created the message type for the same.

Please create the message mapping with the source and target as same(above structure).

Now create simple UDF with no input.

DynamicConfiguration conf = (DynamicConfiguration) container

.getTransformationParameters()

.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION );

DynamicConfigurationKey key = DynamicConfigurationKey.create(

"http://sap.com/xi/XI/System/File","FileName");

String name = conf.get(key);

return ""name"";

UDF mapping

UDF --> Filename[Target node, as per my data type designed above]

Hope it helps!!!

If not kindly revert back.

Best regards,

raj.

Former Member
0 Kudos

Hi All,

Thanks for your replies.

I guess i have to explain the scenario again .

I do not want the XML file at the receiver to be of same name.

I just want the name of the binary file sent to be passed through the second(non-binary) file receiver as a XML file.

I have used the DynamicConfiguration in UDF but I am not getting any XML as output in this scenario.

Please help me.

Sumit

justin_santhanam
Active Contributor
0 Kudos

Sumit,

Can u paste the sample binary file.

best regards,

raj.

Former Member
0 Kudos

Hi

you just need to mark the following checkboxes

Adapter Specific message attributes (SetAdapter Specific message attributes )

and

File Name

in both sender and receiver file adapter.

So, it gets the file name and creates the file with the same name.

no UDF reqd:)

Regards

Pushkar

Message was edited by:

Pushkar Anand

Former Member
0 Kudos

hi,

yes,you can do it with Dynamic Configuration in mapping.Using this in UDF you can map your File Name to some field and then use it at receiver side communication channel as a variable.

      • Dont forget to give reward points.****

Thanks & Regards,

Akshay.

justin_santhanam
Active Contributor
0 Kudos

Sumit,

Please correct me if I uderstood your scenario wrong. In source you have some file which is not XML , but in the receiver side you want the file with XML with same file name as source. Am I right? If not can u please clarify the scenario,please.

Best regards,

raj.