on 09-01-2008 9:58 AM
HI All,
I am in an IDOC to File scenario using Fcc. (R/3 --> XI --> 3rd party)
I need to use the idoc-number(EDI_DC40-Docnum) as my output file name. I planned using variable substitution but there it expects me to get the idoc number from payload which I do not have it in. (refer c ode below)
As I understand, variable substitution can be used only on payload(the FINAL data set that we will be writing to the file).
Can we use the data which is part of incoming IDOC and not part of payload(final data what we are writing to file).??
Other idea was to map this IDOC no to a field in final file, but this field should not be written in the output file, so am confused about how to achieve this.
E.g
*Incoming Data*
IDOC
|_EDI_DC40
|_DOCNUM
Final data (Payload)
Header
Data
Trailer
As seen in my example above I do not have the IDOC no in the final data so how do I use the Idoc no as my filename? Apprecaite your help on same.
Regards
Shirin
Use dynamic configuration UDF to get filename..
You dont have field in your target structure to map this filename with..write? .. Then this trick would do
Map the output of UDF to root node(MT_..) at target...
IDocNo-> UDF-> MT_target ... UDF of cache Value
The UDF, if you dont have..
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
conf.put(key,a);
String ourSourceFileName = conf.get(key);
return ourSourceFileName;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
No Need of Any Variable Substitution here.Just Use this UDF in MApping and Just check the Check Boxes ASMA in the Communication channel.
1) Write one UDF & map Like this
IdocNumber-----UDF--
MT_Target
2) Check the ASMA Option in Receiver Adapter Aloneu2026..No need to check in Sender channel
UDF Code:
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File" , "FileName");
String Outputfile = conf.put(key,a);
return Outputfile;
REgards
Seshagiri
In Receiver File Communication channel,
In File name scheme : %var1%.txt
Then check an enable variable substituion,
Variable name-> var1
Reference -> payload:EDI_DC40,1DOCNUM,1
Then u file will come with IDOC number.
No need of Ud=sing UDF
"Award points if helpful
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
use an additional field in the target structure as filename.
Use cache parameter value
public String GetFileName(String a,Container container)
{
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String ourSourceFileName = conf.put(key,a);
return ourSourceFileName;
}
Enable adapter specific attributes on the sender channel.
Do the mapping as below
idocnum->GetFileName(UDF)->Filename(target element)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Refer this:
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File" , "FileName");
String Outputfile = conf.put(key,a);
return Outputfile;
Regards,
Nithiyanandam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
You can use dynamic configuration to get the file name .
Use Adapter Specific Message Attributes for the target Comm Chanel check the indicator for filename in the advanced tab of CC
create a UDF with i/p as file name i.e the Idocnum field and
paste this code
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
//conf.removeAll();
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
//String filename= conf.get(key);
conf.put(key, fileName);
key= null;
return fileName;
PS: use cache as value in UDF
ands assign the o/p of this UDF to a root node
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.