Nested Structure

I would like to know how to use nested structure in a ABAP program.
Thanks in Advance!

A <b>nested structure</b> is a structure that contains one or more other structures as components.
Flat structures contain only elementary data types with a fixed length
(no internal tables, reference types, or strings).
The term deep structure can apply regardless of whether the structure is nested or not.
Nested structures are flat so long as none of the above types is contained in any nesting level.
Any structure that contains at least one internal table, reference type, or string as a component
(regardless of nesting) is a deep structure.
Accordingly, internal tables, references, and strings are also known as deep data types.
The technical difference between deep structures and all others is as follows:
When you create a deep structure, the system creates a pointer in memory that points to the
real field contents or other administrative information.
When you create a flat data type, the actual field contents are stored with the type in memory.
Since the field contents are not stored with the field descriptions in the case of deep structures,
assignments, offset and length specifications and other operations are handled differently from flat structures.
Kindly check the following link for more information on Nested structures:
http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb2fcc358411d1829f0000e829fbfe/frameset.htm
<b>Examples:</b>
DATA: BEGIN OF itab.
        include structure vbak.  
DATA: END OF itab.
DATA: BEGIN OF itab OCCURS 0,
        itab1 LIKE mara,
        itab2 LIKE vbak,
      END OF itab.
Kindly reward points if it helps!
best regards,
Thangesh

