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

Declare structure

Former Member
0 Likes
506

Hi,

I'm developing a report that display all the fields in LAGP and LQUA. Then, i tried to to declare the following structure:

TYPES: BEGIN OF TY_REPORT.

INCLUDE STRUCTURE LAGP.

INCLUDE STRUCTURE LQUA.

TYPES: MFRPN LIKE MARA-MFRPN,

END OF TY_REPORT.

It returns error that the MANDT field is existed in LAGP and LQUA. Besides, the LGNUM, ..., etc are also exist in LAGP and LQUA. Is there any way that can declare this kind of structure without enter each field??

Regards,

Kit

1 REPLY 1
Read only

Wil_Wilstroth
Active Participant
0 Likes
337

Dear Kit,

Because these two tables (LAGP and LQUA) contains keys that is both used in two tables thus if you declare it like your way, surely, the ABAP editor will give you those errors...

For neatness in your program.. why don't you go to se11 and create a structure for the fields you wanted from both tables (LAGP and LQUA)...

thus after create a new structure in SE11 incorporating LAGP and LQUA then you can use your way of declaring your structure in ABAP.

For example, you create a structure called LAQUAP in se11.

Then in your coding...

TYPES: BEGIN OF TY_REPORT.

INCLUDE STRUCTURE LAQUAP.

TYPES: MFRPN LIKE MARA-MFRPN,

END OF TY_REPORT.

This is one of my options. AND EVEN , with this way you still have to enter each of the field into your structure.

Hope it helps you.

Thanks

William Wilstroth.

William Wilstroth