Generating Deeply nested XML from a flat file

Hi All,
I am working on a MQ to IDOC scenario.
I am getting a flat file as input. I need to convert it into XML( so that XI can understand it).
But conversion is into a "Deeply Nested XML from a Flat File" at sender side (JMS Adapter).
Any inputs on this.
Regards,
Vikas

You can only convert flat file into xml structure with 3 levels.
If you need to convert flat file into deep nested xml structure, you have to do java mapping or xslt or abap mapping. There is a tool, I think it's called conversion agent by itemfield (bought by SAP), which can do pretty everything with conversion. Never used it though.
Jayson

Similar Messages

  • How to load data from a  flat file which is there in the application server

    HI All,
              how to load data from a  flat file which is there in the application server..

    Hi,
    Firstly you will need to place the file(s) in the AL11 path. Then in your infopackage in "Extraction" tab you need to select "Application Server" option. Then you need to specify the path as well as the exact file you want to load by using the browsing button.
    If your file name keeps changing on a daily basis i.e. name_ddmmyyyy.csv, then in the Extraction tab you have the option to write an ABAP routine that generates the file name. Here you will need to append sy-datum to "name" and then append ".csv" to generate complete filename.
    Please let me know if this is helpful or if you need any more inputs.
    Thanks & Regards,
    Nishant Tatkar.

  • Numbering nodes when loading hierarchy from a flat file.

    Hi All,
    I want to load a hierarchy from a flat file. When we number the nodes, do they have to be in a sequence or can I give them any number I want? I want to make the GL account number as the node number since it makes it easy to generate the node number that way. The way I see it, the important thing is the parent node number; so this approach should be fine. Please correct me if I am wrong.
    Thanks,
    Uday

    Hi Uday,
       You need to have a running sequence numbers for Node Id field in the flat file. The file structure is as
    NODEID  IOBJNM      NODENAME TLEVEL LINK PARENTID
    00000001 0GLACC     GL233344             00000001
    00000002 0GLACC     GL435556             00000001
    00000003 0GLACC     GL545666             00000001
    00000004 0costcenter cc433232            00000002
    00000005 0costcenter cc433233            00000002
    00000006 0costcenter CC555551            00000003
    The Parentid will calculated by the system automatically.
    when you prepare you file csv please ensure that you have 8 characters for the Node ID " 00000003" other wise you will get error.
    And if you want to add GL Account number to your hierarchy then you need to add GL A/c Number as external characteristics in hierarchy and add it to your flat file .
    Hope it helps.
    Cheers,
    Balaji

  • 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

  • Cube like aggregation behavior from a flat file data source

    Is the following workflow possible in Xcelsius and if so how would your organize you logic to be able to acheive this?  Any examples would greatly be appreciated
    My data source is XML, therefore a flat file.
    The flat file contains multiple dimensions for which the customer wants to aggregate by based on the selection and also include and "ALL" option for every dimension/selector.
    Essentially, the file is structured like this:
    ie: Dim1  Dim 2  Dim3   Dim 4   Dim5  Metric1    Metric2
           a        c         e          j          l          5             5
           a        c         e          j          m        3             2
           a        c         e          j          n         4             8
           a        c         e         k          o         3             4
           a        c         e         k          n         8             2
            ...etc         
    We need drop down selectors for Dim1-Dim4 with the "ALL" option.  I would have my tables and charts etc use the Dim5, Metric1 and Metric2. 
    I've used the "Lookup" function to create 1 level of aggregation in a flat file structure with 1 dimension, such as the "Lookup" would call all the Dim1entries and insert into a group of referenced cells and then i would use the "Sum" function from Excel.
    But is this possible with multiple dimensions and include the "ALL" option.  If so, how?  The workflow defined is ideal for a CUBE architecture but for many different political reasons we need to be able to address this with Xcelsius being sourced from a flat file ie XML.  Any insight would be greatly appreciated..

    hi there.
    if you backend is SAP BW connected via OLAP Universe you could use L0 Dimensions for all aggregation in WebI Layer. (Check the Blog's of Ingo Hilgefort for details)
    Best Regards
    Ulrich
    http://www.xcelsius-insight.com

  • Overwrite partner address from a flat file

    Hi,
    I want to overwrite the partner address from a flat file while creating sales order.
    I am using FM CRMXIF_ORDER SAVE .
    what are values we have to pass to the deep structure partner_inputfields ?
    Regards,
    Siva

    Hi Siva,
    function CRMXIF_ORDER_SAVE is used for inbound information coming through the XIF, which means that an idoc or XML structure in translated in the structure that is given to the function [inbound parameter DATA with structure CRMXIF_BUSTRANS_T]. You can either try to fill up this structure as the standard integration would or you can try to create an XML from your java-application & send the information to the XIF which will then take care of the rest.
    Option 1: look in transaction smw01 and find a business transaction message. You'll find a comparable structure in this bdoc that you can use as an example to fill the structure in the function.
    --> this is a quick solution, but you cannot be sure that SAP will continu to use the function or that structure in future releases or SP-upgrades.
    --> it will also be difficult todo errorhandling and will require more maintenance
    Option 2: creating the xml (or idoc) from java will have to be done in a specific format. To pass it along to the XIF-adapter, you'll need some interaction tool like the business connector, SAP XI or a SOAP-server.
    --> eventually, this will be the most stable solution I think, but it will require more work to set up.
    Thanks.

  • Error while uploading data from a flat file to the hierarchy

    Hi guys,
    after i upload data from a flat file to the hierarchy, i get a error message "Please select a valid info object" am loading data using PSA, having activated all external chars still get the problem..some help on this please..
    regards
    Sri

    there is o relation of infoobject name in flat file and infoobjet name at BW side.
    please check with the object in the BW and their lengths and type of the object and check your flat file weather u have the same type there,
    now check the sequence of the objects in the transfer rules  and activate them.
    there u go.

  • What is the best way to load and convert data from a flat file?

    Hi,
    I want to load data from a flat file, convert dates, numbers and some fields with custom logic (e.g. 0,1 into N,Y) to the correct format.
    The rows where all to_number, to_date and custom conversions succeed should go into table STG_OK. If some conversion fails (due to an illegal format in the flat file), those rows (where the conversion raises some exception) should go into table STG_ERR.
    What is the best and easiest way to archive this?
    Thanks,
    Carsten.

    Hi,
    thanks for your answers so far!
    I gave them a thought and came up with two different alternatives:
    Alternative 1
    I load the data from the flat file into a staging table using sqlldr. I convert the data to the target format using sqlldr expressions.
    The columns of the staging table have the target format (date, number).
    The rows that cannot be loaded go into a bad file. I manually load the data from the bad file (without any conversion) into the error table.
    Alternative 2
    The columns of the staging table are all of type varchar2 regardless of the target format.
    I define data rules for all columns that require a later conversion.
    I load the data from the flat file into the staging table using external table or sqlldr without any data conversion.
    The rows that cannot be loaded go automatically into the error table.
    When I read the data from the staging table, I can safely convert it since it is already checked by the rules.
    What I dislike in alternative 1 is that I manually have to create a second file and a second mapping (ok, I can automate this using OMB*Plus).
    Further, I would prefer using expressions in the mapping for converting the data.
    What I dislike in alternative 2 is that I have to create a data rule and a conversion expression and then keep the data rule and the conversion expression in sync (in case of changes of the file format).
    I also would prefer to have the data in the staging table in the target format. Well, I might load it into a second staging table with columns having the target format. But that's another mapping and a lot of i/o.
    As far as I know I need the data quality option for using data rules, is that true?
    Is there another alternative without any of these drawbacks?
    Otherwise I think I will go for alternative 1.
    Thanks,
    Carsten.

  • Reading special characters from a flat file and inserting into DB

    I'm reading data with special characters like . etc from a flat file , assigning the data to variable in my anonymous block and inserting into my DB. But the show up as inverted ? s. Any clues about how to do this?
    If i try to do the insert directly it works. It seems like the error occurs when reading this data into a variable
    thanks for the help
    Lalit Bhatia

    lalit, this is probably an character set problem, the default on Database creation tends to be 7bit Ascii which does not support special characters, it's been a while since I set up a db in this way, but you need to change settings in oracle.ini. The db will need to be restarted for this. Also, to check current settings try:
    select * from NLS_DATABASE_PARAMETERS
    You want an 8bit, unicode or multibyte character set. Sorry I cannot remember moer off the top of my head, try searching on NLS or character set

  • Looking for a program to delete CVCs from a flat file, infocube, ztable.

    I am looking for a program that will delete CVCs from a flat file, infocube, or ztable. Based on the research I have done, I would imagine the core of such a program would be the use of function module /sapapo/ts_plob_delete.
    If anyone has such a program and would be willing to share it that would be great.
    Shane

    Hi
    Yes you can use this program, but I think the program /sapapo/ts_plob_delete will only delete the data from Master planning Object structure( MPOS). First you have to deactivate the planning are first than use this program which will delete everything and again activate the planning area.
    If you want to delete the data flat files or infocube, you require to delete the data directly from the infocubes and add this job in the process chain to delete everything.
    I hope this information help you.
    Thanks
    Amol

  • Uploading the data from a flat file into ztable

    Hi,
    I have a requirement where I have to upload the data from 2 flat files into 2 z tables(ZRB_HDR,ZRB_ITM).From the 1st flat file only data for few fields have to be uploaded into ztable(ZRB_HRD) .Fromthe 2nd flat file data for all the fields have to me uploaded into ztable(ZRB_ITM). How can I do this?
    Regards,
    Hema

    hi,
    declare two internal table with structur of your tables.
    your flat files should be .txt files.
    now make use of GUI_UPLOAD function module to upload your flatfile into internal tables.
    CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename            = 'c:\file1.txt'
          has_field_separator = 'X'
        TABLES
          data_tab            = itab1
        EXCEPTIONS
          OTHERS              = 1.
    use this function twice for two tables.
    then loop them individually and make use of insert command.

  • Data from a Flat file int a Cube

    Hi experts!
    Just a quick one, could we load data from a flat file directly to an infocube?
    Or we woud need to create a ODS to load that from the flat file there and later on form the ODS to the cube?
    Thanks you very much for your time!!

    Hi,
    You can directly load the flat data into the info cube. This should not be a problem.
    Create a flat file datasource according to the structure of the flat file. Create Transformations and DTP to the Cube.
    Load the flat file data into the PSA and then DTP the request into the cube.
    If the flat file load is a full load and one time load and data has to be deleted and loaded on the next load then above approach is fine.
    But if your load is every day load and delta then it would be appropriate to have a DSO in between the data flow.
    Hope it helps.

  • Problem in the BDC program to upload the data from a flat file.

    Hi,
    I am required to write a BDC program to upload the data from a flat file. The conditions are as mentioned below:-
    1) Selection Screen will be prompted to user and user needs to provide:- File Path on presentation server (with F4 help for this obligatory parameter) and File Separator e.g. @,#,$,%,... etc(fields in the file will be separated by using this special character) or fields may be separated by tab(tab delimited).
    2) Finally after the data is uploaded, following messages need to be displayed:-
    a) Total Number of records successfully uploaded.
    b) Session Name
    c) Number of Sessions created.
    Problem is when each record is fetched from flat file, the record needs to be split into individual fields separated by delimiter or in case tab separated, then proceeding in usual manner.
    It would be great if you provide me either the logic, pseudocode, or sample code for this BDC program.
    Thanks,

    Here is an example program,  if you require the delimitor to be a TAB, then enter TAB on the selection screen, if you require the delimitor to be a comma, slash, pipe, whatever, then simply enter that value.  This example is simply the uploading of the file, not the BDC, I assume that you know what to do once you have the data into the internal table.
    REPORT zrich_0001.
    TYPES: BEGIN OF ttab,
            rec TYPE string,
           END OF ttab.
    TYPES: BEGIN OF tdat,
           fld1(10) TYPE c,
           fld2(10) TYPE c,
           fld3(10) TYPE c,
           fld4(10) TYPE c,
           END OF tdat.
    DATA: itab TYPE TABLE OF ttab.
    data: xtab like line of itab.
    DATA: idat TYPE TABLE OF tdat.
    data: xdat like line of idat.
    DATA: file_str TYPE string.
    DATA: delimitor TYPE string.
    PARAMETERS: p_file TYPE localfile.
    PARAMETERS: p_del(5) TYPE c.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      DATA: ifiletab TYPE filetable.
      DATA: xfiletab LIKE LINE OF ifiletab.
      DATA: rc TYPE i.
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        CHANGING
          file_table = ifiletab
          rc         = rc.
      READ TABLE ifiletab INTO xfiletab INDEX 1.
      IF sy-subrc = 0.
        p_file = xfiletab-filename.
      ENDIF.
    START-OF-SELECTION.
      TRANSLATE p_del TO UPPER CASE.
      CASE p_del.
        WHEN 'TAB'.
          delimitor = cl_abap_char_utilities=>horizontal_tab.
        WHEN others.
          delimitor = p_del.
      ENDCASE.
      file_str = p_file.
      CALL METHOD cl_gui_frontend_services=>gui_upload
        EXPORTING
          filename = file_str
        CHANGING
          data_tab = itab.
      LOOP AT itab into xtab.
        CLEAR xdat.
        SPLIT xtab-rec AT delimitor INTO xdat-fld1
                                         xdat-fld2
                                         xdat-fld3
                                         xdat-fld4.
        APPEND xdat to idat.
      ENDLOOP.
      LOOP AT idat into xdat.
        WRITE:/ xdat-fld1, xdat-fld2, xdat-fld3, xdat-fld4.
      ENDLOOP.
    Regards,
    Rich Heilman

  • Uploading Data from a Flat File

    Hi
    I am trying to Upload data from a Flat File to the MDS. I have a few questions on the Process.
    a) XI would be the Interface, and one end would be a file adapter with the Flat File format. On the other end, which Interface should I use - ABA Business Partner In or MDM Business Partner In. I do not understand the differences between them and where should which one be used?
    B) At the moment,I want to map the data to standard Object type, Business Partner  BUS1006. This also has a staging area already defined in the System. Can I view the data which is imported into the Staging area ? How so ?
    C) The struture (or data) that I wish to upload has few fields, and does not map to the BP structure easily. In such a scenario does it make sense to
    Create a new Object type
    (ii) Create a new Business Partner type with the appropriate fields only ..
    What I need to know is if either of these options is feasible and what are the pros & cons of doing this, in terms of effort, skillset & interaction with SAP Development ?
    Kindly do reply if you have any answers to these questions.
    Regards,
    Gaurav

    Hi Markus,
    Thanks for your inputs.
    I have tried uploading some dats from a Flat file to the Business Partner Onject type, BUS1006. I initially got some ABAP Parsing errors on the MDM side, but after correcting that, I find my message triggers a short dump - with the Method SET_OBJECTKEYS, not finding any keys in the BP structure that has been created.
    Q1 - How do I get around this problem ? Is it necessary for me to specify Keys in the PartyID node of the Interface ABABusinessPartnerIn. or is it something else ?
    Q2 - How is this general process supposed to work? I would assume that for staging, I would get incomplete Master data or data from flat files, which need not neccesarily contain keys. The aim is to use the matching strategies in the CI to identify duplicates and consolidate them.
    Thanks in advance for your reply.
    Regards,
    Gaurav

  • How to read data from a specified line from a flat file

    hi all
    im having a filat file like as follows
    (eg)
    1.aaa
    2.bbb
    3.ccc
    4.ddd
    5.eee
    using gui_upload i need to read the data from the flat file from the line number 2 into an internal table.
    (eg)
    2.bbb
    3.ccc
    etc
    can any one help with this

    Hi,
        First u upload the data from flat file into the internal table.Once u uploaded read the internal table.
    Read table itab index 2.
    Thank u,
    Manjula Devi.D

Maybe you are looking for

  • Can't open internet links in pdf

    While trying to copy an internet address in a pdf file, Adobe Reader X said something about changing how the Reader handled this kind of thing. Now it says "Acrobat does not allow connection to:" and the address when I try to connect to using a link.

  • Process Metrics in NW BPM

    Hi, Is there any way to get the metrics of processes that have already been completed? We want to get some metrics related to BAM, or is there any way to build queries that could bring us that information? Best Regards, Leó

  • JDev 9.0.3 - generating useless imports

    Hello, When I modify objects (entities, view objects, application modules) in my BO project, I find out that JDeveloper inconsistently adds for me some useless imports. This will happen on any modification of that object. Even if I only open the prop

  • My Dreamweaver CS4 won't open on my iMac

    Well every time I launch Dreamweaver CS4 it crashes. Please help me and i also reinstalled and updated all software.

  • New 2.5 Hard Drive in External Housing not working

    Hi, I bought a brand new 2.5 SATA drive, and place in a usb housing. Disk Utility Does not recognise the disk. Do I need to put it inside the macbook first to format it, or should disk utility recognise it when plugged in via USB? Thanks