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

Append column to structure at runtime

Former Member
0 Likes
1,643

Dear all,

I'm currently working on a strong problem where I need a new column in internal table.

So there is a standard transaction where the output is a fixed table structure which cannot be enhanced. No Append is possible.

Because of this I want to add a new column to the already existing strcuture during runtime.

Following example:

Data: wa_bkpf type bkpf.

*Now I want to add a new column to the structure.Lets say I want a new column "LIFNR" so that I can add a value to this.

wa_bkpf-lifnr = '12345'.

Is this possible?

Br

6 REPLIES 6
Read only

Former Member
0 Likes
1,133

hi manuel,

why don't you try for dynamic internal table?

Read only

0 Likes
1,133

Hi,

because I'm in an SAP Standard program with an enhancement spot. The table will be displayed later on as an ALV.

Thanks

Read only

0 Likes
1,133

Hello.

I think without changing standard code no.

You need change the declaration adding a  field, but you say its all standard.

Like This: http://www.sapdev.co.uk/tips/tips_itab.htm

But in run-time i believe it not possible.

Regards.

Read only

0 Likes
1,133

Hmmm...

is it possible to overwrite data declaration?

i Thought may be it can be done with field-symbols.

br

Read only

0 Likes
1,133

I don't think so.

For what i understand no.

Read only

Former Member
0 Likes
1,133

Hi,

I did not understand your requirnment complitely, but from what did understand, i would suggest,

Take an internal table as,

data : begin of itab.

Include structure "what-ever-your-structure".

data : lifnr type lfa1-lifnr. "new field which has to be added.

data : end of itab.

Then move your final internal table and new columns values in itab accordingly.

Hope this is what you need.

Regards-

Makarand