Idoc to Txt
Hi,
I want to convert an idoc to txt. I converted the idoc to xls,and it look organized with headers and sdata od the idoc all separated. but when i convert to txt it's all messed up because the txt editor deletes the blank spaces.Anyone know who can i put all organized like this:
Number Type Product Price discount tax
1 M xpto 2.0
Hi Ricardo,
PERFORM set_fixlen(saplgrap) USING '0' size.
This is used to set the length of each record including your blanks
PERFORM set_trail_blanks(saplgrap) USING 'X'.
This is used to maintain trailing spaces when downloading to PC.
Hope this will help.
Regards,
Ferry Lianto
Similar Messages
-
Hello everyone,
I have the following scenario:
IDOC -> XI -> Mail w/ .txt attach with fields of IDOC separated by ';'
How can i "concatenate" all fields into one text file and then send this in an attachment via email ?
Thank you in advance,Hi Nuno
What you can do here is
1. parse IDOC XML into a flat file using UDF or Java mapping and pass it to a string. use the mail package and map this string field to Content field of mail package. Now at mail adapter use Mail package with attachment.
2. You write a mail adapter module to parse the file and attach it to mail.
3. Use the StrictXMLtoPlain Bean at receiver mail adapter to parse IDOC XML into a flat file and then use MessageTransformBean to attach it to the mail
Using Mail package usage will allow dynamic mail message.
Thanks
Gaurav -
Difference between idoc and .txt
What would be the main difference between managing an interface with txt files and creating idocs to make a connection on SAP and an external system.
Refer this thread -
what are the advantages of idoc compare to flat file. how data is secure
Regards,
Amit -
Hello All,
I have recived an IDOC DATA in TEXT file.
would u please help me how to create an idoc using the above text file.
Kind Regards,
Dev.Hi,
first put the file in application server and then in we16 give the directory name and the path and the sender port info and press execute..ur idoc will be generated.before that in we21(FILEPORT),in the inboundfile maintain the directory name and the path.
Regards,
Nagaraj -
Download (flat) IDOC?
Hi everybody,
as we need a flat IDOC as txt-file for developing requirements, we would like to download a IDOC from R/3.
Is there a special transaction or any tools?
Thanks Regards
MarioHi Mario,
Please check this:
1. How to Download a Hierarchy to a Flat File
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/0403a990-0201-0010-38b3-e1fc442848cb
2. How To Convert an IDoc-XML structure to a flat file and vice versa in XI 3.0 Version 1.10
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/46759682-0401-0010-1791-bd1972bc0b8a
Please rewrds if found help ful.
BR,
Alok -
I have a scenario where I'm collecting Debmas from R3 and I want to convert it to a text file.
I'm unable to transform the multiple Debmas to a single xml structure with multiple debmas.
The BPM collects the IDOCs correctly but during the transformation it outputs only one IDOC .
In my message map testing it is able to convert the multiple Idocs to a single structure but within the BPM it does not do that.
Please suggest what could be the issue.
Thanks
ManojHi Manoj,
Have you entered the correlation correctly.. (the condition for collecting IDOCS, a primary key in most cases)
When u r collecting Idoc Debmas, ( Customer Master i believe), u should have the mappings as IDOC XSD to IDOC and then IDOC to txt conversion.. Am I right ?
inbound interface: target structure (txt)
outbound interface : idoc
abstract interface : for collecting multiple idocs..
mappings would be like this :
IDOC to IDOC XSD and
IDOC XSD to Txt structure .
Things to look out for while developing the interface:
Occurences and BPM data, like selecting multiline and defining correlation.
You should recheck the container for any discrepancies.
I am sending you two links (as there's some information missing, to identify your problem)
IDOCs (Multiple Types) Collection in BPM by Pooja Pandey:
/people/pooja.pandey/blog/2005/07/27/idocs-multiple-types-collection-in-bpm
and Collecting IDocs without using BPM by Stefan Grube:
/people/stefan.grube/blog/2006/09/18/collecting-idocs-without-using-bpm
Check the first one, You will get some idea, where there might be a problem.
You can also do the same without using BPM as Stefan has so elaborately explained.
Alternatively, you can also refer to this URL :
www saptechnical com/Tutorials/XI/CollectMultipleIDocs/Collect1.htm
Happy Developing..
regards,
Abhi..
Edited by: Abhisek on May 10, 2009 12:26 AM
Edited by: Abhisek on May 10, 2009 12:29 AM -
Variable filename and folder in receiver cc
Dear experts,
On PI, I need to create a (text-) file with a variable name and folder. The scenario is as follows:
idoc-> PI -> txt file
In my incoming Idoc I get the following data:
- directory where the txt file should be saved;
- name that the txt file should get.
How can I realise this in PI? Using variable substitution? As I never done this before, I have a hard time getting this to work...
Please help.
Thanks in advance
WilliamHi,
Use Dynamic Configuration:
Input will be 2 variables var1, var2.
String Name1 = var1;
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");
conf.put(key1, Name1);
String Name2 = var2;
DynamicConfigurationKey key2 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "Directory");
conf.put(key2, Name2);
return "";
Maping:
Var1---
UDF----TargetMessageNode.
Var2---
Under ID: Enable ASMA in file receiver adapter and chk FileName and Directory.
and put * under File name and / underTarget Directory(File receiver).
NOTE: U can alter this UDF according to ur req.
Thanks
Amit -
Reciever File Content conversion problem
Hi,
i am converting idoc into txt file
in sxmb_moni,the payload of target xml is,
<?xml version="1.0" encoding="UTF-8"?>
<ns0:HRPayroll_014_MT xmlns:ns0="http://XXXX.com/xi/:XXX">
<Infotype014>
<infotype>001400</infotype>
<zfty>400</zfty>
<zicnum>111111</zicnum>
<begda>20070428</begda>
<lgart>4000</lgart>
<betrg>0.00</betrg>
<anzhl>99.00</anzhl>
</Infotype014>
</ns0:HRPayroll_014_MT>
in File adapter i did like this-
Infotype014.fileldNames infotype,zfty,zicnum,begda,lgart,betrg,anzhl
Infotype014.fieldFixedlenghts 6,3,7,8,4,13,12
Infotype014.processConfiguration FromConfiguration
Infotype014.endSeparator 'nl'
and in RunTime Workbench
i am getting like this
<b>Conversion initialization failed: java.lang.Exception: java.lang.Exception: Error(s) in XML conversion parameters found:
Parameter 'Infotye014.fieldFixedLengths' or 'Infotye014.fieldSeparator' is missing</b>.
Channel has not been correctly initialized and cannot process messages
please guide me ..how to declare in field Content conversion Prameters.
i dont require column names.fields are fixed lenghts.
regards
JaganHi amitanshu,
Thanks for your response..
i given only fieldFixedLenghts
the auditlog is
Time Stamp Status Description
2007-05-10 15:15:58 Success Message successfully received by messaging system. Profile: XI URL: http://saps020:50100/MessagingSystem/receive/AFW/XI Credential (User): PIISUSER
2007-05-10 15:15:58 Success Using connection File_http://sap.com/xi/XI/System. Trying to put the message into the receive queue.
2007-05-10 15:15:58 Success Message successfully put into the queue.
2007-05-10 15:15:58 Success The message was successfully retrieved from the receive queue.
2007-05-10 15:15:58 Success The message status set to DLNG.
2007-05-10 15:15:58 Success Delivering to channel: FILE_HRP_RECEIVER_HR_PAYROLL014_CC
2007-05-10 15:15:58 Success MP: entering
2007-05-10 15:15:58 Success MP: processing local module localejbs/CallSapAdapter
2007-05-10 15:15:58 Success File adapter receiver: processing started; QoS required: ExactlyOnce
2007-05-10 15:15:58 Error MP: exception caught with cause com.sap.aii.af.ra.ms.api.RecoverableException: Channel has not been correctly initialized and cannot process messages
Time Stamp Status Description
2007-05-10 15:15:58 Error Exception caught by adapter framework: Channel has not been correctly initialized and cannot process messages
2007-05-10 15:15:58 Error File adapter receiver channel FILE_HRP_RECEIVER_HR_PAYROLL014_CC is not initialized. Unable to proceed: null
2007-05-10 15:15:58 Success Acknowledgement sent successfully for type: SystemErrorAck
2007-05-10 15:15:58 Success Acknowledgement creation triggered for type: SystemErrorAck
2007-05-10 15:15:58 Error Delivery of the message to the application using connection File_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: Channel has not been correctly initialized and cannot process messages.
2007-05-10 15:15:58 Success The asynchronous message was successfully scheduled to be delivered at Thu May 10 15:20:58 EEST 2007.
2007-05-10 15:15:58 Success The message status set to WAIT.
my adaper is in Active status only
please guide me
regards
Jagan -
RCVR File Content Conversion - Remove empty Recordsets
Hello everyone,
Here's my scenario: IDOC > XI > TXT (File Content Conversion)
Here's how my output XML currently looks like:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:D001FILE_MT xmlns:ns0="http://www.pharmaindustries.com">
<Recordset/>
<Recordset>
<MATLCODE>00155581</MATLCODE>
<MATLNAME>ALCOHOL REFINED 96% V/V (BALAYAN)</MATLNAME>
</Recordset>
<Recordset>
<MATLCODE>00155581</MATLCODE>
<MATLNAME>ALCOHOL REFINED 96% V/V (BALAYAN)</MATLNAME>
</Recordset>
<Recordset/>
<Recordset>
<MATLCODE>20388853</MATLCODE>
<MATLNAME>POLYSORBATE 60 SD (TWEEN 60 SD)</MATLNAME>
</Recordset>
</ns0:D001FILE_MT>
Currently, the conversion settings in the receiver file adapter results into this:
BLANK
00155581 ALCOHOL REFINED 96% V/V (BALAYAN)
00155581 ALCOHOL REFINED 96% V/V (BALAYAN)
BLANK
20388853 POLYSORBATE 60 SD (TWEEN 60 SD)
I want to get remove the BLANK LINES from the text file so that it now resembles this:
00155581 ALCOHOL REFINED 96% V/V (BALAYAN)
00155581 ALCOHOL REFINED 96% V/V (BALAYAN)
20388853 POLYSORBATE 60 SD (TWEEN 60 SD)
Here are the conmmand parameters already existing in the "Content Conversion Parameters":
Recordset.fieldNames
Recordset.fieldFixedLengths
Recordset.endSeparator
Would anyone know which command I should add in this section so that empty "Recordsets" are removed from the text file?
Thanks in advance!
GlennHi,
as per my understanding, u have teo record sets
i.e Recordset(bold one which has no fileds)
Recordet(which has two fileds)
if you use Recordset.field Separator-- 'nl'
nothing but ignoring the first record set
for second record set(which is not bold)
provide FCC parameters which i have provided previously.
still u r facing problem, try with
ignore recordset name - true
Recordset.fieldContentFormatting - ignore
note: here you have two record set i.e<Recordset>(blod)
<Recordset>(not bold).
warm regards
mahesh. -
Help to Receiver Content Conversion
Hi, i am facing IDoc2File Scenaio.
This file should be a .txt and only should have six numbers.
Incoming is an IDoc with the payload:
<ZPP_EDI_TAFEL SEGMENT="1">
<TAFNR>1</TAFNR>
<DATEI>ERGB.TXT</DATEI>
<TAFIST>014</TAFIST>
<TAFSOLL>020</TAFSOLL>
</ZPP_EDI_TAFEL>
This should be converted into a flat file with content of teh values from TAFNR and TAFIST. It should look like: 014020
I am trying to achieve this with the Content Conversion in the ReceiverAdapter.
in ID is the message type:
MT_Tafel
-Tafel_recordset
--Tafel_Details_Structure
---TAFIST
---TAFSOLL
In my understanding it's like recordset Structure is: Tafel_Details_Structure
So my Parameters look like:
Tafel_Details_Structure.fieldSeperator = ,
Tafel_Details_Structure.endSeperator = 'nl'
Tafel_Details_Structure.fieldNames = TAFIST,TAFSOLL
funny thing is, that after sending the IDoc the txt file contains:
<ns0:MT_Tafel xmlns:ns0="http://www.ips.com/jsn/HatzIDoc">
<SEGMENT>1</SEGMENT>
<TAFNR>1</TAFNR>
<DATEI>ERGB.TXT</DATEI>
<TAFIST>014</TAFIST>
<TAFSOLL>020</TAFSOLL>
</ns0:MT_Tafel>
So there is no content conversion at all. Can someone help?!
br, JensHi Vijaya,
acttually i read everything about it, but i am not able to figure out what i have done wrong.
Can u please help me?!
> Hi,
> Plz go thru the following blogs, these may help u:
>
> receiver adapter:
> 1)http://help.sap.com/saphelp_erp2005vp/helpdata/en/d2
> /bab440c97f3716e10000000a155106/content.htm
> 2)
> https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg
> 1312
> 3)
> https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/
> 1345
>
>
> regards -
Mulitple Message Transformation BPM Problem
I am getting a map failure exception because of the following reason (see below) and am not sure what to do about it.
I am a BPM process and have a received a populated Request Message, mapped the Request Data into a Bapi request (via BPM Transformation), Synchronously called the Bapi (via BPM Send), and next mapped the data from the Bapi Response and Original Request into a single Response message (2 messages into 1 message). I am getting a map failure when I am sending the two messages (Bapi Response and Original Request) into the Map process. It appears as the original Request data is lost (populated data is gone)and this is why the map is failing. I have tested the map independently and have no problems. Any suggestions?Hi Manoj,
Have you entered the correlation correctly.. (the condition for collecting IDOCS, a primary key in most cases)
When u r collecting Idoc Debmas, ( Customer Master i believe), u should have the mappings as IDOC XSD to IDOC and then IDOC to txt conversion.. Am I right ?
inbound interface: target structure (txt)
outbound interface : idoc
abstract interface : for collecting multiple idocs..
mappings would be like this :
IDOC to IDOC XSD and
IDOC XSD to Txt structure .
Things to look out for while developing the interface:
Occurences and BPM data, like selecting multiline and defining correlation.
You should recheck the container for any discrepancies.
I am sending you two links (as there's some information missing, to identify your problem)
IDOCs (Multiple Types) Collection in BPM by Pooja Pandey:
/people/pooja.pandey/blog/2005/07/27/idocs-multiple-types-collection-in-bpm
and Collecting IDocs without using BPM by Stefan Grube:
/people/stefan.grube/blog/2006/09/18/collecting-idocs-without-using-bpm
Check the first one, You will get some idea, where there might be a problem.
You can also do the same without using BPM as Stefan has so elaborately explained.
Alternatively, you can also refer to this URL :
www saptechnical com/Tutorials/XI/CollectMultipleIDocs/Collect1.htm
Happy Developing..
regards,
Abhi..
Edited by: Abhisek on May 10, 2009 12:26 AM
Edited by: Abhisek on May 10, 2009 12:29 AM -
Hello everybody!
I have scenario as below.
IDOC->XI->file.txt
I must transfer my packing list from idoc to file txt. The file txt must have a lot of lines for several levels of packing.
I think to try to processing an IDOC message many times over.
How can I Make?
Or have you another idea?
Thanks a lot!Hi Demetrio,
Please have a look at the below weblogs...i hope it will help you to solve ur requirement...
XI:Idoc Message Packages
/people/sravya.talanki2/blog/2005/12/09/xiidoc-message-packages
Collecting IDocs without using BPM
/people/stefan.grube/blog/2006/09/18/collecting-idocs-without-using-bpm
IDOCs (Multiple Types) Collection in BPM
/people/pooja.pandey/blog/2005/07/27/idocs-multiple-types-collection-in-bpm
Thanks,
Aravind.pujari -
Idoc to file(TXT) scenario
Hi all,
i'm working in a idoc-to file scenario. now its working fine and the file has been written in the target directory of the receiver .but its in xml format i need to store it in a TXT format.
In the receiver communication channel configuration i used file content conversion message protocal and also mentioned the FILETYPE as text and FILEENCODING as UTF-8. i maintained content conversion parameters also.
but still i'm getting the file in a XML format. it wouldbe very helpul if anyone could solve this one.
Thanks,
HariHi,
Its really surprizing the to see even after maintaining all the parameters you are getting XML output.
Can you verify the receiv er end structure of Message type
and refer
/people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter - FCC
/people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter - FCC
http://help.sap.com/saphelp_nw04/helpdata/en/ee/c9f0b4925af54cb17c454788d8e466/frameset.htm - cc
http://help.sap.com/saphelp_erp2005vp/helpdata/en/95/bb623c6369f454e10000000a114084/content.htm - fcc cOUNTER
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/da1e7c16-0c01-0010-278a-eaed5eae5a5f - conversion agent
/people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1
/people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2
/people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion
/people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
/people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter
/people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1
/people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2
/people/venkat.donela/blog/2005/06/08/how-to-send-a-flat-file-with-various-field-lengths-and-variable-substructures-to-xi-30
/people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
/people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter
/people/jeyakumar.muthu2/blog/2005/11/29/file-content-conversion-for-unequal-number-of-columns
/people/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem
/people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter
/people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion
http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm
Thanks
Swarup
Edited by: Swarup Sawant on Feb 22, 2008 1:15 PM -
N IDoc s message to one txt file
I have finished IDoc to file scenarios.
If I send n IDocs , there will be n txt files.
Can I just get a TXT file, with one line with one IDoc?
Thanks.hi
Another idea for collecting IDocs consists in using standard functionality of the IDoc. Instead of sending the IDoc directly to the XI via the IDoc adapter, you can download the IDocs gathered in a file with XML format. This file can now be uploaded by the sender file adapter. As the XML structure is the same as the IDoc adapter produces, there is no change of the behaviour of the message, besides there no single IDoc inside, but multiple IDocs instead.
1)As first step you go to WE21 and create an XML file port in the application system. Apply here a function module for creating the file name. You can use a standard module or a self-written module.
2)Schedule report RSEOUT00 with a variant where you assign the IDoc type, the xml port and the number of IDocs which shall be collected.
3)The report collects all IDocs in one file, until the "Maximal number of IDoc" is reached. When you have for example 2400 IDocs and you set "Maximal number of IDoc" to 1000, you receive 3 files, two with 1000 IDocs and one with 400. Inside the file there is one IDoc tag for each IDoc.
Do not gather too many IDocs into one file. The file size should be considered carefully. Too large files might cause memory leaks, when your hardware is not sufficient.
The files can be uploaded by the sender file adapter. When you collect IDocs of the same type, the Mapping can be done the same way as for IDocs processed by the IDoc adapter.
check the blog
/people/stefan.grube/blog/2006/09/18/collecting-idocs-without-using-bpm
Note: reward points if solution found helpfull
Regards
Chandrakanth.k -
How to convert Flat file(.txt) data to an Idoc format(ORDERS05)
Hi,
How to convert Flat file(.txt) data to an Idoc format(ORDERS05). If any FM does the same work please let me know.
thanks in advance,
Chand
Moderator message : Duplicate post locked. Read forum rules before posting.
Edited by: Vinod Kumar on Jul 26, 2011 11:11 AMHi,
For more information, please check this link.
http://sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/46759682-0401-0010-1791-bd1972bc0b8a
Have a look at the FM IDOC_XML_FROM_FILE. May be it helps...
Regards
Maybe you are looking for
-
Problem in using InitialContext to do a lookup of CMP EnitityBean.
Hi, I am running WLS 5.1 SP6 on Windows98. I am trying to lookup a CMP entiry bean from Java 1.3 client. I can successfully create the InitialContext but having trouble in using it to do the lookup. I get the following error: jndiContext is javax.nam
-
Asset Transfer posting ABT1N/post the values between company codes
Hi In ABT1N transaction I changed the Document, posting, asset value date -> this will be the same date 20.12.2010, system gives error message " Account 20900000 does not exist in company code 'abcd'. Please resolve the issue. Thanks, sahara
-
I have a movie that I made myself and exported it as a .MOV file. I've imported it into iTunes. But when I click and drag it to my iPod, it says it "cannot be played on this iPod" So can anyone offer a suggestion?
-
What difference on ABAP language between 2004 version and before version
Hi everyone, Does there exist difference about ABAP language between 2004 version and before version? If it does, what's that? For example, what's new keywords? Which old key words can't be applied on 2004 platform any more? Any suggestion is highly
-
Java for OS X 2012-006 Problem Failed Installation
Hi, I have this problem with my Java for OS X 2012-006. I wanted to use a Java using application, but tells me to install a new version of Java (2012-006). Startup runs fine but then says that the Installation Failed. I tried this multiple times then