Skip to Content
author's profile photo Former Member
Former Member

custom structure

There is a custom structure in se11, in which one of the fields say f3 is of the type standard transparent table. Now how do I refernce the fiels of this table through an internal table.

An internal table declared of this custom structure type has a structure like f1, f2, f3-fa, f3-fb, f3-fc.... where fa, fb, fc are fields of the standard transparent table.

Thanks.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    Posted on Sep 04, 2006 at 04:04 PM

    Here is a better example of how to get the values of your deep structure.

    
    report  zrich_0001.
    
    data: begin of ispfli occurs 0,
           carrid type spfli-carrid,
           connid type spfli-connid,
         <b>  ibookings type standard table of sbook,</b>
          end of ispfli.
    
    data: xspfli like line of ispfli.
    data: xbookings type sbook.
    
    loop at ispfli.
    
    
      read table <b>ispfli-ibookings into xbookings</b> index 1.
      if sy-subrc = 0.
        write:/ <b>xbookings-customid</b>.
      endif.
    
    endloop.
    
    

    Regards,

    Rich Heilman

    Add a comment
    10|10000 characters needed characters exceeded

    • ispfli-ibookings is a internal table within the internal table ispfli. The read statement here is simply just reading the first record in that table(ibookings)

      Doing this statement will not work.

      xbookings = ispfli-ibbokings.

      Here you see that you are trying to move the internal table into the workarea called xbookings. ISPFLI-IBOOKINGS has no header line, so this does not help. You will get a syntax error.

      Regards,

      Rich Heilman

  • Posted on Sep 04, 2006 at 03:52 PM

    You can reference like this. I hope that this is what you mean.

    data: begin of itab occurs 0,
          fld <b>type stru-f3-fa</b>,
          end of itab.

    Regards,

    Rich Heilman

    Add a comment
    10|10000 characters needed characters exceeded

    • Rich Heilman Abdul Hakim Sulaiman Batcha

      I think I see what you are talking about now. It is a little tricky. Here ZSPFLI is my structure, it contains CARRID CONNID and a table type of SBOOK.

      
      
      report  zrich_0001.
      
      
      <b>data: ispfli type table of ZSPFLI with header line.
      data: xspfli like line of ispfli.
      
      data: xbookings like line of ispfli-ibookings.</b>
      
      data: begin of itest occurs 0,
           <b> fld like xbookings-customid,</b>
            end of itest.
      
      loop at ispfli.
      
      
        read table ispfli-ibookings into xbookings index 1.
        if sy-subrc = 0.
          write:/ xbookings-customid.
        endif.
      
      endloop
      
      

      REgards,

      Rich Heilman

  • author's profile photo Former Member
    Former Member
    Posted on Sep 04, 2006 at 03:54 PM

    Thanks for replying Rich....but I get an error for this saying that 'the stru is a flat type...'

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 04, 2006 at 03:55 PM

    If you mean how to get the value of these fields in your internal table, then just remember that it is another internal table and must be read. For example.

    itab is structure like your custom structure, one field, F3 is a table itself, so you will need to read this.

    loop itab into wa.
    
    read table wa-f3 index 1.  " Or however you need to read it.
    if sy-subrc = 0.
      write:/ wa-f3-fa.
    endif.
    
    
    
    
    endloop.

    Regards,

    Rich HEilman

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 04, 2006 at 06:11 PM

    Thanks!

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.