Anyone know how to output an XML file from ABAP to a non sapgui location?

I have a program that creates XML and then outputs a file via CALL METHOD cl_gui_frontend_services=>gui_download. But now I want to execute the program in background mode and therefore I need to be able to output that XML to a NON sapgui file location. Current code creates the XML to an internal table which is binary then the gui_download method converts that to output XML. .  Does anyone know how I can change the code to either a) output the XML to an internal table which can be output via, say, a TRANSFER command..or, b) output the created binary table of XML to a NON sapgui file location?
Excerpts from current code are as follows:
first the XML is created (to the binary file)
      Creating a ixml factory
  l_ixml = cl_ixml=>create( ).
      Creating the dom object model
  l_document = l_ixml->create_document( ).
      Fill root node with value XML
  l_element_xml  = l_document->create_simple_element(
              name = 'XML'
              parent = l_document ).
      Create tag 'HEADER' as child of 'XML'
  l_element_header  = l_document->create_simple_element(
              name = 'HEADER'
              parent = l_element_xml  ).
header information about the file and general data about the fleet follows
  l_value = c_fleet_import.
  l_element_dummy  = l_document->create_simple_element(
            name = 'TYPE'
            value = l_value
            parent = l_element_header ).
etc.......
then the xml is connected to the stream factory and rendered
  Creating a stream factory
  l_streamfactory = l_ixml->create_stream_factory( ).
  Connect internal XML table to stream factory
  l_ostream = l_streamfactory->create_ostream_itable( table = l_xml_table ).
  Rendering the document
  l_renderer = l_ixml->create_renderer( ostream  = l_ostream
                                        document = l_document ).
  l_rc = l_renderer->render( ).
  Saving the XML document
  l_xml_size = l_ostream->get_num_written_raw( ).
and then output to the file
  IF sy-subrc = 0.
    CALL METHOD cl_gui_frontend_services=>gui_download
       EXPORTING
         bin_filesize = l_xml_size
        filename     = 'g:\sapdms\BSCC-DEV\EFPAC XML Files\ALL.xml'
       filename     = '/TRICK/727/OUT/ZEFP/EFPAC.XML' "doesnt work with sap gui
         filetype     = 'BIN'
       CHANGING
         data_tab     = l_xml_table
       EXCEPTIONS
         OTHERS       = 24.
as implied by the comments the method above will successfully output the XML file to the g:drive but will not output to /TRICK/ location, which is where I need it to go in a background mode run.
This is a problem which has defeated all our local expertise and I would appreciate any help given... Barry Jones

Try this code below:
data  l_xml_table2  type table of xml_line with header line.
W_filename - This is a Path.
  if w_filename(02) = '
    open dataset w_filename for output in binary mode.
    if sy-subrc = 0.
      l_xml_table2[] = l_xml_table[].
      loop at l_xml_table2.
        transfer l_xml_table2 to w_filename.
      endloop.
    endif.
    close dataset w_filename.
  else.
    call method cl_gui_frontend_services=>gui_download
      exporting
        bin_filesize = l_xml_size
        filename     = w_filename
        filetype     = 'BIN'
      changing
        data_tab     = l_xml_table
      exceptions
        others       = 24.
    if sy-subrc <> 0.
      message id sy-msgid type sy-msgty number sy-msgno
                 with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    endif.

