Skip to Content
avatar image
-1
Former Member

reading the data from sap table which has field name SString.

Hi,

I have created a table. and have one field called "name" which has sstring datatype.

now I am trying to create the internal table for this.

while activating this code the error I am getting is " "table name' must be a flat structure. You cannot use internal tables, strings, references, or structures as components"

what is the reason of this error.

below is my code snippet

types:begin of t_zanshu2.

include structure zanshu2.

types: end of t_zanshu2.

data: it_anshu type standard table of t_zanshu2 initial size 0,

wa_anshu type t_zanshu2.

where zanshu2 is a table which has 3 field

zid(50) NUM

zname(245) sstring

zadd (255) char

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Jun 02, 2017 at 09:07 PM

    INCLUDE STRUCTURE is very old and almost obsolete (and also INCLUDE TYPE, as said in the ABAP documentation).

    INCLUDE STRUCTURE accepts only flat structures, because it's the way how the word "STRUCTURE" works in statements for typing parameters (FORM and FUNCTION).

    You may use INCLUDE TYPE instead.

    PS: sorry to resurrect this OLD question, but I was wondering why INCLUDE STRUCTURE behaved this way, the official ABAP documentation is not clear.

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 04, 2017 at 12:49 PM

    Instead of

    types:begin of t_zanshu2.

    include structure zanshu2.

    types: end of t_zanshu2.

    Use

    types t_zanshu2 type zanshu2.

    Or directly

    data: it_anshu type standard table of zanshu2 initial size 0,

    ...

    Add comment
    10|10000 characters needed characters exceeded