on 10-26-2007 10:04 AM
Hi,
I am trying to generate the file name dynamically, when i checkin sxmb_moni the message is successful but when i check in application server the file is not there. In this scenario i have used variable substitution option and adapter specific message attributes. Kindly suggest.
Thanks & Regards,
Sridhar
Hi Sridhar,
Check the Communication Channel Monitroing of your Receiver File Channel.Might be this channel gone under errors.Give that error description which the cahnnel is encoutnering the problem.
Cheers
Veera
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Veer,
Please find the details of my scenario below:
-
UDF----
//write your code here
String SourceFileName="Pur_Ord";
DynamicConfiguration conf=(DynamicConfiguration)container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System", "FileName");
java.text.SimpleDateFormat formatter=new java.text.SimpleDateFormat ("yyyyMMdd");
java.util.Date day = new java.util.Date();
String dateformat=formatter.format( day );
String newfilename=SourceFileNamedateformata+".xml";
conf.put(key, newfilename);
return newfilename;
-
UDFclose----
DocNum -> UDF -> ClientDocID (Graphical mapping)
In Receiver Communication Channel
File Name Schema = %var%.xml
File Construction Mode = Create
Variable Substitution Check Box enabled
And passed varibale name = var and reference = payload:ALS,1,ClientDocID,1
And checked the Adapter specific attribute check box and file name check box
Regards,
Sridhar
the field which takes the value from th UDF to get the filename (change the occurence from 0- unbounded) and also
var = payload:ALS,1,ClientDocID,1
is the ClientDocID is the filed that hold the value of the filename....i doubt ...i think you are not rfereing to the correct field which hold the data in variable substution...
pls post the target structure
reward points if usefull
Hi Nisar,
Please find the target structure below:
<?xml version="1.0" encoding="UTF-8" ?>
- <ns0:ALS xmlns:ns0="http://Replenishment.com">
- <DocHeader>
<ClientID></ClientID>
<ClientDocID></ClientDocID>
<UserID></UserID>
</DocHeader>
- <Request Type="PurchaseOrder" action="insert">
<ClientReference></ClientReference>
<DeliveryDate></DeliveryDate>
<Vendor></Vendor>
- <OrderLine>
<Request Type="PurchaseOrderItem" action="insert" />
<ExpectQTY></ExpectQTY>
</OrderLine>
</Request>
</ns0:ALS>
Regards,
Sridhar
Hi Sridhar,
<i> And checked the Adapter specific attribute check box and file name check box</i>
No need to check this, uncheck this one and try to test the scenraio.You will get it this time.
Cheers
Veera
>>>Reward Points,if it is needful
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Experts,
Please find my sceraio details below:
This is Idoc To File Scenario
Source is the idoc and the mapping field name is DocNum
Target Structure is :
<?xml version="1.0" encoding="UTF-8" ?>
- <ns0:ALS xmlns:ns0="http://Replenishment.com">
- <DocHeader>
<ClientID></ClientID>
<ClientDocID></ClientDocID>
<UserID></UserID>
</DocHeader>
- <Request Type="PurchaseOrder" action="insert">
<ClientReference></ClientReference>
<DeliveryDate></DeliveryDate>
<Vendor></Vendor>
- <OrderLine>
<Request Type="PurchaseOrderItem" action="insert" />
<ExpectQTY></ExpectQTY>
</OrderLine>
</Request>
</ns0:ALS>
The below UDF is written on field level(ClienDocId)
-
UDF----
//write your code here
String SourceFileName="Pur_Ord";
DynamicConfiguration conf=(DynamicConfiguration)container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System", "FileName");
java.text.SimpleDateFormat formatter=new java.text.SimpleDateFormat ("yyyyMMdd");
java.util.Date day = new java.util.Date();
String dateformat=formatter.format( day );
String newfilename=SourceFileNamedateformata+".xml";
conf.put(key, newfilename);
return newfilename;
-
UDFclose----
DocNum -> UDF -> ClientDocID (Graphical mapping)
Fieled name in the Idoc is DocNum
In Receiver Communication Channel
File Name Schema = %var%.xml
File Construction Mode = Create
Variable Substitution Check Box enabled
And passed varibale name = var and reference = payload:ALS,1,ClientDocID,1
And checked the Adapter specific attribute check box and file name check box
Regards,
Sridhar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sridhar,
Your refrence field is at 2nd position in your node, try like this reference = payload:ALS,1,ClientDocID,2 and let me know the result.
Cheers
Veera
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sridhar,
Once check the value mentioned in variable subtitution and check your mapping whehter the field is populated with any values or not.
And check the below links for Variable subtiution.
/people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i - Dynamic File Name Part 1
/people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii - Dynamic File Name Part 2
Provide your target strucutre to check that whether your variable subtiution refrence is correct or not.
Cheers
Veera
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
1. In SXMB_MONI -
>NoError
2. Check in the File Receiver adapter monitoring-----> there should be some error.....if the fie receiver adapter is no error thenfile shold come in the target directory.......
let me know these info
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nisar,
When i checked in RWB the receiver adapter is throwing an error as "Could not process due to error: com.sap.aii.adapter.file.configuration.DynamicConfigurationException: The Adapter Message Property 'FileName' was configured as mandatory element, but was not supplied in the XI Message header".
Please suggest what might be the problem.
Regards,
Sridhar
User | Count |
---|---|
84 | |
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.