Application Development 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: 

header line in internal table

former_member220801
Participant
0 Kudos
134

I have declared a 'table in table' structure. (is it called deep structure?)

TYPES: BEGIN of ty_test1

header TYPE ty_header,

detail TYPE ty_detail OCCURS 0,

END of ty_test1.

DATA: it_test TYPE STANDARD TABLE OF ty_test1 WITH HEADER LINE OCCURS 0.

Can I also have a header line declared for the structure 'detail' inside the internal table so that I can use related functions LIKE 'MOVE-CORRESPONDING', 'SELECT..INTO CORRESPONDING FIELDS...' and 'LOOP AT it_test-detail'?

Thanks!

1 ACCEPTED SOLUTION

Former Member
0 Kudos
101

Hi,

Yes you can Declare.

But I am not sure about this deep structure.

5 REPLIES 5

Former Member
0 Kudos
102

Hi,

Yes you can Declare.

But I am not sure about this deep structure.

0 Kudos
101

I don't think it's possible to have a header line.

You have to declare a aux. structure.

But Phani may Know another way, for his reply.

Alexandre Nogueira.

0 Kudos
101

I was getting some syntax problems with you code. I have adjusted.



types: begin of ty_test1,
           header type ty_header,
           detail type ty_detail occurs 0,
       end of ty_test1.

data: it_test type standard table of ty_test1 with header line.
data: wa_test type ty_test1.


Regards,

Rich Heilman

0 Kudos
101

Ok, here is a little sample. Put it in debug and watch it work.



Types: ty_header(10) type c,
       ty_detail(10) type c.


types: begin of ty_test1,
           header type ty_header,
           detail type ty_detail occurs 0,
       end of ty_test1.

data: it_test type standard table of ty_test1 with header line.
data: wa_test type ty_test1.

data: it_detail type table of ty_detail.
data: wa_detail type ty_detail.


wa_detail = 'blahblahblah'.
append  wa_detail to it_detail.

wa_test-detail[] = it_detail[].
append wa_test to it_test.


Check sy-subrc  = 0.

Regards,

Rich Heilman

Former Member
0 Kudos
101

yes u can declare

data : wa_test like it_test.

Message was edited by: chandrasekhar jagarlamudi