<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Create XML on SAP in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-xml-on-sap/m-p/6362901#M1400687</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you changed the .txt to .XML format ? If yes the XML file will be downloaded into &lt;/P&gt;&lt;P&gt;the path that you have mentioned. Maybe any number. If you want any name specification&lt;/P&gt;&lt;P&gt;for each XML file tht u have downloaded then jus use the below line,,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate  'C:\' docnum sy-datum sy-uzeit '.xml' into filename SEPARATED BY SPACE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now in C: drive may be how many number of XML files you download they will be with unique&lt;/P&gt;&lt;P&gt;Docnum with date and time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Make me clear of this Line "&lt;STRONG&gt;My problem is generating file like this name in TXT.&lt;/STRONG&gt;" wht actually you mean &lt;/P&gt;&lt;P&gt;by this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;VEnk@&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Venkat Reddy on Nov 17, 2009 6:26 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Nov 2009 12:53:50 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-11-17T12:53:50Z</dc:date>
    <item>
      <title>Create XML on SAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-xml-on-sap/m-p/6362896#M1400682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi friends! I need some help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm creating an XML file with the code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;g_ixml = cl_ixml=&amp;gt;create( ).

g_document = g_ixml-&amp;gt;create_document( ).

lote = g_document-&amp;gt;create_simple_element(
                   name = 'NF'
                   parent = g_document ).

nfnum = g_document-&amp;gt;create_simple_element(
                               name  = 'nfnum'
                               value = '999999999'
                               parent = lote ).

*   Creating a stream factory and streams
g_streamfactory = g_ixml-&amp;gt;create_stream_factory( ).

g_encoding = g_ixml-&amp;gt;create_encoding(
                      character_set = c_encoding
                      byte_order = if_ixml_encoding=&amp;gt;co_little_endian ).

* Rendering into a table-based stream
g_ostream = g_streamfactory-&amp;gt;create_ostream_itable( xml_table ).

g_ostream-&amp;gt;set_encoding( encoding = g_encoding ).

g_renderer = g_ixml-&amp;gt;create_renderer( ostream  = g_ostream
                                      document = g_document ).
g_rc = g_renderer-&amp;gt;render( ).

* use only the first xml_size bytes of the xml table!!
xml_size = g_ostream-&amp;gt;get_num_written_raw( ).

data: v_file type string.

concatenate 'C:\' 'FUL01' '.txt' into v_file.

call method cl_gui_frontend_services=&amp;gt;gui_download
  EXPORTING
    bin_filesize = xml_size
    filename     = v_file
    filetype     = 'BIN'
  CHANGING
    data_tab     = xml_table.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's worked, but all tags is writed in same line:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&amp;lt;NF&amp;gt;&amp;lt;nfnum&amp;gt;999999999&amp;lt;/nfnum&amp;gt;&amp;lt;/NF&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I want something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;
             &amp;lt;NF&amp;gt;
                    &amp;lt;nfnum&amp;gt;999999999&amp;lt;/nfnum&amp;gt;
             &amp;lt;/NF&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I do this? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Nov 2009 12:13:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-xml-on-sap/m-p/6362896#M1400682</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-17T12:13:10Z</dc:date>
    </item>
    <item>
      <title>Re: Create XML on SAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-xml-on-sap/m-p/6362897#M1400683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of concatenate 'C:\' 'FUL01' '.txt' into v_file. Try to give concatenate 'C:\' 'FUL01' &lt;STRONG&gt;'.xml'&lt;/STRONG&gt; into v_file.&lt;/P&gt;&lt;P&gt;I mean replace .txt with .xml and check how it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically when we download the xml file when it is XML format then we will get the output as expected by you&lt;/P&gt;&lt;P&gt;since the format will be taken care by .XML itself.&lt;/P&gt;&lt;P&gt;Hope this will resolve your issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;VEnk@&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Venkat Reddy on Nov 17, 2009 5:56 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Venkat Reddy on Nov 17, 2009 6:12 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Nov 2009 12:25:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-xml-on-sap/m-p/6362897#M1400683</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-17T12:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: Create XML on SAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-xml-on-sap/m-p/6362898#M1400684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for quick reply Venkat Reddy!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I done this and opend in IE8 and work fine, but I have a problem. The legacy system that I'll export want a XML format, but in a TXT filename, because of this I'm downloading with a TXT extension.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know if I sent it into a single line if it will work...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Nov 2009 12:42:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-xml-on-sap/m-p/6362898#M1400684</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-17T12:42:51Z</dc:date>
    </item>
    <item>
      <title>Re: Create XML on SAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-xml-on-sap/m-p/6362899#M1400685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not completely sure, but may be this method will help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;g_ostream-&amp;gt;set_pretty_print( ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Nov 2009 12:42:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-xml-on-sap/m-p/6362899#M1400685</guid>
      <dc:creator>Petr_Plenkov</dc:creator>
      <dc:date>2009-11-17T12:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: Create XML on SAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-xml-on-sap/m-p/6362900#M1400686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried this but in TXT still in one line only. When I rename to .XML and open in IE8 works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have here sample of the file of legacy system in .TXT:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;			
