cancel
Showing results for 
Search instead for 
Did you mean: 

ECC Proxy to third party- file scenario - two operations

0 Kudos

HI all

I have a scenario wherein there are two operations on service interface from ECC and i need to send two different files to third party

I have created one service interface(with two operations) on sender and receiver.

Please could you advise on configuration side steps and dynamic configuration so that the files coming from ECC are routed to correct folders and with correct file names

The destination folders/filenames are

/TransactionType/From_SAP/ClosingBalance<with time stamp>.csv

/ClosingBalance/From_SAP/TransactionType<with time stamp>.csv

Many Thanks for your help

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member182412
Active Contributor
0 Kudos

Hi Chet,

  • Create sender and Receiver interfaces with two operations.
  • Create two mappings and two operation mappings
  • Receiver Determination you can give like below.

  • Interface Determination give like below, select two operation mappings for two operations

  • Dynamic Configuration UDF.


public String setDynamicConfigurationKey(String namespace, String name, String value, Container container) throws StreamTransformationException{

try{

DynamicConfiguration dynConf = (DynamicConfiguration) container.getTransformationParameters().get(

                StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create(namespace, name);

dynConf.put(key, value);

}catch(Exception e){

       return value;

}

return value;

}

  • Create two variables in the target message called dynFileName and dynDirectory.

        Mapping for dynFileName variable

  • Mapping for dynDirectory also same like above but the name is Directory insteaf of FileName.
  • Create one file receiver channel and maintain target directory as %Directory%, FileNameScheme as %FileName%
  • Make sure enable adapter specific message attributes and enable File Name and Directory.

Regards,

Praveen.

0 Kudos

Hi Praveen

Many Thanks for detailing steps, few things to clarify

Just so as we are on same page what i need is UDF for filename
and directory, if the operation is TransactionType i want the folder/ filename
to be generated as

/TransactionType/From_SAP/TransactionType<with timestamp>.csv

And if the operation is ClosingBalance , folder/filename as

/ClosingBalance/From_SAP/ClosingBalance<with timestamp>.csv

Where will these filename and folder name will appear in UDF
– am i missing something?

As  i  have two source and destination data  types- TransactionType and ClosingBalance

  1. The udf is to be created in both?(is myunderstanding correct)
  2. and
    i am not clear by your statement  “Create two variables in the target message
    called dynFileName and dynDirectory” do you mean to create to more fields on
    destination data types with names
    dynFileName and
    dynDirectory
  3. What will be the values  for Mapping for dynDirectory variable – namespace
    will be same as for filename  and name
    will be “Directory”?
manoj_khavatkopp
Active Contributor
0 Kudos

Hi chet,

Udf helps to identify the receiver channel to put file in particular folder at runtime or other option maintain 2 different channels then in directory maintain your folder name in each one in this case their is no need of udf.

Br,

Manoj

former_member182412
Active Contributor
0 Kudos

Hi CHET,

>>>>Where will these filename and folder name will appear in UDF

You can construct file name or directory as per your requirement by using UDF or using standard functions in message mapping and pass that value to the UDF

>>>>The udf is to be created in both?(is myunderstanding correct)

You can create this UDF under function library and use this function library in both mappings

>>>>i am not clear by your statement  “Create two variables in the target message
called dynFileName and dynDirectory” do you mean to create to more fields on
destination data types with names
dynFileName and
dynDirectory

Create two variables like below, right click on root node and click on add variable

>>>>What will be the values  for Mapping for dynDirectory variable – namespace
will be same as for filename  and name
will be “Directory”?

Regards,

Praveen.

0 Kudos

Thnaks mnoj for clarification , i need UDF as two files coming from going to one channel

0 Kudos

Thank You Praveen for quick repsonse.. i am getting there.:).for my undersatnding.. please could you comment on the following

To keep it simple as of now what i have done is created two UDF's( one for FileName and one for Directory) in each message mapping

/* Using Dynamic Configuration */

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

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

FileName = "TransactionType" +  ".csv";

conf.put(key,FileName);

return FileName;

/* Using Dynamic Configuration */

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

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

DirName = "/TransactionType/";

conf.put(key, "DirName");

return DirName;

So summary is 2 UDF's for each message mapping.

