on 08-03-2010 3:57 PM
Hi,
I need some details for csv to xml file conversion.I have configured the file content conversion adapter for these conversions.In source CSV file we will receive below details in single line.
0020000001000 0020000002000 0020000003000 0020000004000
Now i can successfully generate
<?xml version="1.0" encoding="utf-8" ?>
- <ns:MT_GLMast_out xmlns:ns="http://sap.com/PI/GLMast">
- <GLMasterData>
- <GLMAST>
<Customer1>0020000201000</Customer1>
<Customer2>0020000200000</Customer2>
<Customer3>0020000199000</Customer3>
<Customer4>0020000198000</Customer4>
</GLMAST>
</GLMasterData>
</ns:MT_GLMast_out>
with following parameters
GLMAST.fieldSeparator ,
GLMAST.fieldNames Customer1,Customer2,Customer3,Customer4
GLMAST.endSeparator 'nl'
Now the issue is customer wants to send 3000 customer number in single file.How to maintain the parameter to duplicate filednames just customer instead of customer1,customer2,customer3 etc...
<Customer>0020000201000</Customer>
<Customer>0020000200000</Customer>
<Customer>0020000199000</Customer>
<Customer>0020000198000</Customer>
This can be done if customer sends file like one customer number in one line.please help me how to process multiple customer number in single file separated with comma.
Thanks,
Vijay
For this what you can do is, create the source and target data types as shown below
Source Data Type
<DTO_Customer>
<Records> 0..unbounded
<Customers> </Customers>0..1
</Records>
</DTO_Customer>
Target Data Type
<DTI_Customer>
<Records> 0..1
<Customer> </Customer> 0..unbounded
</Records>
</DTI_Customer>
Now since your data will come in a single string therefore do the FCC in sender channel as shown below
Records.fieldNames = Customers
Records.fieldSeparator = 'nl'
ignoreRecordsetName = true
So by doing this you will get the data into XI mapping in as single string. Now you need to write an UDF which will split this string into individual customers based on your delimiter in the string.
Now map the output of this UDF to <Customer> field.
You may need to do some other small fixes accordingly.
I hope this will solve your problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi.
I guess the Sarvesh Solution is only way.In addition you can use this UDF.
UDF : By Context
Parameters :
List i.e (1055121,5454512,54878)
delimiter i.e ","
for (int i = 0; i < List.length ; i++) {
String[] val = List<i>.split(delimiter[0]);
for ( int j = 0; j < val.length ; j++) {
result.addValue(val[j]);
}
}
source > UDF-- target.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
We can implement your required through below changes
Changes occurence from 0..1 to 0...unbound at record set and field level. You problem will be sort out easily.
i.e.,
<GLMAST>---0...unbound
<Field>---0...unbound.
I hope now clear.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
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.