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

wrong TYPES definition?

former_member183924
Active Participant
0 Likes
629

Hi experts,

For my selection I define a internal table

This works:

DATA: it_lab_data  TYPE TABLE OF zmm_lab_offen,
     wa_lab_data  TYPE zmm_lab_offen.

If I select something I can see the table is filled.

Now, for my selection I need a temporary field more than my transparent table (zmm_lab_offen) has. So I tried to define a new TYPE including this table.


TYPES: BEGIN OF s_lab_data,
         struk TYPE zmm_lab_struktur,
         loekz TYPE boolean,
       END OF s_lab_data.
TYPES: tt_lab_data TYPE STANDARD TABLE OF s_lab_data WITH DEFAULT KEY.
DATA: it_lab_data TYPE tt_lab_data.

SELECT *
FROM  'inner join over 3 tables'
INTO CORRESPONDING FIELDS OF TABLE it_lab_data
WHERE ...

But this doesn't work. The Selection even imports 1600 rows but all fields are empty or has the value '0'!

What am I doing wrong??? I 've got the TYPES definition by the "ABAP Objects" book...

Regards,

Steffen

1 ACCEPTED SOLUTION
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
603

Hi,

Use the following.

TYPES: BEGIN OF s_lab_data.

INCLUDE structur zmm_lab_struktur.

TYPES: loekz TYPE boolean,

END OF s_lab_data.

Regards,

Sesh

Message was edited by:

Seshatalpasai Madala

5 REPLIES 5
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
604

Hi,

Use the following.

TYPES: BEGIN OF s_lab_data.

INCLUDE structur zmm_lab_struktur.

TYPES: loekz TYPE boolean,

END OF s_lab_data.

Regards,

Sesh

Message was edited by:

Seshatalpasai Madala

Read only

0 Likes
603

can't be used in OO context --> generates an error

In the keywordmanual it is recommend to use

DATA: BEGIN OF rec, 
        ... 
        rec LIKE s, 
        ... 
      END OF rec.

instead of


DATA: BEGIN OF rec, 
        ... . 
        INCLUDE STRUCTURE s. 
DATA:   ... 
      END OF rec. 

but this also don't work for me. LIKE and STRUCTURE cannot be used in methods. I have to use TYPE...

regards,

steffen

Read only

0 Likes
603

HI,

Then only way out is either declare it as a DDIC table type or inlcude it in type group and use that type group for your class.

Regards,

Sesh

Read only

0 Likes
603

ok I already thought like this. But a temporary way would be much smoother..

THanks,

Regards

steffen

Read only

Former Member
0 Likes
603

<Sorry for repost...>