cancel
Showing results for 
Search instead for 
Did you mean: 

How do I specify the SFTP Receiver Adapter to work with multiple file names?

Former Member
0 Kudos

Hi,

I have the following situation:

  • I have an integration scenario of File to two SFTP Receiver channels.
  • I use one mapping.
  • In this mapping, I use one variable to set one filename, and another variable to set the other filename. Both variables are set using the same namespace.

The situation of both sftp receiver channels:

1.

2.

I want to have a different file name as output from each sftp receiver channel, but the problem is that I get two output files using the same value in FileNameOne. The value of FileNameTwo is ignored.

In the mapping I am using the same namespace in Dynamic Configuration for both variables, but a different name (respectively FileNameOne and FileNameTwo) and of course a different value (which indicates the name of the file).

Am I doing something wrong here?

Accepted Solutions (0)

Answers (6)

Answers (6)

engswee
Active Contributor
0 Kudos

Hi Zakaria

I would have expected your approach to work. This following blog also covers a similar approach.

Can you share screenshot of the Message Attributes section of your message(like below)? Just to check that the attributes are populated correctly with different values during runtime.

Regards

Eng Swee

Former Member
0 Kudos

Hi Eng,

I just did what you asked and checked the attributes. Both attributes are set correctly.

These are the images, I had to scroll down for the second attribute to show:

And now it's working. I did not do anything, except changing the names of the attributes to something else, and then changing it back. Now it works. I'm really baffled on why it works now, and not the other day. Something regarding a cache maybe?

Now I'm doubting on whether I should transport this scenario to a production system, because sometimes it works, and other times it doesn't.

engswee
Active Contributor
0 Kudos

Hi Zakaria

IMHO, I don't find any issues with your design approach. As such, I would also suspect it might be related to cache.

Does it still work only occasionally now?

If you are not convinced yet, I'd suggest you transport the design to the QA environment and perform some more testing there. Alternatively, you can redo another similar scenario (with same mapping logic and same channel settings) to verify.

Regards

Eng Swee

manoj_khavatkopp
Active Contributor
0 Kudos

In Message monitoring can u see the dynamic values in soap envelope ?

bdw how did u handle this in interface determination ? i guess u have created 2 OM using single MM.

Former Member
0 Kudos

Hi Manoj,

Yes, I can see both values in the SOAP envelope. Interface determination is 1 OM with 2 SFTP CC's.

The operational mapping contains a message mapping, and in this mm there are two variables that are used for dynamic configuration (see question)

manoj_khavatkopp
Active Contributor
0 Kudos

Zakaria,

Interface determination is 1 OM with 2 SFTP CC's.


so i guess you have provided 1 OM for 1 inbound interface in Interface determination and for other one you have not provided any OM is that right ?


If the above on is true then please note this cant work,  you need to create 2 OM and use a single MM and assign these 2 OM in Interface determination respectively for both inbound interfaces.


Br,

Manoj

Former Member
0 Kudos

Hi Manoj,

I provided one OM for both inbound interfaces. Both interfaces are using the same OM, and only after the mapping the message gets distributed among the inbound interfaces

former_member186851
Active Contributor
0 Kudos

Hello Zakaria,

As I mentioned earlier and Manoj also suggested,It cant work with single mapping.

Because the same parameters will be passed to both.

Former Member
0 Kudos

True, but why is it not working? I'm specifying one parameter in one CC, and the other parameter in the other CC.

Why is the second communication channel using the value of FileNameOne?

former_member186851
Active Contributor
0 Kudos

But the value is take from mapping code Zakaria.

Former Member
0 Kudos

In the mapping, I specify two attributes FileNameOne, and FileNameTwo. In the mapping, these attributes are filled with a value. Both attributes are passed on to both communication channels. So each communication channel can use the values of both attributes.

The first communication channel can see both values, but I'm specifically assigning the file name to FileNameOne, as you can see in the question.

The second communication channel can also see both values, but I'm specifically assigning the file name to FileNameTwo (also in the question)

So I expect certain behavior, but it seems fixed (see answer to Eng)

iaki_vila
Active Contributor
0 Kudos

Hi Zakaria,

Per Shabarish comment i think there was (is?) not possible to set multiple files names in one shoot with ASMA + dynamic configuration.

You can check this blog and to try with variable substitution and multimapping:

Regards,

Former Member
0 Kudos

Hi Inaki,

Thanks for the help. The thing is, I know how to do it with variable substitution, but that means that the file name will be present in the target message, the message/file that the cliënt receives. My cliënt doesn't want this extra field to be added, and "misusing" current fields is also a nogo

The SFTP Adapter has the option of specifying the file name attribute, but it's not working as expected (which is why this thread)

former_member186851
Active Contributor
0 Kudos

Hello Zakaria,

You need to have 2 mappings I guess,Dono how it will dyanmically assign with the same mapping.

Can you try once using 2 mapping instead of one.

Former Member
0 Kudos

I use two variables in the mapping to execute dynamic configuration:

1.

2.

I am using this UDF:

iaki_vila
Active Contributor
0 Kudos

Hi Zakaria,

Try with the namespace http://sap.com/xi/XI/System/File

(https://scn.sap.com/thread/3178909)

Regards.

Former Member
0 Kudos

I tried that before posting the question. It didn't work

former_member186851
Active Contributor
0 Kudos

Zakaria,

It seems your using the same code logic for both filename.

Is there any difference in file name?

Former Member
0 Kudos

Hi,

I am using the same UDF indeed, and the same namespace (I tried with different namespaces, but still the same result).

The difference is only the name itself. During runtime, dynamic configuration should be holding two variables FileNameOne and FileNameTwo in memory. It should be possible to use these in the communication channels.

So I don't understand why both channels use the value of FileNameOne

former_member186851
Active Contributor
0 Kudos

Zakari try with namespace-

http://sap.com/xi/XI/System

Stil I doubt it will work,Just try once.

Former Member
0 Kudos

Hi Raghuraman,

I just tried it, and I still get the same result.

This problem shouldn't be possible in my case, right?

former_member186851
Active Contributor
0 Kudos

Hello Zakaria,

Did you create 2 keys as well.


Please post ur UDF screenshot.

Former Member
0 Kudos

Hi Raghuraman,

It's becoming a habit seeing you

I just added the UDF

AlexanderApel
Participant
0 Kudos

can you show me your mapping where you set the variables?

Former Member
0 Kudos

I just added a snapshot