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

declare table inside a structure

abdulazeez12
Active Contributor
0 Likes
725

Hi

I wnt to declare a table inside a structure. I have the following declaration with me:

data: begin of gt_matnrtab occurs 0.

include structure qmatnr.

data: celltab type lvc_t_styl.

data: tser like gt_sernrtab occurs 0.

data: zbgmp like zbgmp occurs 0.

data: tu_line(02).

data: end of gt_matnrtab.

The above declaration is working fine, but in ECC 6.0, I dont want to use the obsolete statement "OCCURS"..

so, i want to declare it as TYPES..and without using OCCURS.

Can anyone help me out in how to declare the internal tables TSER and ZBGMP in the structure declared by using TYPES statement?

Helpful Answers Wll be definitel rewarded.

Tahnks in advance

Shakir

4 REPLIES 4
Read only

Former Member
0 Likes
585

Hi,

u can use TYPE TABLE OF statement.

data it_mara type table of MARA with header line.

CHeers,

jose.

Read only

Former Member
0 Likes
585

Hi,

try following the below code.

try to declare the itab 'gt_sernrtab' here.then proceed with the following..

types : begin of gs_matnrtab.

include structure qmatnr.

types :celltab type lvc_t_styl.

types :tser like gt_sernrtab.

types :zbgmp like zbgmp .

types :tu_line(02).

types :end of gt_matnrtab.

DATA : gt_matnrtab type table of gs_matnrtab WITH HEADER LINE.

Hope this will help u resolve ur issue..

Please reward points if useful

Regards

Rose

Read only

Former Member
0 Likes
585

Try like this :

data: begin of gt_matnrtab occurs 0.

include structure qmatnr.

data: celltab type lvc_t_styl.

data: tser like table of gt_sernrtab .

data: zbgmp like table of zbgmp .

data: tu_line(02).

data: end of gt_matnrtab.

Regards,

Himanshu

Edited by: Himanshu Verma on Mar 6, 2008 3:58 PM

Read only

SantoshKallem
Active Contributor
0 Likes
585

In ECC6 u should not use with header line, occurs..

use this way

types : begin of gs_matnrtab.

include structure qmatnr.

types :celltab type lvc_t_styl.

types :tser like gt_sernrtab.

types :zbgmp like zbgmp .

types :tu_line(02).

types :end of gt_matnrtab.

data: it_matnrtab type table of gs_matnrtab. " this is internal table with out header line.

so we need work area explicitily.

data: wa_matnrtab type gs_matnrtab. " this is work area.

regards.

santhosh reddy