on 10-14-2014 10:05 AM
Hi Experts,
My scenario is convertion of XML to CSV format.
Source XML structure is similar like,
<?xml version="1.0" encoding="UTF-8"?>
<ns0:ZTEST_TIPS_DOI_NEW1 xmlns:ns0="urn:sap-com:document:sap:rfc:functions">
<ZMAT_TAB>
<item>
<MANDT/>
<MATNR/>
<MAKTX/>
<ERSDA/>
<BRGEW/>
<GEWEI/>
</item>
</ZMAT_TAB>
</ns0:ZTEST_TIPS_DOI_NEW1>
Already gone through some thread in SNC.Like,
http://www.riyaz.net/sap/xipi-file-content-conversion-for-complex-structures/79/
Is it possible to convert through FCC standard adapter module?
Thanks,
Arthita
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Arthita
Your XML structure is having more levels than FCC can handle.
Your structure:
ns0:ZTEST_TIPS_DOI_NEW1 - Root
ZMAT_TAB - Level 1
item - Level 2
Based on the description in the online help, you can only have two levels - Root and Level 1
● The expected XML structure contains the structure as nodes filled with any number of elements without additional subnodes.
● The expected document structure usually looks like this:
<root>...
<nameA>
<value1>value</value1>
<value2>value</value2>
<value3>value</value3>
</nameA>
<nameB>
<value4>value</value4>
</nameB>
...
</root>...
I would suggest you map the RFC structure to another structure which has only root and level 1. It would look something like below:-
<ns0:Z_INTERMEDIATE_STRUCTURE xmlns:ns0="anynamespace"> <-- Root
<item> <-- Level 1
<MANDT/>
<MATNR/>
<MAKTX/>
.....
</item>
</ns0:Z_INTERMEDIATE_STRUCTURE>
Rgds
Eng Swee
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Eng,
1.Actually, When importing the RFC from ECC to PI its showing that structure automatically, because extracting data from one ZTable.
Is there any other way to write?but have to extract data from one Z-table.
2.Another point is,but when use "node.endSepatator" as | its taking properly, but why not new line?(referring another reply to Srikanth )
3.And If all are same, if there any other way to achieve the same?
Thanks,
Arthita
Hi Arthitha
For 1, yes, that is the default structure based on ECC RFC. What I was suggesting is to add an Operation mapping to map it to a 2-level structure. No changes on the RFC side.
However, if you already have most of it working based on Srikanth's reply, you might want to try and see if you can resolve that first.
If you can view it correctly in AL11, then maybe it might be due to Carriage Return/Line Feed differences. These are different in different OSes. I suggest you set your FileZilla transfer to Binary mode and download the file again. Then view it in Notepad++ (Notepad alone does now display the CRLF)
Rgds
Eng Swee
Hi Arthita
In your Recordset Structure, just maintain Item (remove MT_CSV_R)
For the parameters part, remove those lines with MT_CSV_R and ZMAT_TAB, and maintain only the following 3 parameters for Item
Name | Value |
---|---|
Item.fieldNames | MANDT,MATNR,MAKTX,ERSDA,BRGEW,GEWEI |
Item.fieldSeparator | | |
Item.endSeparator | 'nl' |
Rgds
Eng Swee
Hi Arthita,
for .CSV file in-order to generate the new line, pls use endSeparator - '0x0D"0x0A'
Regards,
Srikanth
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Arthita,
Refer below link
XI/PI: File Content Conversion for Simple Structure
Regards
Bhargava Krishna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Can you show us a sample CSV that you intend to convert this XML to?
Regards,
Mark
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Arhita,
Of course it is possible. Have you tried the Riyaz example?, with the parameter FieldSeparator you won't have any problems.
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
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.