cancel
Showing results for 
Search instead for 
Did you mean: 

File to File multiple scenario without mapping

Former Member
0 Kudos

Hi

I am doing one simple file to file scenario without mapping i.e picking file from sender directory and then placing it in receiver directory via FTP.

Now i have to take two files from different directories and place them in to different directories in the receiver side.

On the sender side i have selected Advanced selection for source file and maintained the sceond directory name and filename.

now i am not aware about the reciver side that how to place the two files in to different directories.

I have to make only one interface for this.

Thanks in advance.

Accepted Solutions (0)

Answers (4)

Answers (4)

rajasekhar_reddy14
Active Contributor
0 Kudos

split your requirement in to two different scenarios, very simple and effective, anyway no mapping involved .

Former Member
0 Kudos

Hi Raj,

I have to create only one scenario for this...

Former Member
0 Kudos

Hi Amit,

Is there any other method as it is not well understood.

can we do something using variable subsitution in receiver CC.

Thanks!!

Former Member
0 Kudos

Hi,

As amit told you above please go with adapter module...variable sustitution used for create target file based on the payload element name and message header attributes...because you want place file different location in target side.

regards,

ganesh.

Former Member
0 Kudos

>> I am doing one simple file to file scenario without mapping

AFAIK..without mapping its not possible...

Former Member
0 Kudos

Hi Amit,

So creating one customized Adapter Module is the only option...

Former Member
0 Kudos

Hi Amit,

can you provide me with the code for creating Custom adapter module......

Thanks in Advance...

Former Member
0 Kudos

u have to follow the code in the link provided above but with some manipulations...

in case u r placing the files in different target dir depending upon the source directory then ur code will be something like this:

Note: i dont have a system as of now..so cant able to check the code for syntax errors..please cross check it


MessagePropertyKey mpk = new MessagePropertyKey("Directory","http://sap.com/xi/XI/System/File");
String SourceDir = msg.getMessageProperty(mpk);

if(SourceDir.equals("/SourceDirectory1"))
{
String targetDir1 = "/TargetDirectory1"
msg.setMessageProperty("http://sap.com/xi/XI/System/File","Directory",targetDir1);
}
else if(SourceDir.equals("/SourceDirectory2"))
{
String targetDir1 = "/TargetDirectory2"
msg.setMessageProperty("http://sap.com/xi/XI/System/File","Directory",targetDir2);
}
else
{

}

http://help.sap.com/javadocs/pi/SP3/xpi/com/sap/engine/interfaces/messaging/api/Message.html#getMess...

lIbraries for adapter module development:

http://wiki.sdn.sap.com/wiki/display/XI/Where%20to%20get%20the%20libraries%20for%20XI%20development

How to develop adapter module:

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c0b39e65-981e-2b10-1c9c-fc3f8e674...

Former Member
0 Kudos

Hi Amit,

Can you please explain this in more detail.

How and where to deploy this code??

Is this the complete code..and any other method is not possible????

Thank you in advance....

Former Member
0 Kudos

>>How and where to deploy this code??

install NWDS and code ur logic...once done u have to deploy this code on ur PI server

refer this article (already provided u):

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c0b39e65-981e-2b10-1c9c-fc3f8e674...

>>any other method is not possible

Try to do like this::

create 2 bussiness components

1 Sender agreement

1 Receiver determination -> depending upon the source directory name define ur routing condition..select Context Object "Directory" and then chosse ur bussines components

for ex ur XPATH will be:

Directory = /folder1 -> Receiver 1

Directory = /folder2 -> Receiver2

2 Interface determintaion

2 Receiver agreement

Select ASMA (FileName, Directory) in sender Channel

Select ASMA(FileName) in receiver channels

Former Member
0 Kudos

hi Amit,

Can you please tell me how to set the Xpath.

I have checked context type and selected directory

Then i checked on Xpath and written like Directory = /folder -> rec1

Then i added another row and done the same for reciver2.

Operand is AND between the two rows and Right operand is empty

When i excecute it is showing exception in moni that unable to excecute condition

Please tell me hw to set the xpath.

Thanks!!

Former Member
0 Kudos

>>Operand is AND between the two rows and Right operand is empty

dont use "and" operand

give two separate conditions under ur Receiver determination (use Insert Condition)

Directory = /folder1 -> rec1

Directory = /folder2 -> rec2

Former Member
0 Kudos

Hi Anit,

I applied your approach.

Files getting picked up from sender but in moni error is coming:

RCVR_DETERMINATION">NO_RECEIVER_CASE_ASYNC

No receiver could be determined.

Thanks!!

Former Member
0 Kudos

>>RCVR_DETERMINATION">NO_RECEIVER_CASE_ASYNC

the conditions is not getting satifiesd......chk ur conditions in RD..i guess u r not maintainig it correctly

Former Member
0 Kudos

u can go for adapter module...in the module depending upon the file name (or source directory) u can define the target directory...

chk this wiki (tweak the code as per requirement)

http://wiki.sdn.sap.com/wiki/display/Snippets/DynamicfilenameinaFiletoFilepassthroughscenario

Former Member
0 Kudos

Hi,

please go through below blog,

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

regards,

ganesh.

Former Member
0 Kudos

Hi ganesh,

I want to place the picked up files into two different directories not in same directory.

For this what i have to use please explain.

Regards!!