&amp;lt;reqNFeEmi xmlns="http://www.synchro.com.br/nfe" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.synchro.com.br/nfe
synNFeEmissaoRequest_v1.10.xsd" versao="1.10"&amp;gt;
	&amp;lt;sistOrigem&amp;gt;FATURAMENTO&amp;lt;/sistOrigem&amp;gt;
	&amp;lt;idLoteOrigem&amp;gt;0&amp;lt;/idLoteOrigem&amp;gt;
	&amp;lt;NFe&amp;gt;
		&amp;lt;infNFe versao="1.10"&amp;gt;
			&amp;lt;ide&amp;gt;
				&amp;lt;cUF&amp;gt;35&amp;lt;/cUF&amp;gt;
				&amp;lt;natOp&amp;gt;String&amp;lt;/natOp&amp;gt;
				&amp;lt;indPag&amp;gt;0&amp;lt;/indPag&amp;gt;
				&amp;lt;mod&amp;gt;55&amp;lt;/mod&amp;gt;
				&amp;lt;serie&amp;gt;1&amp;lt;/serie&amp;gt;
				&amp;lt;nNF&amp;gt;420051&amp;lt;/nNF&amp;gt;
				&amp;lt;dEmi&amp;gt;2009-09-20&amp;lt;/dEmi&amp;gt;
				&amp;lt;dSaiEnt&amp;gt;2009-09-20&amp;lt;/dSaiEnt&amp;gt;
				&amp;lt;tpNF&amp;gt;1&amp;lt;/tpNF&amp;gt;
				&amp;lt;cMunFG&amp;gt;3550308&amp;lt;/cMunFG&amp;gt;
				&amp;lt;tpImp&amp;gt;2&amp;lt;/tpImp&amp;gt;
				&amp;lt;tpEmis&amp;gt;N&amp;lt;/tpEmis&amp;gt;
				&amp;lt;chaveOrigem&amp;gt;cv420051&amp;lt;/chaveOrigem&amp;gt;
			&amp;lt;/ide&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I change extension to .XML and open in IE8, works fine to, like my file renamed to.XML. My problem is generating file like this name in TXT.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Nov 2009 12:51:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-xml-on-sap/m-p/6362900#M1400686</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-17T12:51:12Z</dc:date>
    </item>
    <item>
      <title>Re: Create XML on SAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-xml-on-sap/m-p/6362901#M1400687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you changed the .txt to .XML format ? If yes the XML file will be downloaded into &lt;/P&gt;&lt;P&gt;the path that you have mentioned. Maybe any number. If you want any name specification&lt;/P&gt;&lt;P&gt;for each XML file tht u have downloaded then jus use the below line,,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate  'C:\' docnum sy-datum sy-uzeit '.xml' into filename SEPARATED BY SPACE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now in C: drive may be how many number of XML files you download they will be with unique&lt;/P&gt;&lt;P&gt;Docnum with date and time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Make me clear of this Line "&lt;STRONG&gt;My problem is generating file like this name in TXT.&lt;/STRONG&gt;" wht actually you mean &lt;/P&gt;&lt;P&gt;by this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;VEnk@&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Venkat Reddy on Nov 17, 2009 6:26 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Nov 2009 12:53:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-xml-on-sap/m-p/6362901#M1400687</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-17T12:53:50Z</dc:date>
    </item>
    <item>
      <title>Re: Create XML on SAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-xml-on-sap/m-p/6362902#M1400688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think xml in one line is normal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use Microsoft XML Notebook2007 for viewing and maintenance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with kind regards&lt;/P&gt;&lt;P&gt;Walter Habich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Nov 2009 13:00:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-xml-on-sap/m-p/6362902#M1400688</guid>
      <dc:creator>former_member435013</dc:creator>
      <dc:date>2009-11-17T13:00:44Z</dc:date>
    </item>
    <item>
      <title>Re: Create XML on SAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-xml-on-sap/m-p/6362903#M1400689</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry! I will try to be more cleary. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The file has to have extension ".TXT" to legacy system process it, but the internal structure have to be XML. In sample of legacy system that I posted, the file has extension ".TXT", so, when I open it on notepad the xml code is Ok, indented TAGs like when I open in IE8. Bellow the file NF00232.TXT:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;			
