on 05-11-2013 2:42 PM
Hi PI Experts,
Requirement : IDOC to 3 Files
The Scenario IDOC is generating 3 files at Target Side.
I had Designed using MultiMapping(IDOC Message) to 3 Messages at Target Side.(IDOC(source) and 3 Messages types at Target Side in Mapping)
In Mapping, I am using RFC look up to Generate an Sequence Number FM and this Seq Number is passed as Input to UDF to generate Target File Name with above Seq No.
EX : Header0001.txt.
Problem : For All 3 Target File are generated with Same FileNames as mentioned below.
HeaderInstructions.txt Instead of Header001.txt
HeaderInstructions.txt instead of Item0001.txt
HeaderInstructions.txt
UDF : The First Message UDF
try {
String filename ="";
DynamicConfiguration conf1 = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key1 = DynamicConfigurationKey.create( "http:/"+"/sap.com/xi/XI/System/File","FileName");
filename = "Header"+Code+".txt"; // Code value from RFC Look up
conf1.put(key1,filename);
return filename;
}
catch(Exception e)
{
String exception = e.toString();
return exception;
}
For the second Message the above same UDF but I am changing the FileName as
filename = "Item"+Code+".txt";
similarly for 3rd File too.
Reason for getting the Same file name for 3 files as per my analysis,
Target Messages are mapped with UDFs and first and second UDF are over written and Output as HeaderInstruction.txt is output for all Files.
Note : For Three Different Operations Mapping - I am able to generate as per my Requirement, but fails with One OP.
Please suggest me on this.
Rgds,
Kumar
Hi kumar,
Refer below link and try
http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=272171407
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kumar,
use variable substitution . refer below
how to use the variable substitution feature of Receiver File adapter to get the Output file name as one of the Field value from payload
Understand that Vendor Number is taken payload (Message)
Configuring the File adapter Communication Channel as below
As part of the Receiver File adapter configuration,
1. Provide the file name scheme as Vendor_ %Var1%.xml where in Var1 is dynamic value taken from the message
2. Then check the Variable substitution in one of the section provided in the communication channel to enable variable substitution. Now insert a line to define Variable name and its reference.
Regards,
Bhavani.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bhavani,
Thanks for your quick Reply, Here the value is not from PI Payload, Input(SeqNO) to UDF is from RFC Lookup and now this is resolved by using AF Module and Variable Substitution in all Receiver Channels
Module Name : "AF_Modules/DynamicConfigurationBean"
Reference Link : http://wiki.sdn.sap.com/wiki/display/XI/Combining+three+different+aspects+of+PI+in+one+shot
Rgds,
Kumar
Hi Kumar,
To be honest, I was a bit confused after going through the link.
You can either work with dynamic configuration or variable substitution. I don't think you need to use both to achieve your requirement. If you are using different operation mappings, you can simply use dynamic configuration. After you have retrieved the sequential value from the RFC (standard function NUMBER_GET_NEXT is available), you simply set the dynamic configuration parameter for file name in mapping and then using ASMA in adapter.
Just a suggestion!
Hope it helps!
Ambrish
Multi mapping design will not work for your req, use individual mapping programs.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You cannot use dynamic configuration for multimapping. Use Variable substitution. Please search scn for doing variable substitution.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Dynamic configuration does not work in case of multi mapping. what file names (and with what logic) are you trying to generate out of the 3 output messages?
You can try with 3 mappings ... what's the reason for the failure.
cheers,
Ambrish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.