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

Data Declaration

Former Member
0 Likes
1,054

Hello Friends,

I want to declare an internal table with some fields and also a structure.

DATA: BEGIN OF t_to_header OCCURS 0 WITH HEADER LINE.

DATA include structure ltak.

DATA : date TYPE sy-datum,

open_age TYPE i,

confirmed_age TYPE i,

END OF t_to_header.

Please help me finding the error here.

Regards,

Salil

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,032

Try:

DATA: BEGIN OF t_to_header OCCURS 0.
        INCLUDE STRUCTURE ltak.
DATA : date TYPE sy-datum,
       open_age TYPE i,
       confirmed_age TYPE i,
END OF t_to_header.

Rob

9 REPLIES 9
Read only

Former Member
0 Likes
1,032

Hi

write like this and see

DATA: BEGIN OF t_to_header OCCURS 0 .

DATA include structure ltak.

DATA : date TYPE sy-datum,

open_age TYPE i,

confirmed_age TYPE i,

END OF t_to_header.

Regards

Anji

Read only

Former Member
0 Likes
1,033

Try:

DATA: BEGIN OF t_to_header OCCURS 0.
        INCLUDE STRUCTURE ltak.
DATA : date TYPE sy-datum,
       open_age TYPE i,
       confirmed_age TYPE i,
END OF t_to_header.

Rob

Read only

0 Likes
1,032

Thanks Rob. It worked.

Read only

Former Member
0 Likes
1,032

DATA: BEGIN OF t_to_header OCCURS 0.

include structure ltak.

DATA : date TYPE sy-datum,

open_age TYPE i,

confirmed_age TYPE i,

END OF t_to_header.

If it is helpful please give me reward points

Thanks

Murali Poli

Read only

Former Member
0 Likes
1,032

Hi.

You need to write

DATA: BEGIN OF t_to_header OCCURS 0.

INCLUDE STRUCTURE ltak.

DATA : date TYPE sy-datum,

open_age TYPE i,

confirmed_age TYPE i,

END OF t_to_header.

Regards

Sudheer

Read only

Former Member
0 Likes
1,032

TYPES: BEGIN OF t_repdata.

INCLUDE STRUCTURE tab_ekpo. "could include EKKO table itself!!

TYPES: bukrs TYPE ekpo-werks,

bstyp TYPE ekpo-bukrs.

TYPES: END OF t_repdata.

DATA: it_repdata TYPE STANDARD TABLE OF t_repdata INITIAL SIZE 0.

Use this... it_repdata is your itab.

Reward points if found useful

Read only

JozsefSzikszai
Active Contributor
0 Likes
1,032

hi Salil,

the nice way to do that:

  • First you define a general type

TYPES : BEGIN OF t_to_header.

INCLUDE STRUCTURE ltak.

TYPES : date TYPE sy-datum,

open_age TYPE i,

confirmed_age TYPE i,

END OF t_to_header.

  • Thena a work area (from the type)

DATA : gw_header TYPE t_to_header.

  • Then an internal table (from the type)

DATA : gt_geader TYPE STANDARD TABLE OF t_to_header.

Pls. not the internal table has no header line (but you have the work area)

hope this helps

ec

Read only

Former Member
0 Likes
1,032

HII

DONT USE DATA STATEMENT BEFIRE INCLUDE

PLEASE DO IT LIKE THIS.

DATA: BEGIN OF t_to_header OCCURS 0.
        INCLUDE STRUCTURE ltak.
DATA : date TYPE sy-datum,
       open_age TYPE i,
       confirmed_age TYPE i,
END OF t_to_header.

REWARD IF HELPFUL

VIVEKANAND

Read only

Former Member
0 Likes
1,032

hi

good

DATA: BEGIN OF t_to_header OCCURS 0 WITH HEADER LINE,

include structure ltak,

date TYPE sy-datum,

open_age TYPE i,

confirmed_age TYPE i,

END OF t_to_header.

hope this wont give you any error.

reward point if helpful.

thanks

mrutyun^