Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6022091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:48:32+00:00 2026-05-23T03:48:32+00:00

I have a deep structure that I would like to display as a tree

  • 0

I have a deep structure that I would like to display as a tree with the values of each field (sort of like the hierarchical display of a structure you can do in SE11, but with values).

Is there a class or function that does this for you? I really don’t want to have to go reinvent the wheel.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T03:48:33+00:00Added an answer on May 23, 2026 at 3:48 am

    Well, I would say it is faster to do DIY then to search for something generic enough to help you. You can try following coding as basis.

    It does the plain recursion through the variable (be it table or structure) and it prints the fields found at bottom…

    *&---------------------------------------------------------------------*
    *&      Form  print_structure
    *&---------------------------------------------------------------------*
    form print_structure using im_data.
    
      data: lr_typeref   type ref to cl_abap_typedescr,
            lf_ddic_in   type fieldname,
            lt_dfies     type ddfields,
            lf_string    type c length 200.
          field-symbols: <lt_table> type any table,
                     <ls_table> type any,
                     <lf_field> type any,
                     <ls_dfies> like line of lt_dfies.
    
      lr_typeref = cl_abap_typedescr=>describe_by_data( im_data ).
      case lr_typeref->type_kind.
        when cl_abap_typedescr=>typekind_table. " internal table
          assign im_data to <lt_table>.
          loop at <lt_table> assigning <ls_table>.
            perform print_structure using <ls_table>.
          endloop.
        when cl_abap_typedescr=>typekind_struct1 or
             cl_abap_typedescr=>typekind_struct2. " deep/flat structure
          lf_ddic_in = lr_typeref->get_relative_name( ).
          call function 'DDIF_FIELDINFO_GET'
            exporting
              tabname     = lf_ddic_in
              all_types   = 'X'
            tables
              dfies_tab = lt_dfies
            exceptions
              not_found = 1
              others    = 0.
          check sy-subrc eq 0.
          loop at lt_dfies assigning <ls_dfies>.
            assign component <ls_dfies>-fieldname of structure im_data to <lf_field>.
            perform print_structure using <lf_field>.
          endloop.
        when others. " any field
          write im_data to lf_string.
          write: / lf_string.
      endcase.
    
    endform.                    "print_structure
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a tree data structure that is L levels deep each node has
I have a tree structure that can be n-levels deep, without restriction. That means
I have a directory structure (multiple levels deep) of resources, that I would like
I have a structure that can be very easily represented using a three-deep nested
I have an XML structure that is 4 deep: <?xml version=1.0 encoding=utf-8?> <EmailRuleList xmlns:xsd=EmailRules.xsd>
I have a folder structure 10 deep or so. I need to copy that
I have a crash that is happening deep within UIKit for some reason; an
I have a data object that is deep-cloned using a binary serialization. This data
I have a winform app that has tabcontrols that are 3 layers deep. I
I have a product catalog. Each category consists of different number (in deep) of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.