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 set table enhancement explicitly in program ?

Former Member
0 Likes
1,661

how to set table enhancement explicitly in program for a table MARA while reading the data from Table ?

Getting ERROR for the below code as.

"The enhancement specification of structure type "LFA1" is not consistent"

Checked the table and the enhancement is set as : "can be enhanced (Deep)".

REPORT ZSAMPLE08.

TYPES: BEGIN OF TY_LFA1,
LIFNR TYPE LIFNR,
LAND1 TYPE LAND1,
NAME1 TYPE NAME1,
NAME2 TYPE NAME2,
END OF TY_LFA1.

data: it_tab TYPE TABLE OF ty_lfa1,
wa_tab type ty_lfa1.

SELECT-OPTIONS: s_lifnr for wa_tab-lifnr.

SELECT lifnr
land1
name1
name2 from lfa1
into TABLE it_tab
WHERE lifnr in s_lifnr.

loop at it_tab INTO wa_tab.

WRITE: / wa_tab-lifnr,
wa_tab-land1,
wa_tab-name1,
wa_tab-name2.

endloop.

how to set table enhancement explicitly in program for a table MARA while reading the data from Table ?

Getting ERROR for the below code as.

"The enhancement specification of structure type "LFA1" is not consistent"

Checked the table and the enhancement is set as : "can be enhanced (Deep)".

REPORT ZSAMPLE08.

TYPES: BEGIN OF TY_LFA1,
LIFNR TYPE LIFNR,
LAND1 TYPE LAND1,
NAME1 TYPE NAME1,
NAME2 TYPE NAME2,
END OF TY_LFA1.

data: it_tab TYPE TABLE OF ty_lfa1,
wa_tab type ty_lfa1.

SELECT-OPTIONS: s_lifnr for wa_tab-lifnr.

SELECT lifnr
land1
name1
name2 from lfa1
into TABLE it_tab
WHERE lifnr in s_lifnr.

loop at it_tab INTO wa_tab.

WRITE: / wa_tab-lifnr,
wa_tab-land1,
wa_tab-name1,
wa_tab-name2.

endloop.

4 REPLIES 4
Read only

Former Member
0 Likes
1,148

use 'into corresponding fields of' instead of INTO table and try.

Read only

matt
Active Contributor
1,148

Why do you talk about MARA when MARA isn't in your program?

Read only

matt
Active Contributor
1,148

Go to SE11, look at table LFA1, check its enhancement category. See if someone has repaired it.

Read only

retired_member
Product and Topic Expert
Product and Topic Expert
1,148

Try to understand the meaning of Enhancement Category. Check the settings in SE11. This should explain the syntax error.