Creating mapping for flat structure

Hi gurus!
I need to create a flat file from hierarchial XML:
Source:
<Header>
  <Order>
    <Line>
    </Line>
    <Line>
    </Line>
    <Line>
    </Line>
  </Order>
  <Order>
    <Line>
    </Line>
    <Line>
    </Line>
  </Order>
</Header>
Target:
<Header> </Header>
<Order>  </Order>
    <Line>    </Line>
    <Line>    </Line>
    <Line>    </Line>
<Order>  </Order>
    <Line>    </Line>
    <Line>    </Line>
The XI mapping is changing the order of the objects like that:
<Header> </Header>
<Order>  </Order>
<Order>  </Order>
    <Line>    </Line>
    <Line>    </Line>
    <Line>    </Line>
    <Line>    </Line>
    <Line>    </Line>
Is there any way to keep the order as is?

Malini Balasubramaniam thanks for the link.
Is there any "conventional" way to make the mapping? Without using the external mapping?
Edited by: LOS' on Oct 7, 2008 8:15 AM

Similar Messages

  • Key Mapping for Flat lookup tables

    Hi,
    How do we decide if we need to make Key Mapping "Yes" for flat look-up tables?
    Can anyone plz explain with an eg on where to make key mapping yes or no for Flat Tables.
    Thanks,
    Ketan

    Hi,
    Can anyone plz explain with an eg on where to make key mapping yes or no for Flat Tables.
    1. A remote system’s objects are mapped to master data objects within MDM using key mapping. A key mapping maintains the relationship between the remote system’s identifier (or key) for an object and the corresponding master data object in MDM.
    2. in the data manger based upon some strategy, you found that 4 records are duplicate, and then you merged into single record.
    the merged record is having 4 records inside it with respective remote keys.
    if you want to edit those records, key mapping should be enabled for that particular table.
    3. while harmonizing the records to the respective client systems, you can use edit key mapping functionality for merged records.
    if you enabled key mapping functionality in the console for the particular table, then only you can aceess EDIT KEY MAPPINGS functionality in data manager & syndicator.
    hope this may help you,
    Regards,
    Srinivas

  • Mapping Query: Flat Structure to Hierarchical Structure.

    I have a scenario which uses the sender file adapter. Therefore my source message has a flat structure. The requirement is that the target message will have a hierarchical structure as shown below.
    Source Message Type
    MT_Acc_Out    1..1
    …fileHeader   1..1
    …docHeader    1..unbounded
    …docItem      1..unbounded
    …fileTrailer  1..1
    Target Message Type
    MT_Acc_In     1..1
    …batchHeader  1..1
    …docHeader    1..unbounded
    ……docItem     1..unbounded
    …fileTrailer  1..1
    The source structures docHeader and docItem both contain a field called seqNo which is used to link the items to the header.
    The requirement is that in the target message the docItems are children of the corresponding docHeader.
    I am having difficulty mapping the target docItem node. Does this require a user defined function or can it be achieved using standard functions?
    Any assistance would be appreciated.

    You can use standard or user-defined functions, see this link:
    http://help.sap.com/saphelp_nw04/helpdata/en/59/f6ae42e0fac911e10000000a1550b0/frameset.htm
    see the part of flat structure_2_nested tables part.

  • Java Mapping for Flat file

    hello SDNers,
    I am using JAVA mapping for converting FlatFlie IDoc to IDoc and i am using metadata for this.While downloading metadata from SAP system, the first segment in the data record is having level 2.
    1) What is the use of Level in metadata?
    2)  What is the Level for first segment in data record of metadata. Is it Level 1 or Level 2?
    3) I am facing an error while appending the node. Is it because of Level differs?
    Plese help me out and thanks in advance

    Hi,
    >>>I am using JAVA mapping for converting FlatFlie IDoc to IDoc and i am using metadata for thi
    why do you develop is from scratch is the code is already there - just copy and paste...
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/46759682-0401-0010-1791-bd1972bc0b8a
    >>>1) What is the use of Level in metadata?
    this shows how the nested segments in IDOC are to be understood
    >>>3) I am facing an error while appending the node. Is it because of Level differs?
    no, it becase your code is incorrect - the level velidation will be done at the receiver
    Regards,
    Michal Krawczyk

  • No mapping for Same structure in source and target

    Hi Experts,
    I want to transfer the source structure to two receivers . Here source and target structures are same so i dont need mapping.
    My question is how many DT,MT and MI required .. mapping required or not.
    Thanks in Advance
    CS

    hi  CS,
                 here in  your  scenario as  u  have  told  that  source  and reciver  are of  same  structure . definitely you didn't need  any  mapping . and you have to create two data type(one for sender and  one for receiver) , two message  types(one for sender and one for receiver)) , and  two message  interfaces(one for sender and one for receiver).
    while creating message types it asks for data  type and while creating message interface it asks for message type only . as the structures of sender and receiver are same then inspite of having two receivers  we  have to create  ony one message interface on sender side . later the adapter will take  care of further proceedings
    but  in  case of configuration you have to import three business systems . one for sender and  two for receiver systems . and  you have to configure the communications  channels  accordingly. as per the receivers accepting the structures you have to use the relevant adaptors .

  • Route of the operator.... while creating mapping for idoc to file

    Hi,
    Scenario is IDOC to File but certain rules are there while creating a mapping in XI.
    This is the description for my scenario :
    Within XI this Idoc message needs to be translated into 2 text files:
    1 file for the route of the operator
         - Read the idoc data.
         - When reading a new order first get the customer. This will be a new line in the file.
            The customer number will be set into the filed u2018CustomerIDu2019.
         - Then read the items. For every item create a new line in the file. The machine number will be mapped to the field CustomerID
         - The field RouteOrder should get a sequential number. Starting at 001 and updated by 1 for every new line.
    Could you please guide me how can i implement this above scenario.
    Regards,
    Y.Raj

    Within XI this Idoc message needs to be translated into 2 text files:
    this can be done using multimapping i.e. defining your target messages at mapping tabs in your message mapping.
    When reading a new order first get the customer. This will be a new line in the file.
    The customer number will be set into the filed u2018CustomerIDu2019.
    If there is some condition for identifying new order then you should put condition based on input field.
    if customer no doesnot exists in order then RFC lookup can fetch customerno
    The field RouteOrder should get a sequential number. Starting at 001 and updated by 1 for every new line.
    for this declare varaible in global section and use the same or some builtin function can be used for the same.
    Rajesh

  • How to use "create data" for temporary structures?

    Hi,
    I need to create a structure dynamically based on user provided structure definition. However, my test code throws an exception. I would appreciate it if someone can suggest me an alternative. The code follows.
    Thank you in advance for your help.
    Pradeep
    * The following string is actually passed as a parameter
    data: myLineStructure type string value
    'begin of mystruct,
        mara-matnr type mara-matnr,
        mara-mstae type maara-mstae,
        makt-maktx type makt-maktx,
    end of mystruct.'.
    data: tableLine type ref to data.
    create data tableLine type (myLineStructure).
    assign tableLine->* TO <line>.

    Hi Pradeep,
    First of all u need to create a field-catalog with user provided structure. Then u need to pass the same to create a dynamic internal table. Then create a line type of this table. Please copy & paste this code in ABAP editor which will serve ur purpose.
    TYPE-POOLS : SLIS.
    DATA: mylinestructure TYPE string.
    DATA: it_fieldcat TYPE lvc_t_fcat,
          is_fcat LIKE LINE OF it_fieldcat.
    DATA: new_line TYPE REF TO data.
    FIELD-SYMBOLS : <line> TYPE ANY,
                    <fs_table> TYPE STANDARD TABLE.
    CONCATENATE 'begin of mystruct,'
                 'mara-matnr type mara-matnr,'
                 'mara-mstae type mara-mstae,'
                 'makt-maktx type makt-maktx,'
                 'end of mystruct.' INTO mylinestructure.
    DATA: tableline TYPE REF TO data,
          lines TYPE i,
          off TYPE i,
          off1 TYPE i,
          tabname TYPE ddobjname,
          fieldname TYPE dfies-fieldname,
          ftype(50) TYPE c.
    DATA : BEGIN OF itab OCCURS 0,
           field(30),
           END OF itab.
    DATA :f_tab LIKE dfies OCCURS 0,
          wa_f_tab LIKE dfies,
          f_len TYPE dd01v.
    SPLIT mylinestructure AT ',' INTO TABLE itab.
    DELETE itab INDEX 1.
    DESCRIBE TABLE itab LINES lines.
    DELETE itab INDEX lines.
    LOOP AT itab.
      FIND 'type' IN itab-field MATCH OFFSET off.
      off = off - 1.
      is_fcat-fieldname = itab-field+0(off).
      off = off + 6.
      ftype             = itab-field+off.
      FIND '-' IN ftype MATCH OFFSET off1.
      tabname = ftype+0(off1).
      off1 = off1 + 1.
      fieldname = ftype+off1.
      CALL FUNCTION 'DDIF_FIELDINFO_GET'
        EXPORTING
          tabname        = tabname
          fieldname      = fieldname
        TABLES
          dfies_tab      = f_tab[]
        EXCEPTIONS
          not_found      = 1
          internal_error = 2
          OTHERS         = 3.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      READ TABLE f_tab INDEX 1 INTO wa_f_tab.
      CALL FUNCTION 'DDIF_DOMA_GET'
        EXPORTING
          name          = wa_f_tab-domname
        IMPORTING
          dd01v_wa      = f_len
        EXCEPTIONS
          illegal_input = 1
          OTHERS        = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      is_fcat-datatype = f_len-datatype.
      is_fcat-intlen = f_len-leng.
      APPEND is_fcat TO it_fieldcat.
    ENDLOOP.
    CALL METHOD cl_alv_table_create=>create_dynamic_table
      EXPORTING
        it_fieldcatalog = it_fieldcat[]
      IMPORTING
        ep_table        = tableline.
    ASSIGN tableline->* TO <fs_table>.
    CREATE DATA new_line LIKE LINE OF <fs_table>.
    ASSIGN new_line->* TO <line>.
    Please reward if helpful.

  • How to create security for flat files under a Webserver Directory?

    Hello,
    I have an Application where I need to show a Flat Excel File (with open/save option) from a URL from Portal.
    This works fine.
    But a user can view this file without login to Portal.
    Though we restricted the directory, file access is uncontrolled.
    What should we do?
    Thanks
    Madhav

    I mean, how to enforce Login to Portal on flat files in the Web Server Directory(if the users are accessing directly from URL), they should be accessible as long as they logged into Oracle Portal. But right now, they can access by typing the URL for this flat file directly into browser.
    Thanks for your time
    Madhav

  • Mapping problem - flat structure to deep structure

    Hi there
    We aren't able to figure out how to convert a flat XML to a deep XML. Here is the problem.
    Source structure ( a - 1 to unbounded and b - 0 to unbounded)
    <a>
    <b>
    <b>
    <a>
    <b>
    <a>
    <a>
    We want to convert this to a target structure that would look like this -
    <a>
        <b></b>
        <b></b>
        <b></b>
    <a>
       <b></b>
    <a>
    <a>
    What's the best way of achieving this result? We've looked at all the node functions but maybe we are missing something. Any help would be greatly appreciated.
    Thanks
    Salil

    Hi Salil,
    you should solve your problem by using the CONTENT CONVERSION in your sender adapter. You can use the "How to... use the content conversion module with the XI 3.0 J2EE".
    Look here:
    http://help.sap.com/saphelp_nw70/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm
    (Can you give me some points if my answer has been useful? Thanks!)
    Regards.
    Gabriele.

  • Create IDoc from flat file - How to do the message mapping

    Hi everybody,
    I want to create an IDoc from a flat file.
    The file structure looks like this:
    MT_XYZ
    - Node001       0...1
      - Leaf001
    - Node002       0...unbounded
       - Node003    0...1
          - Leaf002
          - Leaf003
       - Node004    0...1
          - Leaf004
       - Node005    0...1
          - Leaf005
    I have created a mapping and all the other stuff to set up the IDoc adapter.
    Now when I try to test the interface the IDoc is created properly but obviously no information from the nodes "Node003" to "Node005" is inserted in the IDoc. Only the information kept in the elements (leafs) of "Node001" are inserted.
    All IDoc segments and their "Segment" elements are linked to the root node of the file structure "MT_XYZ". I tried to link some IDoc segments only to "Node002" but then this segment is not created.
    So how can I set up the message mapping in a way that the information from "Node003" to "Node005" is transported to the IDoc? Can anyone help me here?
    Thanks in advance for all answers!
    Regards,
    Torben
    Edited by: Torben Hönemann on Dec 14, 2009 4:26 AM

    Hi Torben,
    >>I want to create an IDoc from a flat file.
    So you are using File content Conversion on the sender side. Right?
    >>no information from the nodes "Node003" to "Node005" is inserted in the IDoc.
    Are these information available in the source XML (you can check in transaction SXMB_MONI-> Input Payload).. There is a limitation in File Content Conversion of File adapter and it is that I can make an XML structure of 3 level.. Since these nodes details are in level 4 and 5 they should be missing in Source XML structure itself (after content conversion of File adapter). check that
    >>So how can I set up the message mapping in a way that the information from "Node003" to "Node005" is transported to the IDoc? Can anyone help me here?
    So you need to take an alternate approach where you do File Content Conversion and make 3 level structure.. then using a mapping convert this three level structure to your 5 level one and then try to map with the idoc.
    Check this blog for an idea
    http://www.riyaz.net/blog/xipi-file-content-conversion-for-complex-structures/
    http://www.riyaz.net/blog/xipi-convert-flat-file-to-deeply-nested-xml-structures-using-only-graphical-mapping/
    Regards
    Suraj

  • Mapping to simplify structure of XML for File Adapter

    Hi everybody
    Here is a short question regarding the restructuring of an incoming IDoc message to an outgoing file.
    The IDoc has the structure:
    -IDoc
    ___-->Segment A1           
    ______--> Segment B1   
    _________-->Segment C1 
    _________-->Segment C2 
    _________-->Segment C3 
    ______--> Segment B2   
    _________-->Segment C4 
    _________-->Segment C5 
    _________-->Segment C6 
    ___-->Segment D1       
    You can see that Segment A1 occurres only ones, but can have several child nodes B. Also Segment B can have several Child nodes.
    To transfer this Idoc to a flat file we have to create a flat structure as I understood form several Threads. So the target should look like this:
    -->root 
    _____-->Segment A1           
    _____-->Segment B1   
    _____-->Segment C1 
    _____-->Segment C2 
    _____-->Segment C3 
    _____-->Segment B2   
    _____-->Segment C4 
    _____-->Segment C5 
    _____-->Segment C6 
    _____-->Segment D1
    If I map the structure just one by one, I loose the last segments of C and it look like:
    -->root 
    _____-->Segment A1           
    _____-->Segment B1   
    _____-->Segment C1 
    _____-->Segment C2 
    _____-->Segment C3 
    _____-->Segment B2   
    _____-->Segment D1
    How can I manage to get the needed target structure. I thought of using function <i>sortbykey</i> or <i>sort</i>, because I have values in C and B which are equal.
    Any help?
    Regards Oliver

    Hi Again on this topic
    yes stefan, obviously we have to have a flat structure. Based on our frustration we tried to send our structure from an Idoc directly to the file adapter and the following intresting thing came out:
    The Idoc structure looked like this
    -->root
    _____-->EDIC_040
    _____-->Segment A1
    ________-->Segment B1
    ___________-->Segment C1
    ___________-->Segment C2
    ___________-->Segment C3
    ________-->Segment B2
    ___________-->Segment C4
    ___________-->Segment C5
    ___________-->Segment C6
    _____-->Segment D1
    After sending this structure to the file adapter and ignoring that the stucture is not flat one we got this in our file:
    Segment A1Segment B1
    Segment C1
    Segment C2
    Segment C3
    Segment B2
    Segment C4
    Segment C5
    Segment C6
    Segment D1
    We got nearly what we wanted, just that a new line is missed between  Segment A1 and Segment B1. We tried to use 'nl' but it does not work. Any Ideas on how to get Segment B1 into the next row??
    Regards Oliver

  • Message Mapping from flat XML to a Record structure

    Hi All,
    We have a scenario in which the input message is a PDF document. we are following below the blog to convert PDF to XML format which uses <b>PDF box utitlity</b>.
    /people/sap.user72/blog/2005/07/31/xi-read-data-from-pdf-file-in-sender-adapter
    We are able to convert the PDF doc to a flat XML file.
    Now we have the following queries...
    what are the different ways to map the flat XML to our record structure?
    Do we have any utitlity in PDF box to do that?
    Regards,
    Rakesh.

    Hi Rakesh,
    You have Graphical mapping, Java mapping, ABAP mapping and XSLT mapping. The choice depends on the scenario and what target result you require.
    <b>Message mapping using graphical mapping editor:</b>
    http://help.sap.com/saphelp_nw04/helpdata/en/49/1ebc6111ea2f45a9946c702b685299/frameset.htm
    <b>XSLT mapping:</b>
    http://help.sap.com/saphelp_nw04/helpdata/en/73/f61eea1741453eb8f794e150067930/frameset.htm
    <b>Java Mapping:</b>
    http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/frameset.htm
    <b>ABAP mapping:</b>
    http://help.sap.com/saphelp_nw04/helpdata/en/ba/e18b1a0fc14f1faf884ae50cece51b/frameset.htm
    As said earlier, graphical mapping is the simplest and quite a few built in options are available with it, explore it and see which is suitable for your scenario.
    Regards,
    Chandra

  • Create Mapping As a Flat File Source

    Hi,
    I'm new to OWB, my first project is to load data through flat file to oracle.
    step i follow is,
    =>Create Flat File Module
    =>Create Location Directory
    =>Create Flat File
    =>Create External Table (Synch with my Flat File)
    =>Create Mapping (Simple External Table mapped to table operator)
    =>Create and bind table Operator
    Mapping successfully deployed and but when i want to run it gives me following Error
    ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04040: file IPDirectory.txt in FLAT_FILE_MOD_LOC_0 not found
    When I directly mapped flat file to Table in mapping it gives another error
    RPE-01013: SQL Loader reported error condition, number 4.
    SQL*Loader-522: lfiopn failed for file (\\sfs\Analytics\Reference\SIMPLE_MAP.log)
    I mention here that im working on my pc with OWB Client not on server and want to load data through flat file which is on my pc or on our sharing drive.
    Please help me on this issue
    Regards

    Hi,
    OWB generates SQL * Loader code for Flat File operator, if you try to change the configuration parameter to PL/SQL it results in error.
    External tables would be a better choice as it reduces the processing time, disk space required and also makes it possible to use SQL and other complex transformations.

  • Bad DimAs mapping for Structure Parameters, BAPI ActiveX

    I am using BAPI ActiveX from Visual Basic.  All is working well except a mapping issue.
    I am mapping a BAPI structure export parameter to an object using DimAs method.  I am getting raw byte lengths instead of character lengths.  Example if a parameter is 10 characters long it is actually unicode stored as 20 bytes.
    The result is that the object is misaligned when retrieving data.  So I have to play games to find ask for the right field that will line up.  I am getting the data ok, no extra bytes.  The object fields are defined improperly.
    If the export parameter is a table or a simple value, no problems.  It appears to be structures only.  Note:  I am going after cProjects BAPI's, I have not tested other BAPI areas to see if the same problem exists.
    Known issue?  Any kind of notes I should check out?  Workaround ideas other than the tedious one I have?
    Thanks

    Hi,
    Workout the below application u can get idea abt BAPI,
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/d352a790-0201-0010-5082-b1a608d22b6c
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/wd%20java/wd%20tutorials/creating%20a%20web%20dynpro%20application%20accessing%20abap%20functions.pdf
    1)Input parameter is Input node where we can give some input to access an BAPI.
    2)Output parameter is Output node wher we have all output datas...we import all datas from BAPI to WebDynpro by using Output node
    3)But all Input node have Output node..so we can access output node from Input node.
    Regards,
    Suresh T

  • How to create internal table for a structure in BSP

    hi ,
    I have created a Structure in BSP.I want to create an internal table for that Structure. But in my coding ie.
    <% data: begin of itab_1 .
                     include type zuvendstr.
                     data:end of itab_1.
                     data wa_str like line of itab_1.
                     loop at itab_1 into wa_str. %>
                    <tr>
                     <td><%=wa_str-name%> </td>
                           <%endloop.%>
    In this zuvendstr is Structure ,wa_str is workarea and itab_1 is an Internal table.But it is showinng an error that itab_1 is unknown.But we cannot define internal tables for an Structure in Page Attributes.So,please resolve how to create internal table for Structure in BSPS

    Hi,
    You can define itab_1 like this (assuming zuvendstr is a structure type):
    DATA: itab_1 TYPE TABLE OF zuvendstr.
    Regards,
    Tanguy

Maybe you are looking for

  • How can I load a flat file using a different Work Station

    Hi Gurus, I'm having problems with loading Flat file in our Production Server when it comes to loading a file from another work station. The scenario is all the Info Packages needed are created in oour Dev Server. So the location of the flatfile is a

  • Genius no longer works with some songs

    I can no longer make Genius playlists from certain songs and albums after updating my Genius results, despite the fact that these same songs could be used to generate playlists just a few days ago.

  • FTP file on Appserver to an external system from ABAP

    Hi, I am trying to FTP a file that my program writes to the APPSERVER directory. I used FTP_CONNECT, FTP_COMMAND and FTP_DISCONNECT. I am able to connect to the external system and change to the directory where I have to write the file using cd. The

  • I can't turn off the light of keyboard macbook

    I can't turn off the light of keyboard macbook

  • Dynamic Table setup (Infobus)

    Hi, I will first describe my environment application and then the problem. I want to create an Infobus GridControl, without using the designer. To setup the Rowsetinfo to which the GridControl will be bound, I perform a "select * from TABLE", using a