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

IT_TABLE1 INSIDE IT_TABLE2

Former Member
0 Likes
398

Hello

I have

TYPES: BEGIN OF S_DESCRIPCION,
       F_DESCR(100) TYPE C, 
       C_DESCR(100) TYPE C,
 END OF S_DESCRIPCION.
TYPES: BEGIN OF S_STATUS_F. 
INCLUDE TYPE S_DESCRIPCION.
TYPES:SFVACIO TYPE C,
           SCVACIO TYPE C, 
           SMATERIAL TYPE C, 
TYPES END OF S_STATUS_F.
data:IT_STATUS_F TYPE STANDARD TABLE OF  S_STATUS_F,
      WA_STATUS_F LIKE LINE OF IT_STATUS_F.

But I like that the include type . It was a internal table because I have to do ALV and I need only one column for a description.

My idea es something like:

TYPES: BEGIN OF S_STATUS_F. 
IT_DESCRIPTION TYPE STANDARD TABLE S_DESCRIPTION,
TYPES:SFVACIO TYPE C,
           SCVACIO TYPE C, 
           SMATERIAL TYPE C, 
TYPES END OF S_STATUS_F.

It doesn't work . Some idea, please??;)

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
373

Hi Ana ,

it is called nested struture .

Calling one struture within an another struture with a referrence field .

Here is your Code

TYPES: BEGIN OF S_DESCRIPCION,
       F_DESCR(100) TYPE C,
       C_DESCR(100) TYPE C,
 END OF S_DESCRIPCION.

TYPES: BEGIN OF S_STATUS_F.
TYPES:IT_DESCRIPTION type   S_DESCRIPCION, 
       SFVACIO TYPE C,
           SCVACIO TYPE C,
           SMATERIAL TYPE C,
 END OF S_STATUS_F.

if you want and internal table to be passed to another internal table as a field then it should be like field refer to an internal table ..here

" IT_DESCRIPTION is  a field   refer to  and internal table  S_DESCRIPCION

Reward points if it is usefull ...

Girish

2 REPLIES 2
Read only

Former Member
0 Likes
374

Hi Ana ,

it is called nested struture .

Calling one struture within an another struture with a referrence field .

Here is your Code

TYPES: BEGIN OF S_DESCRIPCION,
       F_DESCR(100) TYPE C,
       C_DESCR(100) TYPE C,
 END OF S_DESCRIPCION.

TYPES: BEGIN OF S_STATUS_F.
TYPES:IT_DESCRIPTION type   S_DESCRIPCION, 
       SFVACIO TYPE C,
           SCVACIO TYPE C,
           SMATERIAL TYPE C,
 END OF S_STATUS_F.

if you want and internal table to be passed to another internal table as a field then it should be like field refer to an internal table ..here

" IT_DESCRIPTION is  a field   refer to  and internal table  S_DESCRIPCION

Reward points if it is usefull ...

Girish

Read only

Former Member
0 Likes
373

Hi Ana,

just try with this code...

TYPES: BEGIN OF S_DESCRIPCION,

F_DESCR(100) TYPE C,

C_DESCR(100) TYPE C,

END OF S_DESCRIPCION.

TYPES: BEGIN OF S_STATUS_F.

TYPES: IT_DESCRIPTION TYPE S_DESCRIPCION,

SFVACIO TYPE C,

SCVACIO TYPE C,

SMATERIAL TYPE C,

END OF S_STATUS_F.

DATA : S_STATUS_F1 type S_STATUS_F.

WRITE S_STATUS_F1.

Cheers,

Enjoy,

Sagun Desai.....