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

How to get structure values into internal table

Former Member
0 Likes
586

Hi i have a senerio,

DATA: struct1 TYPE STANDARD TABLE OF struct2.

How to get the values of structure struct1 into a internal table or work area at runtime if it is declared like the above. struct2 is also a structure.

Please suggest me.

KP

Hi i have a senerio,

DATA: struct1 TYPE STANDARD TABLE OF struct2.

How to get the values of structure struct1 into a internal table or work area at runtime if it is declared like the above. struct2 is also a structure.

Please suggest me.

KP

4 REPLIES 4
Read only

Former Member
0 Likes
548

Hello,

your question doesn't actually speak about the problem and not complete. please check once again

Regards,

Sunil

Read only

amit_khare
Active Contributor
0 Likes
548

Hi,

since it is declared as TYPE STANDARD TABLE means , it is an internal table without header line.

Just declare a work area like -

data wa_struct type struct.

now whenever you have to store value just pass using work area like -

select * from mara into wa_struct.

append wa_struct to struct1.

endselect.

Regards,

Amit

Reward all helpful replies.

Read only

raviprakash
Product and Topic Expert
Product and Topic Expert
0 Likes
548

Hi KP,

In your problem, Struct1 is not a structure but an Internal Table. You can create a structure using the statement TYPE, LIKE, LIKE LINE OF etc.

So when you write DATA: STRUCT1 TYPE TABLE OF STRUCT2, here STRUCT2 is a DDIC structure or a user defined TYPE and STRUCT1 is an internal table of type STRUCT2.

Hope you got my point. Please feel free to ask any query related to this.

NOTE: Please dont forget to award the points if you are satisfied with the solution.

Thanks and regards,

Ravi .

Read only

Former Member
0 Likes
548

Try:


REPORT ztest MESSAGE-ID 00.

TYPE-POOLS sydes.

DATA: BEGIN OF itab OCCURS 0,
        f1,
        f2,
        f3,
      END   OF itab.

DATA:  itab2 TYPE sydes_desc.

DESCRIBE FIELD itab INTO itab2.

Rob