Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Type I_LISTADO is unknown

Former Member
0 Kudos

Hi Experts,

When I give TYPE instead of LIKE in this statement. It give an error message.

What is the way I can give TYPE in the below staement.

   data: begin of i_listado OCCURS 10,

       KUNNR like kna1-KUNNR,

       LAND1 like kna1-LAND1,

       TELFX   like kna1-TELFX,

     end of i_listado.
DATA LS_LISTADO TYPE i_listado."Work area

6 REPLIES 6

Former Member
0 Kudos

this will be the code

types: BEGIN OF i_listado,

  KUNNR LIKE kna1-KUNNR,

  LAND1 LIKE kna1-LAND1,

  TELFX   LIKE kna1-TELFX,

END OF i_listado.

DATA LS_LISTADO TYPE i_listado."

Thanks

Bala

VijayaKrishnaG
Active Contributor
0 Kudos

Hi Toby,

When you declare BEGIN OF XYZ... ENDOF XYZ. that will be considered as an internal table. Then if you want to declare a structure/workarea with respect to that internal table you can declare it as

DATA : LS_LISTADO LIKE LINE OF I_LISTADO.

Otherwise you should declare a structure with

TYPES : BEGIN OF XYZ... END OF XYZ.

Then declare an internal table as

DATA : ITAB TYPE STANDARD TABLE OF XYZ.

DATA : L_WA TYPE XYZ.

Thank you,

-Vijay

former_member424229
Participant
0 Kudos

Hi,

   The main difference between 'data' and 'types' is when we are using 'data' it provide some space in memory that means the statement creates data object.

when we are using the 'types'  it just gives the reference not create any space in the memory.

That's you are getting 'unknown' syntax error.

Please follow the 'bala'  reply .it's good.

types: BEGIN OF i_listado,

  KUNNR LIKE kna1-KUNNR,

  LAND1 LIKE kna1-LAND1,

  TELFX   LIKE kna1-TELFX,

END OF i_listado.

DATA LS_LISTADO TYPE i_listado."

0 Kudos


Bala did not bring any internal table scenarios in explanation.

0 Kudos

Hi Toby

First of all this way of declaration is obsolete. Please search for the syntax on SCN. Secondl you dont need to declare work area as the type of declaration which you have done will create an internal table with header line so you will have work area with same name

Nabheet

former_member196157
Active Participant
0 Kudos

hiii,,

types: begin of ty_listado ,

        KUNNR like kna1-KUNNR,

        LAND1 like kna1-LAND1,

        TELFX   like kna1-TELFX,

      end of ty_listado.

data: i_listado type TABLE OF ty_listado WITH HEADER LINE, " both internal table and work area
       LS_LISTADO type ty_LISTADO. " Now it is work area