My question is can i assign two UDF's to which node(or i have to create one udf for both directory and filename) , and if i go by this route will there be any change to comm channel values at the moment i am putting "%DIRECTORY%  and "%FILENAME%"

Also last thing can you please suggest/enhance the code for the above udf to add "timestamp" to file name

manoj_khavatkopp
Active Contributor
0 Kudos

Hi Chet,

What is reason for creating 2 operation in service interface ?? any sepcific requirement ?

The configuration part remains same but in interface determination you have to choose operation specific and choose the respective mapping.

For dynamic configuration check the below link :

http://wiki.scn.sap.com/wiki/display/XI/Dynamic+file+name+and+directory+in+Receiver+File+Adapter+-+s...

Br,

Manoj

former_member186851
Active Contributor
0 Kudos

Hello Chet,

Since you have two different flows suggest you to create interfaces which would be more easy to monitor as well.

And for the Dyanmic config you can refer link shared by Manoj.

And for multi operations refer the below link

0 Kudos

Hi Raghu

Yes i have two flows i understand it would be easy , but i would like to do the scenario as mentioned for reason there will be one proxy with two methods

ECC - 1 service interface , 2 operations ( each operation will send one file)

Each operation linked to message type

Third Party - 1 service interface , 2 operations , 2 message mappings/Operation mappings

Please let me know if anything more to be done on ESR

Please correct me if i am wrong on ID there will be one comm channel, one interface determination, on agreement and one reciver determination...

and how can i based on operation build the folder and filname ?


cheers

former_member182412
Active Contributor
0 Kudos

Hi Chet,

You need to create two separate receiver interfaces for each operation in IR.

As Manoj already mentioned above you need to mention two separate mappings for two operations in Receiver Interfaces tab in ICO or Interface Determination.

And maintain two separate channels for two separate receiver interfaces.

Regards,

Praveen.

0 Kudos

hi praveen

Just to clarify will there be one reciever interface with two operations or two seperate reciever interfaces?

cheers

chet

former_member182412
Active Contributor
0 Kudos

Hi Chet,

Yes you can use one receiver service interface with two operations. You have two separate mappings for each operation you can determine dynamic directory in each mapping separately and create one File receiver channel.

Regards,

Praveen.

0 Kudos

Hi parveen

many thanks fo clarifing that so till now the solution for ESR is

ECC - 1 service interface , 2 operations ( each operation will send one file)

Each operation linked to message type

Third Party - 1 service interface , 2 operations , 2 message mappings,  2Operation mappings

so other thing is dynamic directory and file name in mapping- if this is correct please can you provide some code for dyamic mapping for directory and file

also if we follow this design...

Please correct me if i am wrong, On ID there will be one comm channel, one interface determination, on agreement and one reciver determination...

if this is correct please advise what will values will appear in "target directory" and "file name" in comm channel

also will "reciver determination" will be "operation specfic" if yes what will be condtion if any- can it be file name etc..

Also one last thing if i go by other recommndation "to create two separate receiver interfaces for each operation in IR" , how can i link one "sender interface with two operations" to "two reciever interfaces" please?

0 Kudos

Hi Praveen

Just missed one point from your above mail

I have one mapping for each operation and not two

so to clarify

ECC sender - 1 sender interface, 2 operations

Third party reciver - 1 reciver interface , 2 operations, each operation have one mapping each for message and operation

cheers

former_member182412
Active Contributor
0 Kudos

Hi Chet,

What is your condition for dynamic directory and file name??

Regards,

Praveen.

0 Kudos

Based on operation it should fo to different folder with differnt file name

So if i have two operations from sender (and reason for sender have two operationsis there will be two methods in each same proxy) rather than two proxies

Two Operations

TransactionType

ClosingBalance

The folders are

/TransactionType/From_SAP/

/ClosingBalance/From_SAP/

where the files should go and the file names are

TransactionType<with time stamp>.csv

ClosingBalance<with time stamp>.csv

so complete paths are

/TransactionType/From_SAP/TransactionType<with time stamp>.csv

/ClosingBalance/From_SAP/ClosingBalance<with time stamp>.csv

PS: the data type for each operation is different- so in simple terms i am trying to get two files (as operations) from ECC in one proxy and want to send in different folders and have differnt file names