Skip to Content
1
Apr 22, 2014 at 01:36 PM

Nested Type consisting another table type!

1023 Views

Hi,

How can I achieve below type declarations?

TYPES:BEGIN OF ty_scarr,

carrid TYPE scarr-carrid,

carrname TYPE scarr-carrname,

currcode TYPE scarr-currcode,

END OF ty_scarr,

BEGIN OF ty_sflight,

carrid TYPE sflight-carrid,

connid TYPE sflight-connid,

fldate TYPE sflight-fldate,

price TYPE sflight-price,

END OF ty_sflight,

tt_sflight TYPE STANDARD TABLE OF ty_sflight.

TYPES:BEGIN OF ty_result.

INCLUDE TYPE ty_scarr.

TYPES: sflight_tab TYPE tt_sflight,

END OF ty_result.

The above results in syntax error however below one works:

TYPES:BEGIN OF ty_scarr,

carrid TYPE scarr-carrid,

carrname TYPE scarr-carrname,

currcode TYPE scarr-currcode,

END OF ty_scarr,

BEGIN OF ty_sflight,

carrid TYPE sflight-carrid,

connid TYPE sflight-connid,

fldate TYPE sflight-fldate,

price TYPE sflight-price,

END OF ty_sflight,

tt_sflight TYPE ty_sflight OCCURS 0.

TYPES:BEGIN OF ty_result.

INCLUDE TYPE ty_scarr.

TYPES: sflight_tab TYPE tt_sflight,

END OF ty_result.

Is there a way to achieve above without using "OCCURS 0" keyword as "OCCURS" keyword is not supported withing OO context?

Thanks!