on 01-26-2016 12:19 PM
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
Hi Chet,
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;
}
Mapping for dynFileName variable
Regards,
Praveen.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
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
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 :
Br,
Manoj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
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?
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
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.