Similar Messages

  • Does anyone know how to convert an XML file to a readable file?

    All,
    I have been using an APP called "SMS Backup & Restore" to backup my message conversations to my Laptop PC.  It works fine BUT the backup file, once in my PC, has an XML extent such as "filename.XML"
    I would like to read and/or print and/or save the text message file so does anyone know how to convert the XML file to something else so it shows all the messages without all the formatting instructions.   
    When I try to see the XML file it shows all the formatting.  If I replace the .XML with .TXT that too shows all the formatting mixed in with the text message narrative.
    When I look at the XML file in SMS Backup & Restore in the Charge phone it looks great showing all the messages just as they were on the phones display.  The problem with this is that there is no way to print or read or save the messages as they appear in the file from the phone itself.  I tried screen capture but if you have, let's say, a 28 message conversation you have to do 7 or 8 screen captures to get them all.
    If only I could convert the XML in my PC to something that is printable or savable or readable that would be the "cats meow."
    Anyone know how???
    JerryF
    PS, You might take a look at my related post.
    https://community.verizonwireless.com/message/809832#809832

    Ann154,
    You were correct again.  I deleted everything I had done to date and re-did the entire SMS backup of my 28 message conversation again and YES I was able to open it using IE-8.  It looks great and it prints great and life is good!  I am going to go make a donation.
    Thanks again for the help.  I marked this thread as answered by you.
    JerryF

  • Anyone know how to upload the HTS files from 3rd party provider to GTS??

    We are having following files provided by 3rd party provider - CUSTOMS Info
    NAFTA ROO
    U.S. HTS
    Per provider, SAP has developed a system so that GTS users can automatically reclassify items that are effected by a change and they have asked us to program the HS data needed.
    Anyone know how to do that?
    Please advise,
    Appreciated.

    Hi Reddy,
    Thanks for your input firstly, and i still need ur advise on the HTS upload.
    1. Below is the HTS files provided by 3rd party company. and I noticed that there is 3 types of files. "DTR" , "Nom" and "Txt". Could you explain what are they? and If I need to upload them seperately?
    2. Follow the procedure your provided - "classification > upload manually HTS codes into GTS system"  Actually, I didn't find upload mannually HTS codes into GTS  IN THE SAP CUSTOM Managment.
    I tried "Load Traiff Code Numbers from XML files" and "Load Commodity code from XML file".
    1) "Load Traiff Code Numbers from XML files"
    2) "Load Commodity code from XML file".
       a)  Select all files.
            - fill in "Data Provider",
            - "XML Files"-All files selected.
            - check " Output list", "simulation mode" "Nomenclature Active" and "Activate All Text Types"
            - no "Alternative Numbering Scheme" selected, and other selected.
            Error msg found:
            - Unable to find any defined structures for tariff assignment rule set "_DHSCN"
            - Incorrect order. Enter the first file(see long text)
        b)   only select "HSCN_Txt_I_00002001001.xml", the other is the same like bove.
              1. prompted to select a "From-Time Zone",   Select "UTC+8"
              2. Simulation was carried out successfully
        c)  only select "HSCN_Nom_I_00002001002.xml", the other is the same like above.
              But I meet error for this file:  "Incorrect order. Enter the first file(see long text)"
        d)  only select "HSCN_DTR_I_00002001007.xml", the other is the same like above.
              meet error msg:
              "Unable to find any defined structures for tariff assignment rule set "_DHSCN""
    HTS xml files of China from  3rd party provider
    +++++++++++++++++++++++++++++++++++++++++++++++++++
    2008-05-02  10:53         7,483,730 HSCN_DTR_I_00002001007.xml
    2008-05-02  10:53         7,980,857 HSCN_DTR_I_00002002007.xml
    2008-05-02  10:53         7,765,896 HSCN_DTR_I_00002003007.xml
    2008-05-02  10:53         7,605,204 HSCN_DTR_I_00002004007.xml
    2008-05-02  10:53         7,743,890 HSCN_DTR_I_00002005007.xml
    2008-05-02  10:54         8,007,036 HSCN_DTR_I_00002006007.xml
    2008-05-02  10:54         3,883,316 HSCN_DTR_I_00002007007.xml
    2008-05-02  10:51         6,087,448 HSCN_Nom_I_00002001002.xml
    2008-05-02  10:51         4,955,900 HSCN_Nom_I_00002002002.xml
    2008-05-02  10:50           260,960 HSCN_Txt_I_00002001001.xml
    +++++++++++++++++++++++++++++++++++++++++++++++++++

  • Is anyone know how to create dynamic pdf file from a JSP page or Servlet ?

    Hi
    Is any one know how to create a dynamic PDF file from JSP or servlet. I need to have standard form format needs to be created and want to send the info to that form dynamically.
    Is there any libraries available?
    Thanks

    I posted a link in this thread to a lib that lets you create PDFs from an app. They have a Java version. I have not used it but I know someone who used it with Microsoft ASP and they liked it.
    http://forum.java.sun.com/thread.jsp?forum=31&thread=287285
    -S-

  • Does anyone know how to remove books/ePub files from iTunes

    Hi.
    I need help.
    I read a lot of book from my iPad.
    I have no problem gelting my books from iTunes to iPad. Problem is, now there is lot lot of books in iTunes, and tis difficult to figure out which i havnet read. So how do i remove them from iTunes. Hope there is a way.

    Hello Zentha,
    You can definitely delete the books from iTunes!  It is the same as deleting anything else from iTunes:
    Delete an item from your library
    Click the item to select it, and press the Delete key.
    Click Delete Item.
    Do one of the following:
    Remove the item only from your iTunes library: Click Keep File.
    Delete the item from your computer: Click Move to Recycle Bin. The item is removed the next time you empty the Recycle Bin.
    You can find the full article here:
    iTunes 11 for Windows: Delete songs, playlists, or other items
    http://support.apple.com/kb/PH12359
    Thank you for posting in the Apple Support Communities!
    Best,
    Sheila M.

  • Does anyone know how to move a .mp4 file from flixter into iTunes?

    I have downloaded a digital copy of a movie that I received when I purchased a Bluray disc.  Most of the time, these go directly into iTunes, but this one went into Flixter.  It is an .mp4 file.  I tried using Add File to Library, but it didn't work.  Any suggestions?
    Thanks!

    Never mind - got it figured out!!

  • Does anyone know how i can view PDF files using Galaxy Note 2?

    Does anyone know how i can view PDF files using Galaxy Note 2?
    This is what i have been doing;
    I click on the file i wish to view (via a portal)
    this file goes to notification widget (i drag down screen)
    notification/message says download complete
    i click on notification/message
    nows it says complete action using (here i only have 2 icon options 1= DB Text Editor 2 = HTML Viewer)
    I have installed Adobe Reader.

    Can you confirm if the downloaded file is a pdf file, that is it ends with .pdf?

  • Does anyone know how to get a preflight file signed by apple for the 21 mac

    does anyone know how to get a preflight file signed by apple for the 21 mac

    im trying to get a hold of them to see if they can deauthorize a computer. I am unable to do it because i can't get the internet to hook up. And i got a new laptop that i get the internet on but i can't authorize it unless i deauthorize the other one. i've called apple 3 times and theyve not been very helpful saying i need to get  hold of itunes.

  • Does anyone know how to open a .shs file on Word 2008 for Mac? Any ideas??

    Does anyone know how to open a .shs file on Word 2008 for Mac? Any ideas??

    Ask on the Microsoft Mac forums:  http://answers.microsoft.com/en-us/mac

  • Hello Anybody, I have a question. Can any of you please suggest me how to make an xml file from the database table with all the rows? Note:- I am having the XSD Schema file and the resulted XML file should be in that XSD format only.

    Hello Anybody, I have a question. Can any of you please suggest me how to make an xml file from the database table with all the records?
    Note:- I am having the XSD Schema file and the resulted XML file should be in that XSD format only.

    The Oracle documentation has a good overview of the options available
    Generating XML Data from the Database
    Without knowing your version, I just picked 11.2, so you made need to look for that chapter in the documentation for your version to find applicable information.
    You can also find some information in XML DB FAQ

  • Does anyone know how to delete credit card details from an Apple account?

    Hi not sure if this is posted in the right place but i'll give it a go anyway.
    Would anyone know how to delete credit card details from an Apple account?
    Someone posted selecting 'none' in the payment section would work but i logged into my account online on a computer there aren't any options at all to do this.
    I tried hitting edit but there isn't a delete button.
    If anyone knows any help would be most appreciated!
    -F

    Answer should be here:
    https://discussions.apple.com/message/12832322#12832322

  • Anyone know how to stop the "activate" box from blocking usage of a perfectly legal copy of Ilisten? I want to help my dyslexic grandson and this box, including the activation code, keeps popping up, keeping me from using the software. I activated the pro

    Anyone know how to stop the "activate" box from blocking usage of a perfectly legal copy of Ilisten? I want to help my dyslexic grandson and this box, including the activation code, keeps popping up, keeping me from using the software. I activated the program and did a few profile building sessions, now it pops up each time I start the program, blocking me from using it. Help sure would be appreciated.
    Jay

    I looked at your post this morning and did not know enough to respond, other than to find out that links to iListen now go to newer, renamed software. Considering it's been nine hours with no response, I'm suspecting few people here have experience with that software. You could contact the current copmany that used to sell that package and see if they have any archived support info.
    BTW: please check you entry for "Mac OS" in your profile. It says iOS, which cannot run on an iMac. iOS is the system for phone and iPads but can't run on Mac computers. Do "About this Mac" from the Apple menu and see what it says about the OS version. Should look like this:
    If the "Processor" line says "Intel," you have a newer Mac than the old modles this forum covers; Intel iMac have their very own forum here:
    iMac (Intel)

  • Does anyone know when Aperture will support RAW files from the Canon Eos 7D mkii?

    Does anyone know when Aperture will support RAW files from the Canon Eos 7D mkii?

    Only Apple knows. The never announce upcoming RAW support in advance, sorry. And if anybody knew, it would not be allowed to post this information here.

  • Do anybody know how to change a PNG file from 1760 width by 1369 height to 800 x 600?

    Do anybody know how to change a PNG file from 1760 width by 1369 height to 800 x 600?

    Crop to 4x3 aspect ratio, then resize to 800x600

  • Does anyone know how to down load a photo from the ipad2 to an amazon seller account to sell an item?  Do I have to download an app for this?

    Does anyone know how to down load a photo from the ipad2 to an amazon seller account to sell an item?  Do I have to download an app for this?

    You can use 3rd party apps like Photo Transfer App.
    http://i1224.photobucket.com/albums/ee374/Diavonex/Album%205/79b3173fda7b6a6e148 5b463198f6acf.jpg

Maybe you are looking for

  • Deployment of product in Oracle 10g Express Edition

    Hello guys: I  developed a web application   with PHP 5  + Oracle 10g Express Edition . If I want sell my application  ( using as database Oracle 10g XE)   to one  big enterprise , I must buy a licence  or it is not necesary. Thanks for your help.

  • Adobe Flash Player not installing after downloading

    Windows Vista Firefox 25.0.1 Flash Player 11.3 My Firefox browser has a red symbol that says "Outdated Adobe Plug-in" Block or continue allowing? Or another time it says to update. It takes me to the download centre, I download the flash, install it

  • Output device for adobe forms

    Hi, Pls let me know which ouput device should be used for adobe document services documnet(adobe froms). I'm unable to view the ouput. Also pls tell me how to configure the output device in SPAD. regards, ravi valluri

  • Application Server kicks users out of forms based app with FRM-92102 error

    We are running the Retek application with application server(9.0.4.0) which is serving forms out to our users. We are currently receiving the following error after users connect to the web based forms application: FRM-92102: A Network Error has occur

  • Spam term "number of hits"?

    I am trying to understand this underpinning of combatting spam, referring to the "number of hits required before mail is considered spam." What does it mean? "Number of hits?" Thanks.