&amp;lt;reqNFeEmi xmlns="http://www.synchro.com.br/nfe" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.synchro.com.br/nfe
synNFeEmissaoRequest_v1.10.xsd" versao="1.10"&amp;gt;
	&amp;lt;sistOrigem&amp;gt;FATURAMENTO&amp;lt;/sistOrigem&amp;gt;
	&amp;lt;idLoteOrigem&amp;gt;0&amp;lt;/idLoteOrigem&amp;gt;
	&amp;lt;NFe&amp;gt;
		&amp;lt;infNFe versao="1.10"&amp;gt;
			&amp;lt;ide&amp;gt;
				&amp;lt;cUF&amp;gt;35&amp;lt;/cUF&amp;gt;
				&amp;lt;natOp&amp;gt;String&amp;lt;/natOp&amp;gt;
				&amp;lt;indPag&amp;gt;0&amp;lt;/indPag&amp;gt;
				&amp;lt;mod&amp;gt;55&amp;lt;/mod&amp;gt;
				&amp;lt;serie&amp;gt;1&amp;lt;/serie&amp;gt;
				&amp;lt;nNF&amp;gt;420051&amp;lt;/nNF&amp;gt;
				&amp;lt;dEmi&amp;gt;2009-09-20&amp;lt;/dEmi&amp;gt;
				&amp;lt;dSaiEnt&amp;gt;2009-09-20&amp;lt;/dSaiEnt&amp;gt;
				&amp;lt;tpNF&amp;gt;1&amp;lt;/tpNF&amp;gt;
				&amp;lt;cMunFG&amp;gt;3550308&amp;lt;/cMunFG&amp;gt;
				&amp;lt;tpImp&amp;gt;2&amp;lt;/tpImp&amp;gt;
				&amp;lt;tpEmis&amp;gt;N&amp;lt;/tpEmis&amp;gt;
				&amp;lt;chaveOrigem&amp;gt;cv420051&amp;lt;/chaveOrigem&amp;gt;
			&amp;lt;/ide&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I open in notepad show this and not in one line like mine. So I'm trying to generate a file with extension .TXT, but the internal in XML like sample above.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Nov 2009 13:07:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-xml-on-sap/m-p/6362903#M1400689</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-17T13:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: Create XML on SAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-xml-on-sap/m-p/6362904#M1400690</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;method set_pretty_print

This method specifies whether the stream should suppress new-lines and indentation for the output.

interface

if_ixml_ostream

parameters

pretty_print [ default 'X' ]

False, if the new-lines and indentation should be suppressed, true otherwise.

abap signature

method set_pretty_print

importing

pretty_print type boolean default 'X'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Nov 2009 14:29:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-xml-on-sap/m-p/6362904#M1400690</guid>
      <dc:creator>rainer_hbenthal</dc:creator>
      <dc:date>2009-11-17T14:29:57Z</dc:date>
    </item>
  </channel>
</rss>

