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: 

Implicit Enhancement of an internal table

Former Member
0 Kudos

Hi,

I've been trying to add a field to an internal table via an implicit enchancement but cannot get it to work - not sure if it's even possible:

data: begin of i_tab occurs 0.

     include structure mara.

data: field1,

        field2,

enhancement 1 zz_itab.

        zfield,

endhancement.

end of i_tab.

The error is: "Comma without preceding colon (after zfield)"

Thks,

William

4 REPLIES 4

Former Member
0 Kudos

Hi William,

If you want to add an extra field to the internal table of two types.

If that internal table is created by you.

1.No need to go for enhancement.

2.Add the field first to the structure.

3.change the select query.

4.Fill the internal table with that field.

If that internal table is standard one .

1.Add the field to the database table using append structure.

2.add the field to the structure in your program.

3.change the select query.

4.Fill the internal table .

I hope this helps you.

Thanks & Regards.

Pavan Neerukonda.

Former Member
0 Kudos

Hi William,

for Dynamic enhancement of internal table, there is a concept with OO-ABAP -> dynamic internal table where the internal table is declared and filled up dynamically.

Plz refer to the below link :

http://saptechnical.com/Tutorials/ABAP/DynamicInternaltable/DynamicInternalTable.htm

Thanks

Vivek

Former Member
0 Kudos

Hello William,

  Implicit enhancement will work on start and end of program but not in between the existing logic.

You need add a new field in table Mara using append structure and then you can use that field in the program.

Rgds,

Deepti

kakshat
Advisor
Advisor
0 Kudos

Hi William,

As mentioned on the following link http://wiki.sdn.sap.com/wiki/display/ABAP/Enhancement+Framework+-+Function+group+and+Function+module..., you probably need to add another DATA statement before your new field.

Regards,

Akshat