Similar Messages

  • Nested structure when using FM XXL_SIMPLE_API

    I use this logic to fill in the headings before calling the FM xxl_simple_api in one of my programs. Is it possible to have nested structure(for <b>i_tab</b> in my code) and still use same kind of logic to fill in the headings? Not sure if this Fm would display data correctly when there is a component of strucutre type. I tried it, the field was blank with no contents in excel.
      DATA : nlines TYPE i,
             tempfile LIKE gxxlt_f-file,
             descr_ref TYPE REF TO cl_abap_structdescr,
             header LIKE gxxlt_v OCCURS 0 WITH HEADER LINE,
             it_print LIKE gxxlt_p OCCURS 0 WITH HEADER LINE.
    *data:               keycol type i.
      FIELD-SYMBOLS:
      <comp_wa> TYPE abap_compdescr,
      tempfile = file_name.
      REFRESH header.
      CLEAR header.
      descr_ref ?= cl_abap_typedescr=>describe_by_data( i_tab ).
      DESCRIBE TABLE descr_ref->components LINES nlines.
      nlines = nlines + 1.
      LOOP AT descr_ref->components ASSIGNING <comp_wa>.
        IF sy-tabix = nlines.
          EXIT.
        ELSE.
          header-col_no = sy-tabix.
          header-col_name = <comp_wa>-name.
          APPEND header.
        ENDIF.
      ENDLOOP.
      CALL FUNCTION 'XXL_SIMPLE_API'
      EXPORTING
        filename = tempfile
    N_KEY_COLS = keycol
      TABLES
       col_text = header[]
    I appreciate your help. Thanks

    Hi,
    It's better to use another FM 'SAP_CONVERT_TO_XLS_FORMAT'
      call function 'SAP_CONVERT_TO_XLS_FORMAT'
                 exporting
                  I_FIELD_SEPERATOR = seper
                  I_LINE_HEADER = 'X'
                     I_FILENAME = P_FILE
                  tables
                      I_TAB_SAP_DATA = itab
                  exceptions
                      CONVERSION_FAILED = 1.
    Svetlin

  • File sender adapter: Content conversion for very deep nested structure

    Hi all
    I have a file which looks like this
    HDOCKET    9800000660980000061911062009AA123456bbWM100012349800000619
    DDOCKET_TEST001 4012YAG1 
    WZOA00000000010000000001
    WZOA00000000020000000002
    WZOB00000000030000000003
    IAAXX000001
    IAAXX000002
    C0000000000000000000100000000000000000001000000000000000000020000000000000000000300000000000000000004
    T2
    and my structure is
    Header  - 1
    Detail     - 0....Unbounded
            Bag     - 0.....Unbounded   (sub node of detail)
            Track  - 0.....Unbounded    (sub node of detail)
            Customer - 0.....Unbounded    (sub node of detail)
    Trailer    - 1
    and in the file sender adapter i mentioned the following content conversion setting
    HEADER,1,DETAIL,*,Bag,*,Track,*,Customer,*,TRAILER,*
    But when i go and see in the monitoring i received the following conversion
    <?xml version="1.0" encoding="utf-8" ?>
    <ns:MT_REQ xmlns:ns="http://royalmail.com/dd_c">
    <HEADER>
      <ID>H</ID>
      <INT>DD</INT>
      <CAR>9899999660</CAR>
      <CUS>9899999619</CUS>
      <POST>11062009</POST>
      <NUMBER>AA123456bbWM10001234</NUMBER>
      <ACC>9899999619</ACC>
      </HEADER>
    <DETAIL>
      <ID>D</ID>
      <Bag>DOCKET_TEST001</Bag>
      <S>4012</S>
      <Code>YAG</Code>
      <mat>1</mat>
      <count/>
      <Mixed />
      </DETAIL>
    <Bag>
      <ID>W</ID>
      <Zone>ZOA</Zone>
      <Item>0000000001</Item>
      <Number>0000000001</Number>
      </Bag>
    <Bag>
      <ID>W</ID>
      <Zone>ZOA</Zone>
      <Item>0000000001</Item>
      <Number>0000000001</Number>
      </Bag>
    <Bag>
      <ID>W</ID>
      <Zone>ZOA</Zone>
      <Item>0000000001</Item>
      <Number>0000000001</Number>
      </Bag>
      </Bag>
    <Track>
      <ID>I</ID>
      <Item>AAXX000001</Item>
      </Track>
    <Track>
      <ID>I</ID>
      <Item>AAXX000001</Item>
      </Tracked>
    <Customer>
      <ID>C</ID>
      <OrigCustomer>00000000000000000001</OrigCustomer>
      <Field1>00000000000000000001</Field1>
      <Field2>00000000000000000002</Field2>
      <Field3>00000000000000000003</Field3>
      <Field4>00000000000000000004</Field4>
      </Customer>
    <TRAILER>
      <ID>T</ID>
      <Count>2</Count>
      </TRAILER>
      </ns:MT_REQ>
    whereas i wanted it like:
    <?xml version="1.0" encoding="utf-8" ?>
    <ns:MT_REQ xmlns:ns="http://royalmail.com/dd_c">
    <HEADER>
      <ID>H</ID>
      <INT>DD</INT>
      <CAR>9899999660</CAR>
      <CUS>9899999619</CUS>
      <POST>11062009</POST>
      <NUMBER>AA123456bbWM10001234</NUMBER>
      <ACC>9899999619</ACC>
      </HEADER>
    <DETAIL>
      <ID>D</ID>
      <Bag>DD_TEST001</Bag>
      <S>4012</S>
      <Code>egg</Code>
      <mat>1</mat>
      <count/>
      <Mixed />
    <Bag>
      <ID>W</ID>
      <Zone>zzz</Zone>
      <Item>0000000001</Item>
      <Number>0000000001</Number>
      </Bag>
    <Bag>
      <ID>W</ID>
      <Zone>zzz</Zone>
      <Item>0000000001</Item>
      <Number>0000000001</Number>
      </Bag>
    <Bag>
      <ID>W</ID>
      <Zone>zzz</Zone>
      <Item>0000000001</Item>
      <Number>0000000001</Number>
      </Bag>
      </Bag>
    <Track>
      <ID>I</ID>
      <Item>AAXX000001</Item>
      </Track>
    <Track>
      <ID>I</ID>
      <Item>AAXX000001</Item>
      </Tracked>
    <Customer>
      <ID>C</ID>
      <OrigCustomer>00000000000000000001</OrigCustomer>
      <Field1>00000000000000000001</Field1>
      <Field2>00000000000000000002</Field2>
      <Field3>00000000000000000003</Field3>
      <Field4>00000000000000000004</Field4>
      </Customer>
    </DETAIL>
    <DETAIL>
      <ID>D</ID>
      <Bag>DD_TEST002</Bag>
      <S>4012</S>
      <Code>egg</Code>
      <mat>1</mat>
      <count/>
      <Mixed />
    <Bag>
      <ID>W</ID>
      <Zone>zzzzzz</Zone>
      <Item>0000000001</Item>
      <Number>0000000001</Number>
      </Bag>
    <Bag>
      <ID>W</ID>
      <Zone>ZOA</Zone>
      <Item>0000000001</Item>
      <Number>0000000001</Number>
      </Bag>
    <Bag>
      <ID>W</ID>
      <Zone>zzz</Zone>
      <Item>0000000001</Item>
      <Number>0000000001</Number>
      </Bag>
      </Bag>
    <Track>
      <ID>I</ID>
      <Item>AAXX000001</Item>
      </Track>
    <Track>
      <ID>I</ID>
      <Item>AAXX000001</Item>
      </Tracked>
    <Customer>
      <ID>C</ID>
      <OrigCustomer>00000000000000000001</OrigCustomer>
      <Field1>00000000000000000001</Field1>
      <Field2>00000000000000000002</Field2>
      <Field3>00000000000000000003</Field3>
      <Field4>00000000000000000004</Field4>
      </Customer>
    </DETAIL>
    <TRAILER>
      <ID>T</ID>
      <Count>2</Count>
      </TRAILER>
      </ns:MT_REQ>
    i.e. i need all Bag ,Track and Customer inside detail tag.
    could anyone help me in this..i've already searched SDN and got some link as useful but none of them were totally related.
    Regards
    Naina

    Naina
    Pls. check my forum link, i had the single level hierarchy XML file which I converted into nested structure & then into flat file.
    File Conversion in Rec File Adapter with subnodes
    This can give you an idea how to go ahead. Let me know in case you need any more info about this.

  • Nested Structure handling in XML2Plain module of receiver SFTP aadaptor

    Dear Experts,
    Greeting for the day...
    I am working on Receiver SFTP Adaptor scenario where I have to generate CSV file at receiver end. I am using XML2Plain module for the same. But I have a nested structure at receiver end. Receiver structure is given below.
    General Header
       Packet1
          Node1
               Field1, Field2...
          Node2
               Field1, Field2..
          Node3
               Field1, Field2..
          Node4
               Field1, Field2..
       Packet2
          Node1
               Field1, Field2...
          Node2
               Field1,Field2...
          Node3
               Field1, Field2...
          Node4
               Field1, Field2..
    File structure is as given below
    General Header
    Node1-field1,Field2..
    Node2-Field1,Field2..
    Node3-field1,Field2..
    Node4-Field1,Field2..
    Node1-field1,Field2..
    Node2-Field1,Field2..
    Node3-field1,Field2..
    Node4-Field1,Field2..
    I tried regular XML2Plain configuration but it is giving error "Message processing failed in XML parser: 'Conversion configuration error: Unknown structure 'Node1'".
    Kindly suggest..
    Thanks in advance.
    Vinit.

    hi Vinit,
    You can add another message mapping next to the original one such that Node1 can be treated as a field in new target and concat fields of Node1 with comma.
    this way u can bring down the levels.
    and finally the output mapping will look something like this
    [General Header]
    [Node1-field1,Field2..] [Node2-Field1,Field2..] [Node3-field1,Field2..] [Node4-Field1,Field2.]
    [Node1-field1,Field2..] [Node2-Field1,Field2..] [Node3-field1,Field2..] [Node4-Field1,Field2.]
    [Node1-field1,Field2..] [Node2-Field1,Field2..] [Node3-field1,Field2..] [Node4-Field1,Field2.]
    [Node1-field1,Field2..] [Node2-Field1,Field2..] [Node3-field1,Field2..] [Node4-Field1,Field2.]
    then in the channel u can give
    field separator  for the node fields as 'nl' which will bring your output as below.
    General Header
    Node1-field1,Field2..
    Node2-Field1,Field2..
    Node3-field1,Field2..
    Node4-Field1,Field2..
    Node1-field1,Field2..
    Node2-Field1,Field2..
    Node3-field1,Field2..
    Node4-Field1,Field2..
    hope this helps
    thanks and regards,
    Praveen T

  • Message Mapping Nested Structure to key node in JDBC XML SQL Structure

    Hello everybody,
    I'm facing the next problem, I have the following nested structure
    <ns0:MT_Irdoc_ArchivoNested xmlns:ns0="http://ref.pemex.com/PI/FI/ArchivoIrdoc">
       <Header id_consecutivo="">
          <Transaction/>
          <Header2/>
          <Header3/>
          <Header4/>
          <Header5/>
          <Detail>
             <Transaction/>
             <Detail2/>
             <Detail3/>
             <Detail4/>
             <Detail5/>
          </Detail>
       </Header>
       <NombreArchivo/>
    </ns0:MT_Irdoc_ArchivoNested>
    as you can see, Detail is a nested Node from Header Node, and Detail is with occurrence 0...unbounded, I need to generate a SELECT XML SQL Structure as follows
       <StatementName>
              <dbTableName action=u201DSELECTu201D>
                  <table>realDbTableName</table>
                  <access>
                     <col1/>
                     <col2/>
                     <col3/>
                  </access>
                  <key1>
                     <col4>val4</col4>
                     <col5>val5</col5>
                     <col6>val6</col6>
                  </key1>
              </dbTableName> 
       </StatementName>
    now my problem is that col4 and col6 are values mapped from Header fields values, and col5 mus be mapped from Detail2 field of Detail Nested Structure, and Detail is 0...unbounded so it can contain any number of values and must included in the key structure, I tried by mapping the Detail Node to the key1 node, so it will generate n numbers of key1 nodes to include in the query, and the Detail number of nodes are not constant so I can't generate key2, key3, keyn...., so what I need is to create n numbers of instances of key1 node, but the problem is that when the mapping try to generate the second instance of key1 node it gives an error in the fields that comes from Header structure, maybe I'm trying to solve my problem wrong, could anyone give some advices or direction?, thanks in advance.
    Regards,
    Julio Cesar

    Julio,
    After placing the below logic in the mapping editor
    Details2 > SplitByValue> col5
    Right click on the Details2 node and choose Context. By Default you will see Details, because Details2 is the child of Details node. I want you to choose the Parent of Details node, I believe that would be HeaderID, am I right?
    If you don't want to do that then,
    Details2 ---> Remove Context > SplitByvalue> col5 will do the trick!
    raj.

  • How to convert sequencial textlines into nested structure?

    Hi experts,
    I have an input-TXT file in which I get headerdata (1 line), positiondata (n lines) and for each position partnerdata (n lines). I have to map this data to Idoc ORDERS05. In this structure, there is 1 element per position (E1EDP01) which contains a subelement where I can enter position-partners. How can I achieve this mapping using the graphical message mapping tool in XI?
    Example lines of inputfile:
    (headerdata) 199992;100;10;...
    (positiondata) 10;100200;50
    (positionpartners) 10;partner1
    (positionpartners) 10;partner2
    (positionpartners) 10;partner3
    (positionpartners) 10;partner4
    (positiondata) 20;100201;100
    (positionpartners) 20;partner1
    (positionpartners) 20;partner2
    (positiondata) 30;100202;75
    must result in:
    headerdata linked to E1EDK01, no problem
    positiondata linked to E1EDP01, no problem
    positionpartners linked to E1EDPA1 within E1EDP01. Here is the problem...just linking the input-positionpartners to EDEDPA1 does not work. Then I get all positionpartners of the complete inputfile linked to the first E1EDP01, and no partners from the second E1EDP01 on...
    Regards,
    William

    Hey,
    First step is create a mapping structure(i.e data type and message type) which will be convenient
    for you to map with the Idoc.
    Then you can use File content conversion to convert the text file into the nested structure(one which you have created))
    /people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter
    refer to this blog in order to convert the input file stream into the required nested structure.
    Once done this map the message type to your Idoc.
    revert in case of any problem with FCC(file content conversion).
    reward points if useful.

  • Help!! - File to Idoc Mapping with Nested structure

    Scenario:
    I have an inbound file that has three nested records.
    eg. A00, B00 and C00. C00 is nested structure of B00 and B00 nested structure of A00. All these structure can repeat N number of times in a file.
    How do I map this to IDoc structure that have one segment each for the three structures in the file and nested in the same way.
    Question: How is the parent child relationship established?
         Suppose I have a file
         A00 1234 Sam 29
              B00 london LE3 XYZ
              B00 US 123456
                    C00 2 XYZ
               A00 5678 Joe 22
            B00 US 23456
         If I make a nested structure and then say in the file conversion properties that A00 go to segA and then B00 go to segB, but then when I come back to A00, how do I move the data to the A00?
    Thanks in Advance
    Rgds

    From what you have layed out, you can create a data type with 3 children, all 1..unbounded cardinality, each containing their own elements.  You say they are nested, but the example you gave isn't nested... it's just A's followed by B's followed by C's.  If that is the case, you can then use a data type w/ 3 subelements (A, B & C) and each of those is actually a container with the real attributes of that line in your file.  (I can email you a schema quickly if you need it)
    If you are saying they can occur like this:
    A00 1234 Sam 29
    B00 london LE3 XYZ
    B00 US 123456
    C00 2 XYZ
    B00 US 23456
    C00 2 XYZ
    THEN they are nested - ie B's & C's repeat under any A.  Then you must create segment B as a subelement of segment A instead of on the same level, then bury C under B. (I find this easiest w/ a text tool rather than inside XI, as I can cut/paste segments where I want them to belong...)
    Good luck with setting up content conversion on that file adapter... We have done this a few times, and it can be quite interesting.
    If you have trouble with the schema, you can post your email & I can give you a quick example.
    Message was edited by: Amanda Derringer

  • How To fetch the Value of nested structure returned by RFC in c# application.

    Hello ,
    i am new to C#,i have rfc that return data from SAP system as Nested structure but when i fetching that data using
    IrfcTable table = rfc.getTable("exporting_parameter");       // et_customer
    it return's only first inner structure only .
    for example my exporting internal table for rfc is
    "et_customer" that contain sub structure as follow
              gen_data
               bank data
               tax data
    it return only value inside gen_data only.
    how to get entire data

    Hi,
    I am using Java JCO but I can see in the java doc that JCoTable have a Method
    getTable
    Check and see if you have it in .net
    Regards.

  • Receiver File content conversion with nested structure

    Hi Guys,
    I have the below nested structure and have to convert it using receiver file content conversion.
    <Header> [o, unbounded]
       <A>a</A>
       <B>b</B>
    </Header>
    <record>   [0, unbounded]
       <field1>
            <X1>x</X1>
            <Y1>y</Y1>
       </field1>
       <field2>
             <X2>x</X2>
             <Y2>y</Y2>
       </field2>
    </record>
    The file is a comma separated one. Please let me know how to configure the content conversion.
    Thanks

    Hi Mukesh,
    Have a look at the Shabz's blog for the receiver File content conversion : File Adapter (Receiver) - Are we "really" sure about the concepts?
    Thanks,
    Pooja

  • Select (join) into internal table with nested structures

    Hello Experts,
    i wonder about the correct notation of a select statement.
    I have an internal table it_zoll including  two structures as defined below.
    The select is a join on the two tables zollp and zolls. As coded below the select is syntactically correct, but the fields
    in the nested structures are not filled ....
    Any ideas how to write the select statement ? (The internal table it_zoll must have the nested structures for other reasons ..)
    Declaration:
    TYPES: BEGIN OF ty_zollp,
      belnr     TYPE  zollp-belnr,
      werks     TYPE  zollp-werks,
      gebnr     TYPE  zollp-gebnr,
           END OF ty_zollp.
    TYPES: BEGIN OF ty_zolls,
      grnum     type  zolls-grnum,
      werks     type  zolls-werks,
      name1     TYPE  zolls-name1,
           END OF ty_zolls.
    DATA: BEGIN OF wa_zoll.
    DATA: zollp type ty_zollp.
    DATA: zolls type ty_zolls.
    DATA: END OF wa_zoll.
    DATA: it_zoll LIKE TABLE OF wa_zoll.
    Select:
      SELECT
        zollp~belnr   zollp~werks  zollp~gebnr
        zolls~grnum zolls~werks  zolls~name1
          FROM zollp
          JOIN zolls ON   zolls~werks = zollp~werks
                     AND  zolls~grnum = zollp~grnum
          INTO CORRESPONDING FIELDS OF TABLE it_zoll
          WHERE zollp~werks = werks
          AND   zollp~gebnr IN s-gebnr
          AND ...
    Thank you !

    DATA: BEGIN OF ty_zollp,
      belnr     TYPE  zollp-belnr,
      werks     TYPE  zollp-werks,
      gebnr     TYPE  zollp-gebnr,
           END OF ty_zollp.
    DATA: BEGIN OF ty_zolls,
      grnum     type  zolls-grnum,
      werks     type  zolls-werks,
      name1     TYPE  zolls-name1,
           END OF ty_zolls.
    DATA: BEGIN OF wa_zoll.
    Include structure ty_zollp.
    Include structure ty_zolls.
    DATA: END OF wa_zoll.
    The above declaration had worked. Please try.
    Regards,
    Satish Kanteti

  • BAdI - AC_DOCUMENT / data passing for nested structures

    Hi all.
    I need your help for this scenario:  
    I used this to pass value of MM field to FI field from transaction MIGO.
    Our company placed field in EKKN-WEMPF to BSEG-ZUONR.
    For this one option was:  BAdI AC_DOCUMENT
    Questions: 
    1.  Nested structures - passing of data:
    First problem encountered was with the reading of data from nested structures and passing them to nested structures as well.  How to do this?  I have used a certain declaration but any input will be much appreciated. 
    2.  When I activated my BAdI, it says error on FI Interface,
    specifically on AWREF and AWORG fields. 
    It is currently blank.  Can I use the values in IM_DOCUMENT to pass to EX_DOCUMENT? 
    (What is a good way to do it since simple syntax does not allow for passing of data bec. structures are incompatible, and added complexity, it has nested structures.)
    If you have sample code for this, it would truly be helpful. 
    Thanks and God bless!

    Hi,
    Check that for which condition the message is triggering.
    Try to check the condition.
    Regards
    Sandipan

  • Fill internal table with mutliple entries for nested structure

    Dear ABAP Experts,
    I have a question related to fill internal tables with nested structures.
    I have a structure like this:
    BEGIN OF proto,
              sicht TYPE ysicht,
              version TYPE FAGLFLEXA-RVERS,
              BEGIN OF kons,
    kon TYPE YKONSEINHEIT,
              END OF kons,
              jahr TYPE CHAR04,
    END OF proto.
    Now I need to fill this structure with values (over an internal table), but how can I achieve that I save multiple datas für element "kon" für one single entry of structure "proto"?
    An example could be:
    sicht = '01'
    version = '100'
    kon = 1001 (first entry)
    kon = 1002 (second entry)
    usw... (n entry)
    jahr = '2008'
    Thanks in advance for every helpful answer.
    Regards
    Thomas

    BEGIN OF proto,
               sicht TYPE ysicht,
               version TYPE FAGLFLEXA-RVERS,
               kons TYPE STANDARD TABLE OF YKONSEINHEIT WITH NON-UNIQUE KEY TABLE_LINE,
               jahr TYPE CHAR04,
    END OF proto.
    DATA: ls_proto TYPE proto,
          lt_proto TYPE STANDARD TABLE OF proto,
          ls_kon
    ls_proto-sicht = '01'.
    ls_proto-version = '100'
    INSERT '1001' INTO TABLE ls_proto-kons.
    INSERT '1002' INTO TABLE ls_proto-kons.
    ls_proto-jahr = '2008'.
    INSERT ls_proto INTO TABLE lt_proto
    If you're going to use a more complicated inner table with several components, then you need to define a type for those components. 
    matt

  • How to refer the fields of a nested structure

    Hi friends,
    I am facing problem in assigning value to nested structure fields.
    I have import parameter in FM which  is a Table type and line type (structure).
    in this structure there are 4 fields.
    Out of these 4 fields 1 is again a table type and line type(structure).
    I need to populate this inner structures fields and then assign the values back to main table type.
    e.g import parameter is zinput_detail type zdetail.
    zdetail is a table type and has zdetail_line as structure.
    zdetail_line fields are
    salesorder
    customer
    date
    weight is a field here and has table type as type i.e zweights.
    again zweights has a line type zweight_line.
    fields of zweight_line are
    weight1
    weight2.
    Now i need to populate weight1 and weight 2 and then assign these values back to main field weight.
    Kindly let me know, what to declare  for referring to the inner structure this and how to access this.
    Regards,
    pradeep

    Hi,
    Declare the seperate varible for the inner structure and fill the values in the newly declared struture and assign back to inner structure.
    Example
    DATA i_zdetail type zdetail with header line.
    DATA i_weight type z_weight with header llne.
    Fill the i_weight with required values and then
    i_zdetails-weight[] = i_weight[].
    Edited by: Avinash Kodarapu on Mar 10, 2009 8:59 PM

  • How to delete a value from the nested structure?

    Hi Friends!
    I have a nested structure such as
    multimap<int, map<int ,set<int>>> FinalMul
    It contains sample values
    1=>4--->1
    6=>4--->1
    6=>9--->4
    11=>4--->1
    11=>5--->1   4
    11=>9--->4
    12=>2--->1   4   5
    I want to delete the value 4 from the second and third column,
    So, it looks like
    1=>
    6=>
    6=>9--->
    11=>
    11=>5--->1 
    11=>9--->
    12=>2--->1  5
    after deleting 4, if I have a key(first) (1, 6, 11) and secondkey (second)(6=>9--->,  11=>9--->) with no values, then delete them also.
    Finally it looks like
    11=>5--->1 
    12=>2--->1  5
    Can anyone help me how to solve it?
    I just tried something;
    set<int> tempV;
    map<int, set<int>> tempM;
    multimap<int, map<int, set<int>>> FinalMul
    tempV.insert(1);
    tempM.insert(make_pair(4, tempV));
    FinalMul.insert(make_pair(1, tempM));
    tempV.clear();
    tempM.clear();
    tempV.insert(1);
    tempM.insert(make_pair(4, tempV));
    FinalMul.insert(make_pair(6, tempM));
    tempV.clear();
    tempM.clear();
    tempV.insert(4);
    tempM.insert(make_pair(9, tempV));
    FinalMul.insert(make_pair(6, tempM));
    tempV.clear();
    tempM.clear();
    tempV.insert(1);
    tempM.insert(make_pair(4, tempV));
    FinalMul.insert(make_pair(11, tempM));
    tempV.clear();
    tempM.clear();
    tempV.insert(1); tempV.insert(4);
    tempM.insert(make_pair(5, tempV));
    FinalMul.insert(make_pair(11, tempM));
    tempV.clear();
    tempM.clear();
    tempV.insert(4);
    tempM.insert(make_pair(9, tempV));
    FinalMul.insert(make_pair(11, tempM));
    tempV.clear();
    tempM.clear();
    tempV.insert(1); tempV.insert(4); tempV.insert(5);
    tempM.insert(make_pair(2, tempV));
    FinalMul.insert(make_pair(12, tempM));

    Check this attempt:
    typedef
    set<int>
    SET;
    typedef
    map<int,
    SET>
    MAP;
    typedef
    multimap<int,
    MAP>
    MULTIMAP;
    // remove '4' from second column
    for_each( FinalMul.begin(), FinalMul.end(),
    []( MULTIMAP::value_type
    & mmv )
    MAP & m =
    mmv.second;
    m.erase( 4 );
    // remove '4' from third column and remove empty entries
    for_each( FinalMul.begin(), FinalMul.end(),
    []( MULTIMAP::value_type
    & mmv )
    MAP & m =
    mmv.second;
    for(
    auto i = m.begin(); i != m.end(); )
    SET & s = i->second;
    s.erase( 4 );
    if( s.empty() )
    i = m.erase( i );
    else
    ++i;
    // remove empty entries
    for(
    auto i = FinalMul.begin(); i != FinalMul.end(); )
    MAP & m = i->second;
    if( m.empty() )
    i = FinalMul.erase( i );
    else
    ++i;

  • Nested structure and FCC problem (Header Problem)

    Hi all,
    I have a target structure like this:
    MT
    -Recordset (0..unbounded)
    --field1 (1)
    --field2 (1)
    Record (0..unbounded)
    field6 (0..1)
    field7 (0..1)
    After mapping:
    MT
    -Recordset (0..unbounded)
    --field1 (1)
    --field2 (1)
    Record (0..unbounded)
    field6 (0..1)
    field7 (0..1)
    -Recordset (0..unbounded)
    --field1 (1)
    --field2 (1)
    Record (0..unbounded)
    field6 (0..1)
    field7 (0..1)
    -Recordset (0..unbounded)
    --field1 (1)
    --field2 (1)
    Record (0..unbounded)
    field6 (0..1)
    field7 (0..1)
    I need header like this after FCC:
    field1,field2, field6,field7
    But Iu2019m getting something like this:
    field1,field2,Record (Because of the nested structure, I can't change the structure)
    I have used xml.addHeaderLine = 1 it didnu2019t work it gives something like the above structure.
    I have also used xml.HeaderLine = field1,field2,field6,field7  and xml.addHeaderLine =3
    Nothing is working is there any option.
    Thanks,
    Srinivas
    Edited by: Srinivas Davuluri on Jul 17, 2008 10:13 PM

    Hi,
    one option could be
    RecordSet.addHeaderLine = 3
    Recordset.headerLine = field1<ur seperator>field2<ur seperator> field6<ur seperator> field7
    Edited by: Progirl Progirl on Jul 18, 2008 9:50 AM

Maybe you are looking for

  • HP Laserjet 3030 Config Report does not print network settings or information

    I am trying to use the HP Fix Scan utility for this device. The utility asks me for an IP address (that should be found on the config report) which is not displayed. Does anyone know how I can change the config report to display this information, or

  • No Drag-n-Drop feature for my mounted Adobe Drive in my Adobe Bridge CC

    I've developed a custom Drive Connector for our storage server. In Adobe Bridge CC, after connecting and auto-mounting to our server through Adobe Drive 5, there is no Drag-n-Drop feature for my data inside the mounted drive. But, if I browse other d

  • HELP - iPod Update Problem

    Just joined the Forum after reading some of the posts here - you guys seem to know alot more about this than me so any help is greatly appreciated. My 30Gb 5th Gen iPod has software version 1.2.3. iTunes tells me there is a version 1.3 available but

  • Can swap file cause a plugin crash?

    Hi Guys, I'm in the midst of trouble shooting a crashing Cubase 7.5 on the mid 2011 iMac. I'm hoping by posting a crash log some of you guys might be able to help. I've spent hours trying to replicate the problem by removing all plugins and then re-a

  • JAXB 1.0 Final: jaxb.properties not found when using custom classloader

    JDK 1.3.1 is being used. The scenario: 1) jaxb jar files, jaxb generated files and application files loaded in default class loader works, however 2) jaxb jar files, jaxb generated files and application files loaded in a custom class loader generate