Application Development and Automation 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: 
Read only

How to include a structure in a method

Former Member
0 Likes
1,443

Hi All,

when i executed this statement in a method

types : BEGIN OF TY_ITAB2.

INCLUDE STRUCTURE LTAP_VB.

types : END OF TY_ITAB2.

Syntax Message:

Within classes and interfaces, you can only use "TYPE" to refer to ABAP Dictionary types, not "LIKE" or "STRUCTURE".

how to create such structure

1 ACCEPTED SOLUTION
Read only

athavanraja
Active Contributor
950

types: ty_itab2 type LTAP_VB .

5 REPLIES 5
Read only

athavanraja
Active Contributor
951

types: ty_itab2 type LTAP_VB .

Read only

0 Likes
950

in that structure i.e., ty_itab2.... I want add to 3 new fields also

like KUNNR, ADRNR and NAME1. How these fields can b added

thanks for ur reply.

Read only

0 Likes
950

Here it is,


  DATA: w_ltap_vb TYPE ltap_vb.

  TYPES : BEGIN OF ty_itab2.
  TYPES: kunnr TYPE kunnr,
         name1 TYPE name1_gp,
         adrnr TYPE adrnr.
          INCLUDE STRUCTURE w_ltap_vb.
  TYPES : END OF ty_itab2.

Regards

Kathirvel

Read only

0 Likes
950

thanks a lot

Read only

Former Member
0 Likes
950

You can try like this,



  DATA: w_spfli TYPE spfli.

  TYPES: BEGIN OF t_flight.
  TYPES: select TYPE char1.
          INCLUDE STRUCTURE w_spfli.
  TYPES: END OF t_flight.

Regards

Kathirvel