Howto transform a Sales Order (idoc) into xml file and download it?

I need to tranform a Sales order into an xml file such that I could download the file onto my disk. I try to transform an IDOC.
I do the following from an example and I get an xml document on screen but I do get get any file downloaded:
DATA: document TYPE REF TO if_ixml_document.
  document = g_ixml->create_document( ).
  DATA: ostream TYPE REF TO if_ixml_ostream.
ostream = g_stream_factory->create_ostream_uri(
  system_id = 'file://C:\test.xml' ).
  DATA: renderer TYPE REF TO if_ixml_renderer, rc TYPE i.
renderer = g_ixml->create_renderer( ostream  = ostream
                                      document = document ).
  rc = renderer->render( ).
  document->render( ostream = ostream  recursive = ' ').
Is there something else I should do? Is there another approach for transforming a sales order to an xml file.
The R/3 4.6 system is used.
Thank you
-eglese-

Hi Eglese,
Another option could be to use XML port configured for the IDOC and use the XML files generated be extracted from Web Dynpro using a file download UI element.
Thanks and Regards,
Sam Mathew

Similar Messages

  • Problem in creatinga sales order idoc into XML file in the same appl server

    Hai....friends....
    I am tring to send an  sales order as iDOC  to a xml port in the same application server....
    1. have created a xml port with path..\usr\sap\RRM\SYS\global\.
    2. assigned it to logical system.
    3.Have a RFC destination of TCP/ip(LOCAL_EXEC)
    but in bd64 after creating  model view when i am generating partner profiles  a tRFC PORT has been automatically created.
    then finally the IDOc has been created but its saying....IDOC CANNOT OR SHOULD NOT BE SENT...
    Pls help me regarding this...
    thx,
    ram

    Hi Thanks for your updates,
    But I got the same error, while pass the data from abap into XML.
    error message,what I am getting is
    The XML page cannot be displayed
    Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
    Invalid at the top level of the document. Error processing resource 'file:///C:/tempcustomers.xml'. Line 1, Position 1
    #<?xml version="1.0" encoding="utf-16"?>
    Thanks
    Gowrishankar

  • Conversion of inbound IDOC into XML file

    Hi experts,
    We have an inbound idoc (FIDCC2) that starts and triggers the creation of an FI document. We would like now, that, instead of creating the FI document, the inbound IDOC creates an XML file on a given directory, with the contents of the idoc. Can anybody explain how to configure this?
    Many thanks in advance,
    John De Coninck.

    John,
       Firstly, need more information. If I understand you correctly, you are getting an inbound FI document that is created as an IDOC and it posts into FI (using an underlying FM/transaction etc). Now you want to convert this IDOC into XML on a folder (which can be found on AL11 (a.k.a App Server)).
    Question 1: Where are you getting this IDOC from? Is it through EDI/ALE? What is your interfacing server (the one that is sending you this IDOC.
    Question 2: What format is this IDOC coming in? Is it flat/XML etc?
    Question 3: Is this an internally created IDOC? Is there an attached partner profile in WE20? If there is a partner profile that exists and you're using this to create the inbound IDOC, then there are process codes available to forward these IDOC's (e.g ED08).
    There are many ways you can achieve this but everything depends on how your system is configured and how this processing is going on.

  • How to Split Single Idoc into 2 files and put some delay

    Hi,
    I have a IDoc to file Scenario. Invoice Idoc to Flat file scenario
    this is a reuse Interface
    Current Scenario we have graphical mapping(used for lookup and dynamic filename, mostly all the field mappings are 1-1) and ABAP Mapping to convert Idoc to flat file, 1 Idoc will generate 1 file.
    In addition to the above case, there is 1 more requirement
    Correction Invoice case. where in I get single Idoc with Multiple Item categories (Original data and Correction data)
    In this case always I need to send two files(2 Idoc data), first Idoc is for Original Idoc and 2nd is Corrected Invoice, these 2 idocs should be sent with some delay.
    In Correction Invoice case, I should generate 2 idocs based on Item category (PSTVY) value.
    Suppose I have 4 E1EDP01 segments out of which PSTVY has value "AA" and "BB" repeated twice as shown below
    <PSTYV>AA</PSTYV>
    <PSTYV>AA</PSTYV>
    <PSTYV>BB</PSTYV>
    <PSTYV>BB</PSTYV>
    So I need to generate 2 Idoc 1 for AA and other for BB.
    If there is no correction Invoice, 1 idoc for 1 file will be generated.
    Am planning to use BPM to delay the idocs and identigy bpm based on Document type else no bpm...
    How do I split the mapping of single Idoc to 2 files based on Item category.
    Thanks,
    Varun

    You can use the multi-mapping to split the message payloads according to business requirement (AA and BB segments values)
    /people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible
    And then send to different receivers by adding the conditions on the Receiver Determination (for example, "field = AA" go to Receiver1, and "field = BB" to to Receiver2).
    http://help.sap.com/saphelp_nwpi71/helpdata/en/26/5ccd3bb4560f01e10000000a11402f/frameset.htm
    Or even Extended (enhanced) receiver determination, should the scenario be more complex:
    http://wiki.sdn.sap.com/wiki/display/XI/EnhancedReceiverDeterminationinSAP+XI

  • Need to create sale order from the flat file & mail has to be sent

    Hi Experts,
              I have a requirement to create a sale order from a flat file and once the oder is created, mail has to be sent to customer as well as to internal user with the order details. I want to know how this process can be implemented and what adapters are needed to execute this.
    it would be very helpful, if i get an step-by-step procedure.
    Points assured for any helpful answers.
    Thanks in Advance
    Jai

    HI Jai,
    You need to create two interfaces as file will be sending the Sales oreder details that you need to capture in IDOC or RFC and then have to trigger to create the sales order. For this Standard BAPIs are also available.
    These RFC or BAPIs will response with Sales order details that you need to divert to Mail adapter with the use of BPM and also have to go for Async to Sync bridge.
    File -
    >XI (BPM) ---> BAPI/RFC  (Request)
    MailAdapter <- XI (BPM) <--- BAPI/RFC (Response)
    For this refer below links for step by step
    /people/arpit.seth/blog/2005/06/27/rfc-scenario-using-bpm--starter-kit - File to RFC
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1685 [original link is broken] [original link is broken] [original link is broken] - File to Mail
    /people/krishna.moorthyp/blog/2005/06/09/walkthrough-with-bpm - Walk through BPM
    /people/siva.maranani/blog/2005/05/22/schedule-your-bpm - Schedule BPM
    /people/sriram.vasudevan3/blog/2005/01/11/demonstrating-use-of-synchronous-asynchronous-bridge-to-integrate-synchronous-and-asynchronous-systems-using-ccbpm-in-sap-xi - Use of Synch - Asynch bridge in ccBPM
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1403 [original link is broken] [original link is broken] [original link is broken] - Use of Synch - Asynch bridge in ccBPM
    If you will use IDOC then In IDOC inbound processing you need to trigger for Sales order creation and then have to send the Sales Order generated IDOC as an Outbound to Mail Adapter
    Flat file -
    > XI ---> IDOC
    IDOC -
    > XI ---> Mail
    This will be bit easy scenario to develope as compare to using BAPI with BPM
    /people/ravikumar.allampallam/blog/2005/06/24/convert-any-flat-file-to-any-idoc-java-mapping - Any flat file to any Idoc
    configuring IDOC-XI-Mail scenario using following web-log:
    /people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address
    /people/sravya.talanki2/blog/2005/08/18/triggering-e-mails-to-shared-folders-of-sap-is-u - Triggering Email from folder
    Thanks
    Swarup

  • Writing into XML File in Flex

    Hi,
    I want to create a XML file (dynamically) and writes data
    into that xml file(data coming from web service).
    Thanks in advance.

    i want to write the data(coming from web service) into XML
    file and keep that XML file in Cache,then read that XML file
    contents and post into UI Control(Datagrid).
    <b>Sample Output Data from my Webservice:</b>
    <CoreProgramming>
    <BasicProgramming>
    <ProductId>10049</ProductId>
    <ProgrammingName>America'sTop60</ProgrammingName>
    <Price>29.99</Price>
    <IncludesLocals>false</IncludesLocals>
    <IncludesRSN>false</IncludesRSN>
    <Listing>
    <CategoryName>WOMEN'SPROG</CategoryName>
    <Station>
    <StationCallLetters>TLC</StationCallLetters>
    <Hdflag>false</Hdflag>
    </Station>
    <Station>
    </Listing>
    </BasicProgramming>
    <BasicProgramming>
    <ProductId>10041</ProductId>
    <ProgrammingName>America'sTop120</ProgrammingName>
    <Price>39.99</Price>
    <IncludesLocals>false</IncludesLocals>
    <IncludesRSN>true</IncludesRSN>
    <Listing>
    <CategoryName>WOMEN'SPROG</CategoryName>
    <Station>
    <StationCallLetters>TLC</StationCallLetters>
    <Hdflag>false</Hdflag>
    </Station>
    <Station>
    <StationCallLetters>DHLTH</StationCallLetters>
    <Hdflag>false</Hdflag>
    </Station>
    <Station>
    <StationCallLetters>DISC</StationCallLetters>
    <Hdflag>false</Hdflag>
    </Station>
    </Listing>
    </BasicProgramming>
    <BasicProgramming>
    <ProductId>10045</ProductId>
    <ProgrammingName>America'sTop180</ProgrammingName>
    <Price>49.99</Price>
    <IncludesLocals>false</IncludesLocals>
    <IncludesRSN>true</IncludesRSN>
    <Listing>
    <CategoryName>WOMEN'SPROG</CategoryName>
    <Station>
    <StationCallLetters>TLC</StationCallLetters>
    <Hdflag>false</Hdflag>
    </Station>
    <Station>
    <StationCallLetters>DIY</StationCallLetters>
    <Hdflag>false</Hdflag>
    </Station>
    <Station>
    <StationCallLetters>LIME</StationCallLetters>
    <Hdflag>false</Hdflag>
    </Station>
    </Listing>
    </BasicProgramming>
    </CoreProgramming>

  • Sales Order iDoc from SAP SCM 7.0

    Hi Experts
    I have two question fro you guys.
    1. Can we generate VMI sales order idoc from SAP SCM 7.0? I know is can generate xml message. If we can generate idoc for VMI sales order from SAP SCM , please give me some direction or path to explore.
    2. Can I use idoc to to create to VMI sales order in ECC skiping CIF. But the changes in ECC to these order should use the CIF to update the VMI orders in SAP SCM.
    Please share your experience on this.

    Hi,
    Did you set up this scenario? I want something similar, but I want an ERP order to be created. Do you know if that is possible? Do you have som tips?
    regards Camilla

  • Sales order idoc error only on ORDCHG message type (ORDERS01)

    Hi. I am adding segment E1EDK04 to our sales order idocs in order to pass tax jurisdiction code to R3. When I create the order (message type ORDERS), I am extracting tax jurisdiction code from the idoc and I am adding it to the ship-to address screen via a BDC table within user exit include zxvedu04. The new order gets saved with the TXJCD, and this works fine.
    I am now testing maintenance scenarios. For ORDCHG message types, I am inserting the TXJCD within user exit include ZXVDBU02. The idoc processor abends in 51 status with message:
    "Control data in the IDoc E1EDK04 has been transferred. Check data".
    If I walk the same status 51 idoc through BALE without changing anything, I see the TXJCD get posted to the order, and the order is saved correctly the second time.
    Does this mean I need to add something additional to the idoc control data on an ORDCHG or something?
    Thank you.
    Brendan

    I was not able to get any farther on this. It would seem that when the idoc is processed in the foreground, something is being populated that is not present when the idoc come across to R3...
    The thing is, when I walk through the idoc in the forground, there are no errors that pop up. I can save the idoc after foreground processing and it moves into 53 status.
    Thanks for any ideas that you might have on how to gather more infromation.

  • Set type problem in sales order integrated into loyalty management

    Hi experts,
    I try to implement the sales order integrated into loyalty management. As notes said, I should use the set type REWARD_PRO_LOY to assign to a hierarchy for loyalty. But when I use this set type in hierarchy, I found I can only assign it when I choose "service" for product type. Then I find in the "REWARD_PRO_LOY" set type, there is a switch tab. In the tab, there is only "services". I don't understand this tab means. I want to assign this set type to "materials" type. I tried to created a new set type with the same attributes, but it seemed not to work. Is anybody can give me some advice to solve the problem?
    Thanks a lot,
    Best Regards,
    Molly Xin

    Hi Molly Xin,
    If you refer to your first screen print, its very evident that the product types with which products be created using this set type includes both "Materials" and Services".
    We have created similar scenario and were able to create products with product type "Materials".
    Pease let me know if you have any issues while creating products with product type "Materials".
    Regards

  • How to transfer sales order idoc from R/3 to CRM

    Hi,
          I want to generate the sales order idoc in R/3 (ORDERS) and replicates to CRM through XIF adapter.
    The sales documents are not realy existing in R/3. We can only get the information from related biling documents and try to gerenate ORDERS idoc.
    The problem is how to map R/3 idoc to CRM idoc(CRMXIF_ORDER_SAVE_M01). The administration console seems can only send the idocs but not receiving them.
    Thanks,
    Ina

    Hello Yina,
    Can you please answer the questions? I am a little bit confused.
    If you don't have the order in R/3, are you not going to create one when creating the ORDERS IDoc? If yes, then this order will go to CRM automatically if you have the middleware set properly.
    If you are NOT creating any order in R/3 during the IDoc step, Why would you want the order in CRM when you don't have it in R/3?
    Are you not going to keep the middleware between R/3 and CRM open? If you keep it open, the order from CRM will crossover to R/3 - in which case you could have created the order in R/3 in the first step itself !!!
    If you are not keeping the middleware open between R/3 and CRM - I don't know why would you want to keep the orders in CRM, but not in R/3. Is it because of lack of good CRM consultants in the project?
    Easwar Ram
    http://www.parxlns.com

  • No batch input data for screen SAPMSSY3 0131 in Sales order IDOC

    I am processing Sales order IDOCS in status 64 using RBDAPP01 .Some of them error out to status 51 with the message -
    No batch input data for screen SAPMSSY3 0131 .
    I know the standard IDOC inbound process tries to simulate the posting in a BDC like process.
    Now, I went to we19 and the screen hangs up in a pop up in the partners tab with partner type 'WE' and my shipto (which is actually filled in the IDOC), missing..upon repeatedly hitting enter, it goes thru and an idoc is posted in status 53. But still unable to get through the root of this issue.
    Any, insight will help.

    Hi,
    I think the pop-up is generated through and user-exit for which recording is missing. This is why your idoc stays in status 64...
    Handle the screen recording in the user exit IDOC_INPUT_ORDERS
    user exit routine
    PERFORM customer_function_dynpro.
    FORM CUSTOMER_FUNCTION_DYNPRO.
      CALL CUSTOMER-FUNCTION '002'
        EXPORTING DXVBAK   = XVBAK
                  DVTCOMAG = VTCOMAG
                  DLAST_DYNPRO = LAST_DYNPRO
                  DXMESCOD = IDOC_CONTRL-MESCOD
        TABLES    DXBDCDATA = BDCDATA
                  DXVBAP    = XVBAP
                  DXVBEP    = XVBEP
                  DYVBEP    = YVBEP
                  DXVBADR   = XVBADR
                  DYVBADR   = YVBADR
                  DXVBPA    = XVBPA
                  DXVBUV    = XVBUV
                  DIDOC_DATA = IDOC_DATA
                  DXKOMV    = XKOMV
                  DXVEKP    = XVEKP
                  DYVEKP    = YVEKP
        EXCEPTIONS
                  USER_ERROR = 01.
    Regards,
    Krishnakumar

  • Error in Sales Order idoc - No appropriate entry found in table ADRT

    Hello SAP Gurus,
    When I am retriggering a sales order idoc I am getting the following error message.
    No appropriate entry found in table ADRT
    How can I resolve this issue.
    Thanks,
    Narayan.

    Hello Lakshmipati,
    I have checked up the customer master. There was no communication method maintained for any of the customers.
    But even then the order idoc is triggered to our XI system.
    For the one that failed I have maintained the communication method and retriggered again. It had the same failure message.
    Any helpful thoughts is highly appreciated.
    Thanks & Regards,
    Narayan.

  • How can attach a sales order link into an Internal Mail - Workplace.

    Hello, is there somebody can give me some tips to do this.
    I need to attach a link of a sales order into a message of an internal mail (workplace).
    When a sales order is blocked by credit, one mail sent to the representative credit manager.
    The subject of the mail already have the number of the sales order (&VBAK-VBELN&), BUT I don't know how to attach the link of a sales order. The idea is the user that  will read the mail can clic the link to display the sales order.
    Thanks for your help,
    JEOS.

    Hi Jeos
    While maintaining condition record VV11 with transmission medium Internal Mail  you will get the option attach file then you can attach that file and send internally to the other user . But you cant attach the sales order , you convert the sales order data into an excel file and then upload that excel file and then send to the other user
    Regards
    Srinath

  • Conversion of idoc into xml without  XI

    Hi everyone
    i am working on EDI i want to know procedure to convert our idoc into XML without using XI. is it possible, if yes then plz reply me with procedure.
    Thanks & Regards
    Vimarsh

    Hi Nicolai
    Thanks for ur suggestion, i have one more doubt regarding this, i got this program to convert my records in XML but whatever output i m getting that comes in form of excell sheet, i am sending you that program which not working,
    report zexternalfile .
    tables : zzpublisher,
    sscrfields.
    data: it_publisher like standard table of zzpublisher,
    wa_publisher like zzpublisher.
    select * from zzpublisher into table it_publisher.
    call function 'GUI_DOWNLOAD'
    exporting
    BIN_FILESIZE =
    filename = 'C:\externalfiles\kamal.XLS'
    FILETYPE = 'ASC'
    APPEND = ' '
    write_field_separator = 'X'
    HEADER = '00'
    TRUNC_TRAILING_BLANKS = ' '
    WRITE_LF = 'X'
    COL_SELECT = ' '
    COL_SELECT_MASK = ' '
    DAT_MODE = ' '
    IMPORTING
    FILELENGTH =
    tables
    data_tab = it_publisher
    EXCEPTIONS
    FILE_WRITE_ERROR = 1
    NO_BATCH = 2
    GUI_REFUSE_FILETRANSFER = 3
    INVALID_TYPE = 4
    NO_AUTHORITY = 5
    UNKNOWN_ERROR = 6
    HEADER_NOT_ALLOWED = 7
    SEPARATOR_NOT_ALLOWED = 8
    FILESIZE_NOT_ALLOWED = 9
    HEADER_TOO_LONG = 10
    DP_ERROR_CREATE = 11
    DP_ERROR_SEND = 12
    DP_ERROR_WRITE = 13
    UNKNOWN_DP_ERROR = 14
    ACCESS_DENIED = 15
    DP_OUT_OF_MEMORY = 16
    DISK_FULL = 17
    DP_TIMEOUT = 18
    FILE_NOT_FOUND = 19
    DATAPROVIDER_EXCEPTION = 20
    CONTROL_FLUSH_ERROR = 21
    OTHERS = 22
    if sy-subrc 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    IF YOU HAVE ANY OTHER OPTION THEN PLEASE SEND ME, I WILL BE VERY THANKFUL FOR YOU.
    PLEASE SEND ME WHOLE PROCEDURE IF YOU CAN.
    THANKS & REGARDS
    VIMARSH

  • What is the t.code for convert Idoc into XML schema

    Hi all,
       How to convert IDOC as XML schema?
    there is one T.code is there for convert IDOC into Xml schem ,I  forgot that,
    plz tell me if anybody knows that t.code. Very Urgent
    Thanks in Advance
    rambabu.A

    WE60
    Let me know if you need any other help with that.
    Best Regards,
    Steve Hardeman

Maybe you are looking for

  • Using java class from JSP page

    I have a class that connects to the database and return the result in form of array of objects, now I wrote a tester and I was able to print the result on the console but when it came to JSP how can I use this class I am a bit confused, how can I dec

  • Mac to Pc bonjour videoconference

    hi you all, i don't know if this can be done but, does anyone know how to videoconference between a Mac and a Pc with bonjour? meaning no internet, just the local network. Thanks

  • Reversal Indicator Field in View

    Hi All, I have created a View on VBAK, VBAP,VBKD, VBEP tables. DO i need to maintain reversal indicator field in This view. Can any body suggest me on this. Regards, Sri

  • Crash when using Invoke Method: Library:Deploy Library

    I'm trying to set a library of shared variables to deploy when a VI runs. When using the method to deploy a library, Labview will crash with no error log. I am able to use Library.Open to, for example, HiliteInProjectWindow, and Library.GetFileLVVser

  • HT4926 If I download Final Cut Pro X, can I move it or re-download it to a new machine later?

    If I download FCP X, can I move it to another machine later? I'm thinking of buying a new machine, but don't want to wait until then for the software.