2007 Feb 19 10:37 PM
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
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
2007 Feb 19 10:41 PM
Hello,
your question doesn't actually speak about the problem and not complete. please check once again
Regards,
Sunil
2007 Feb 19 10:42 PM
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.
2007 Feb 19 10:46 PM
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 .
2007 Feb 19 11:05 PM
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
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |