XML-IDOC to Plain File: File Receiver Cnt Conversion Problem Nested Stucts
Hi all,
I have an IDOC-XI-File scenario and I have a problem with the file receiver adapter and the content conversion parameters when the final data type has nested structures. Imagine that I have something similar to the following:
My desire is to get something similar to this in the output file:
SEGMENT0;HEADER
SEGMENT1;100
SEGMENT2;0200000716
SEGMENT3;1000
SEGMENT2;0200000717
SEGMENT3;1000
SEGMENT3;1001
SEGMENT3;1002
But what we are getting is this:
SEGMENT0;HEADER
SEGMENT1;100
SEGMENT2;0200000716;SEGMENT3;1000
SEGMENT2;0200000717;SEGMENT3;1000;SEGMENT3;1001;SEGMENT3;1002
The content conversion parameters of the file receiver are as follow:
Recordset Structure: IDOC,EDI_DC40,E1STATS,Z1HDSTAT,Z1ITSTAT
IDOC.fieldSeparator: ;
IDOC. endSeparator: nl
IDOC. addHeaderLine: 0
EDI_DC40.fieldSeparator: ;
EDI_DC40. endSeparator: nl
EDI_DC40. addHeaderLine: 0
E1STATS.fieldSeparator: ;
E1STATS. endSeparator: nl
E1STATS. addHeaderLine: 0
Z1HDSTAT.fieldSeparator: ;
Z1HDSTAT. endSeparator: nl
Z1HDSTAT. addHeaderLine: 0
Z1ITSTAT.fieldSeparator: ;
Z1ITSTAT. endSeparator: nl
Z1ITSTAT. addHeaderLine: 0
Ive tried to use the parameter beginSeparator=nl for the segments Z1ITSTAT but its not working. I havent been able to find a solution in the other forums. Can anybody help me?
Thanks in advance
Roger Allué Vall
Can you explain it with my example? I can't see what you mean.
<ZSYSEX01>
.<IDOC BEGIN="1">
....<EDI_DC40 SEGMENT="SEGMENT0">
........<FIELD1>HEADER</FIELD1>
....</EDI_DC40>
....<E1STATS SEGMENT="SEGMENT1">
........<FIELD2>100</MANDT>
........<Z1HDSTAT SEGMENT="SEGMENT2">
...........<FIELD3>0200000716</FIELD3>
...........<Z1ITSTAT SEGMENT="SEGMENT3">
...............<FIELD4>1000</FIELD4>
...........</Z1ITSTAT>
........</Z1HDSTAT>
........<Z1HDSTAT SEGMENT="SEGMENT2">
...........<FIELD3>0200000717</FIELD3>
...........<Z1ITSTAT SEGMENT="SEGMENT3">
...............<FIELD4>1000</FIELD4>
...........</Z1ITSTAT>
...........<Z1ITSTAT SEGMENT="SEGMENT3">
...............<FIELD4>1001</FIELD4>
...........</Z1ITSTAT>
...........<Z1ITSTAT SEGMENT="SEGMENT3">
...............<FIELD4>1002</FIELD4>
...........</Z1ITSTAT>
........</Z1HDSTAT>
....</E1STATS>
.</IDOC>
</ZSYSEX01>
Regards,
Similar Messages
-
SAP PI 7.1 HTTP receiver adapter conversion problem
Hello!
I would like to send a EDIFACT file over HTTP to our partner. The problem is that I can not use any entries in the "module" tab to convert the EDIFACT XML message to a EDIFACT "text" message (X2E conversion normally made with help of Seeburger modules when using X.400, FTP,...).
Does anyone know how to send content other than IDocs over HTTP ?
Thank you for your help!
Regards
ChristianHi Christian
The position of your module looks correct. Even the link below confirms it.
https://help.sap.com/saphelp_nw04/helpdata/en/cd/5af7c0c994e24fb0d0088443513de2/frameset.htm
In the receiver adapter, if you want to add your own modules to process the request message, you add them before the module specified below; if you want to add your own modules to process the response message, you add them after the following module:
sap.com/com.sap.aii.af.soapadapter/XISOAPAdapterBean
I tested this out with the module configuration below and it works fine.
From the audit log, you can see the BIC conversion is successful and the SOAP message successfully transmitted. I checked on the receiver side, and the EDIFACT flat file was received.
Can you add the "destTargetMsg" parameter = "MainDocument"? I think your BIC conversion is saving the converted document under a different attachment name, but the SOAP adapter is sending out the MainDocument (which is still the EDIFACT XML). This parameter should replace the MainDocument with the converted file.
Rgds
Eng Swee -
Idoc to File scenario: receiver content conversion
Hi,
I have a Idoc to file scenario in which each segment is to be sent in a new line.
Also, even if the segment is not present in Idoc, comma separated blank values are to be sent.
Till now I have been fllowing this blog
File Content Conversion for Multi Hierarchical Structure
But in this case, blank values csv line are not created.
When I used mapWithDefault for parent WPA12 then only 1 instance is created.
For eg.
WPA01
-WPA02
--WPA12
WPA01
-WPA02
--WPA12
There are no values in WPA12 segment
Output
WPA01,a,a,a,a
WPA02,b,b,b,b
WPA12,,,,,
WPA01,c,c,c,c
WPA02,d,d,d,d
Can I make any change in the approach as in the blog to get the desired output?
Regards,
Anirudh.Hi,
To explain more a bit..
My requirement is to create a flat file from multiple hierarchical xml structure.
Additionally, if the values are not present for some nodes then also I have to send the blank values in flat files. If entire segment is not present then also blank csvs needed to be sent.
regards, Anirudh. -
How can I use the FTP server on Oracle XML DB for plain text files?
Hi,
I need to generate comma separated files for download via FTP. The files are generated from Oracle Table data and should be published on a FTP Server. Would it be able to use the FTP Server on Oracle XML DB?
If not, any suggestions?
Thanks
Frederik ChristensenYou can create a temporary CLOB with your CSV content, and then folder the CLOB into the XDB repository with DBMS_XDB.createRESOURCE()...
This would work fine.... -
FIle Adapter Receiver - Content Conversion
I have a xml file as below that I am trying to convert to a simple csv file. All I get is a blank csv file at the ouptput. I tried different setting for the file conversion in the reveiver file adapter. No luck yet. I could write to an output XML file with no problem, so my interface is working!
The SAP Help doesn't provide much info on this. Your help is highly appreciated.
Thnaks.
?xml version="1.0" encoding="UTF-8" ?>
- <ns:PlantMaintenanceMessageType xmlns:ns="http://cs.par/demo/plantmaintenance">
<EquipmentID>10005661</EquipmentID>
<FunctionalLocation>KB</FunctionalLocation>
<Date />
<Time />
</ns:PlantMaintenanceMessageType>What is your root node ?
For your content conversion you need to specify the Recordset Structure but in your case i dont find an entry for the same.
If your XML had an extra tag like
xml version="1.0" encoding="UTF-8" ?>
- <ns:PlantMaintenanceMessageType xmlns:ns="http://cs.par/demo/plantmaintenance">
<b><details></b>
<EquipmentID>10005661</EquipmentID>
<FunctionalLocation>KB</FunctionalLocation>
<Date />
<Time />
<b></details></b></ns:PlantMaintenanceMessageType>
then your record set structure wud be details
and in you content conversion parameters you cud say
details.fieldSeparator -> ,
details.endSeparator 'nl'
I guess you are on sp13 or above hence there even if you content conversion fails a blank file will be created (thats what i have experienced).
Reagrds,
ShaBZ -
JMS Receiver Adapter Conversion problem
Hi All,
My Scenario.
Websphere MQ(JMS Adapter)--->SAP XI--->Webspher MQ(Receiver Adapter)----->Mainframe MQ
I am using Module parameters in JMS Receiver Adapter.
Module Sequence in the Receiver Channel
No. Module Name T Module Key
1 localejbs/AF_Modules/MessageTransformBean L XML2Plain
2 localejbs/SAP XI JMS Adapter/ConvertMessageToBinary L CallJMSService
3 localejbs/SAP XI JMS Adapter/SendBinarytoXIJMSService L Exit
Module
Key
Parameter Name Parameter Value
XML2Plain Transform.Class com.sap.aii.messaging.adapter.Conversion
XML2Plain Transform.ContentType text/plain;charset=utf-8
XML2Plain xml.conversionType SimpleXML2Plain
XML2Plain xml.addHeaderLine 0
XML2Plain xml.fieldFixedLengths 3,5,10
XML2Plain xml.fixedLengthTooShortHandling Cut
Output of JMS Adapter message in Websphere MQ
abc def sahafhhjf .
fdh hdh jfjfjdjdjgjjjd .
This "." giving error in Mainframe MQ.plz help me how to remove dot(".") end of the record.
thanks,
pachikaHi
Reduce the field length where this "." is coming. As you are using fixedLengthTooShortHandling Cut this will trim the dot.
Try it
Else you can remove this in Mapping as well.
Thanks
Gaurav -
Receiving binary IDOC via Queue and convert it to XML-IDOC
Hello,
we are focusing the following scenario:
We receive an plain, binary IDOC in a MQSeries Queue. We want to pick it, transform it and place it into R/3 (of course using XI 3.0). Afterwards the other way around.
I know the Howto for the ABAP mapping from XML-Idoc to plain IDOC. This may also work for our scenario. Do you agree?
The other way around is more difficult. I assume that - since the IDOC adapter resides in the ABAP stack - we cannot re-use an existant adapter module in the JMS adapter. Right?
I heared about JCO capabilities of "xmlizing" Idocs - but did not find hints within the javadoc. Anyway, would this really be the preferred way - writing an user exit for the adapter using JCO - to handle this? There must be a way to do it better, must it not?
How did you guys face this problem - I think its a common one...
Any starting points for a discussion are appreciated....
Greets,
helgeHi Helge,
For the conversion of the incoming flat message, one could imagine a similar ABAP mapping as the one described for the XML->flat message conversion. The function module IDX_IDOC_TO_XML could be a good starting point for your search.
To perform conversions in the Java stack (e.g. in an adapter module) might be a quite complex task since you first have to get the IDoc metadata. And there you cannot reuse existing function modules.
Best regards
Joachim -
XML IDoc file to IDOC .
Hi,
I am receiving XML idoc (Orders05) file from 3rd party to PI system , PI needs to create sales order IDoc ( Orders05) in ECC system.
1) Do I need to create source structure for XML IDoc file ? If yes should I create the structure as Orders05 ?
2) How to map line items of xml file to Orders05 IDoc line items ?
Please help.
Thanks - Vinay.Hi Vinay,
Please see Mikes reply in this thread. You may follow the same procedure:
XML to FlatFile IDOC
Regards,
---Satish -
Hi,
I am facing some problem in FCC for Receiver adapter. It has to convert from XML to CSV File.
<?xml version="1.0" encoding="UTF-8" ?>
- <ns0:PaymentFull_Target xmlns:ns0="http://sdn.com/Payment">
- <RECORDSET>
- <Header>
<LineItem>1</LineItem>
<SaleNumber>102</SaleNumber>
<TransNumber>105</TransNumber>
<Store>1326</Store>
<variant>Z6</variant>
<TransType>NEW</TransType>
<Adjustm_Type />
</Header>
- <Header>
<LineItem>2</LineItem>
<SaleNumber>102</SaleNumber>
<TransNumber>105</TransNumber>
<Store>1326</Store>
<variant>Z6</variant>
<TransType>NEW</TransType>
<Adjustm_Type />
</Header>
- <Header>
<LineItem>3</LineItem>
<SaleNumber>102</SaleNumber>
<TransNumber>105</TransNumber>
<Store>1326</Store>
<variant>Z6</variant>
<TransType>NEW</TransType>
<Adjustm_Type />
</Header>
</RECORDSET>
</ns0:PaymentFull_Target>
Output File is coming only with lineitem values , remaining fields are not coming.
*1,2,3*
FCC Used...
RecordSet Structure -- Header
Header.fieldNames -
LineItem,SaleNumber,TransNumber,Store,variant,TransType,Adjustm_Type
Header.fieldSeparator----- ,
Header.endSeparator----- 'nl'
Did I miss anything.. any idea whats going wrong?
Thanks
DeepthiHi Deepthi,
Mention the occurrence of header in Recordset
You specify like this:
Recordset: Header, *
Header.fieldSeparator : u2018Field Separatoru2019
-->For FCC on Receiver side you donu2019t have to mention the field names.
-->The u2018endSeparatoru2019 parameter needs to given for substructure only
Check this links:
http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm
/people/shabarish.vijayakumar/blog/2007/08/03/file-adapter-receiver--are-we-really-sure-about-the-concepts
/people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion
Rgds,
Akhila -
XML-IDoc to flat file (Release 4.0 and 3.0)
Hello experts,
I implemented the guide "[How to Convert an IDoc-XML structure to a flat file and vice versa in XI 3.0|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/46759682-0401-0010-1791-bd1972bc0b8a]". Now I get a flat file, but it is IDoc-Version V3 (for Release 4.0). Is it possible to create another mapping which creates a Relase 3.0 IDoc instead as shown in transaction WE61 with version 2?
Best regards,
DavidHello all,
thank you for your answers. But again, it's not about IDoc types!
Please go to transaction WE61 the last selection on the screen is version (1 for SAP Release 2.0, 2 for SAP Release 3.0 and 3 for SAP Relase 4.0). What the ABAP class from the guide creates is a V3 IDoc for SAP Release 4.0. If you choose the HTML view, you will see, that the versions are different, although the IDoc type is exactly the same. We create Version 3 and we need Version 2.
Best regards,
David -
Conversion of multiple xml idocs to flat file
Hi,
I did ABAP mapping to convert xml idoc to flat file by using the reference how to do abap mapping in xi3.0.pdf
It is working for only one idoc at a time.
If I have multiple idocs in a single xml file, the above code is not working.
Please let me know what cchange to be done to work out for this.
Hope am clear.
Regards,
Anil.Look For the Occurances of target Field node...It should be 1 to unbounded
-
File Adapter receiver channel : change encoding attribut in xml file
Hi,
How can I change the XML encoding attribut
from:
<?xml version="1.0" encoding="UFT-8"?>
to:
<?xml version="1.0" encoding="ISO-8859-1"?>
in my File Adapter, receiver channel ?Hi,
plz chk the following link:
http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm
● Select the File Type of the document:
○ Binary
○ Text
Under File Encoding, specify a code page.
The default setting is to use the system code page that is specific to the configuration of the installed operating system.
The content of the message is converted to the corresponding code page before the message is saved as a file.
Permitted values for the code page are the existing Charsets of the Java runtime. According to the SUN specification for the Java runtime, at least the following standard character sets must be supported:
Regards -
Sending multiple IDocs (all in single file) to FTP via XI
Hi All,
We have a requirement as below where we are looking for various feasible solutions.
The requirement is to collect multiple IDocs in ERP (2000-5000 in number) per day (either Flat File or XML) and needs to be sent as a single File (which has all these IDocs) to FTP Server via XI.
BPM is not allowed to use and we are working on PI 7.0, so IDoc packaging is also not applicable. There is no mapping required, we need to just route them to FTP from ERP System.
Looking forward for various solutions.
Regards,
N. Jayanth Kumar.Hi,
Using the XML file port at R/3 to collect the Idocs would be a feasible solution. Also, as Sunil as already pointed out, you can configure this as a pass through interface, which will improve your overall processing time.
Another solution can be to pass the Idocs to PI and then use the append mode in the receiver file adapter to collect the days idoc into a single file.
To append only idocs for a particular day, try using dynamic filename, where file would have the date in it. This way, only Idocs for a particular day would be appended.
Regards -
File Content conversion - IDOC to Fixed length File
Hi,
Scenario : SAP R/3(IDOC) -> XI -> Fixed Length file
IDOC is sending from SAP R/3, XI has to do the mapping and send a Fixed length File to /tmp in XI.
When I am using the message Protocol as "File" in the Receiver communication channel, XML file is writing to /tmp. When I am using "File Content Conversion" as a message protocol,Empty File is writing. Can anybody tell me why empty file is creating. Can we use File content Conversion in this scenario. Is there any additional parameter or settings required?
Receiver communication channel settings:
Message Protocol: File Content Conversion
File type : Binary
Recordstructure : MT_V_PER01
Name Value
MT_V_PER01.fieldFixedLengths 25,35
MT_V_PER01.fieldNames PERSNR,NAME
File Data Type : DT_V_PER01,
Message type : MT_V_PER01
IDOC type : WP_PER01.
Expecting your expert advice.
Thanks
vineeshHi Moorthy,
I am getting success messages in Audit log as below:
2006-09-29 12:08:53 Success Trying to put the message into the send queue.
2006-09-29 12:08:53 Success Message successfully put into the queue.
2006-09-29 12:08:53 Success The message was successfully retrieved from the send queue.
2006-09-29 12:08:53 Success The message status set to DLNG.
2006-09-29 12:08:53 Success The message was successfully transmitted to endpoint http://nslcxi08:8010/sap/xi/engine?type=entry using connection AFW.
2006-09-29 12:08:53 Success The message status set to DLVD.
2006-09-29 12:08:53 Success The message was successfully delivered.
I have checked the Payload maindocument,the IDOC structure contains data.
<?xml version="1.0" encoding="UTF-8" ?>
- <WP_PER01>
- <IDOC BEGIN="1">
- <EDI_DC40 SEGMENT="1">
<IDOCTYP>WP_PER01</IDOCTYP>
<MESTYP>WP_PER</MESTYP>
<STDMES>WP_PER</STDMES>
<SNDPOR>SAPLCD</SNDPOR>
<SNDPRT>LS</SNDPRT>
<SNDPRN>LCDCLNT210</SNDPRN>
<RCVPOR>LXDCLNT250</RCVPOR>
<RCVPRT>LS</RCVPRT>
<RCVPRN>LXDCLNT250</RCVPRN>
</EDI_DC40>
- <E1WPP01 SEGMENT="1">
<PERSNR>0000100006</PERSNR>
- <E1WPP02 SEGMENT="1">
<NAME>Consumer</NAME>
</E1WPP02>
</E1WPP01>
</IDOC>
</WP_PER01>
Thanks
Vineesh -
PI removing blank spaces at the end of the lines in a plain text file
Hi -
I have an interface that transfers a file via FTP. I defined both the sender and receiver to transfer either Text or Binary but the interface removes every blank space I have after the last character. The file is a fixed lenght file.
Example:
Original file:
Hello world(space)(space)(space)(space)(space)(space)(space)(space)(eol)
where (space) is the space character and (eol) is the end of line char.
File after it is received.
Hello world(eol)
I already defined the parameter Row.fieldFixedLenghts with 10164 which is the lenght of the lines of the file.
Any ideas why it may be happening?
Thanks,
Carlos.Hi -
I tried both the parameters:
xml.fieldContentFormatting
structure.fieldContentFormatting
The received file still has the problem. All the blank spaces are cleared out.
The file is a plain text file not an XML file. May this be the issue?
Thanks,
Carlos.
Maybe you are looking for
-
Hello! I am trying to sync my iPhone 4 to my iTunes. My phone is connected to my computer, (was able to import pics) but I cannot manage my apps or music in iTunes. I ran diagnostics and it says 'no iPhone found'. It then takes me to Apple Support th
-
Hello everybody! This is a problem: if I have the files with similar names - the only difference is how page number is stated, in 2 digits or in 1, (so with 0 or without) - my script sees those names as the same. Here is test script tell application
-
XQuery elapsed time varies significantly
Dear all, I am a student and exploring xml databses for my final year project. I am executing xqueries on Berkley DB XML 2.4.13. The eapsed time on first execution is 3.343 seconds and upon immediate tries it is 0.844, 0.907, 0.86 seconds. The XQuery
-
HT201250 will time machine back from an external drive
I save all data ,photos documents etc to an external WD My book Live drive and want to back this up.How do I do that in Time machine
-
Folders won't stay open - HELP!
I just upgraded to Snow Leopard on a Mac Pro. Now when I open a folder and try to click on something inside that folder, the entire folder closes and the desktop goes blank (all folders disappear) for a few seconds then they reappear. It keeps happen