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

Describe for deep structure in dynamic internal table

Hi All,

How to use describe in dynamic internal table with deep structure ?

I have created a dynamic internal table with deep structure table and after extracting data in this table when this i'm using describe for get the no's of rows for particuler deep structure ,i'm getting error that this deep structure is not a internal table,

One reason for this is due to deep structure is created at runtime it's unable to consider as a internal table.

DESCRIBE TABLE <dyn_table> LINES sy-tfil l. Works fine

DESCRIBE TABLE <dyn_table>-struct01 LINES sy-tfill. Error

Regards,

Anuj jain

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Feb 01, 2012 at 08:19 AM

    HI friend,

    Its simple.

    Just try lines(internal table name).

    This will give you the number of lines. I think this is ok if queries please revert back to me.

    Thanks,

    Sri Hari

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 01, 2012 at 08:43 AM

    Hi Anuj

    Try the following:

    DATA : t_sflight TYPE STANDARD TABLE OF sflight,
           x_sflight TYPE sflight,
           v_lines   TYPE i.
    
    FIELD-SYMBOLS : <fs_table> TYPE ANY TABLE.
    
    SELECT *
           INTO TABLE t_sflight
           FROM sflight.
    
    ASSIGN t_sflight TO <fs_table>.
    
    v_lines = lines( <fs_table> ).

    Thanks and Regards

    Rinzy Deena Mathews.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 01, 2012 at 09:08 AM

    Hi Anuj,

    I doubt that the deep structure internal table can be addressed using table name.

    Kindly try to implement the following code.

    	
      DATA : lv_totcount TYPE i. 
      FIELD-SYMBOLS : <fs_table> TYPE STANDARD TABLE,
                      <fs_wa>    TYPE ANY,
                      <fs_field> TYPE STANDARD TABLE.
    
      CREATE DATA dref_table TYPE TABLE OF (p_tabtype).
      ASSIGN dref_table->* TO <fs_table>.
    
      CREATE DATA dref_wa TYPE (p_tabtype).
      ASSIGN dref_wa->* TO <fs_wa>.
    
      LOOP AT <fs_table> INTO <fs_wa>.
          ASSIGN COMPONENT 'STRUCT01' OF STRUCTURE <fs_wa> TO <fs_field>.
          IF sy-subrc EQ 0.
             DESCRIBE TABLE <fs_field> LINES sy-tfill. " Will provide individual record count
             ADD sy-tfill TO lv_totcount.	           " Will Provide the count for all the records in the main internal table
          ENDIF.
    ENDLOOP.
    

    Hope this helps to attain the expected solution.

    Thanks & Regards,

    Chakravarthi Pattabi

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 03, 2012 at 08:13 AM

    Thanks Chakravarthi Pattabi,

    It's resolved .

    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.