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

Copy an internal table

Former Member
0 Likes
829

I want to copy an internal table of a type defined in the ABAP program itself, not dictionary. I have a function that is supposed to accept the internal table as a parameter of type 'any table'. The function should create the new internal table using the field catalog of the passed 'any table' and then create a new internal table using "create_dynamic_table" and return the DATA pointer.

If anyone knows how it is done pls help me out.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
796

Ravi,

Look at this weblog.

/people/ravikumar.allampallam/blog/2005/05/31/expand-the-list-of-columns-in-a-report-dynamically

regards,

Ravi

I have tried. If u can pls do post the code to retrieve the field catalog of an internal table using the function u suggest...

I am writing the internal table code below.

TYPES:

BEGIN OF MYTYPE,

NAME TYPE SOMEZTABLE-NAME,

AGE TYPE SOMEZTABLE-AGE,

END OF MYTYPE.

DATA:

IT_TABLE TYPE TABLE OF MYTABLE INITIAL SIZE 0.

CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'

EXPORTING

I_INTERNAL_TABNAME = 'it_table'

CHANGING

ct_fieldcat = lt_alv_cat[].

I have declared the lt_alv_cat as reqd.

It says 'Field catalog does not exist'

6 REPLIES 6
Read only

Former Member
0 Likes
797

Ravi,

Look at this weblog.

/people/ravikumar.allampallam/blog/2005/05/31/expand-the-list-of-columns-in-a-report-dynamically

regards,

Ravi

Read only

0 Likes
796

Hi ravi,

I have tried LVC_FIELDCATALOG_MERGE but i get a message saying 'Field catalog not found'...

Read only

0 Likes
796

Ravi,

You use the function module to create a field catalog, if you have structure or a internal table. How are you creating your field catalog?

Not sure if you have looked at the Object Model of ALV, there will not be any need for a field catalog.

If you can, paste the code here, or send it to my mail id in the business card.

regards,

Ravi

Message was edited by: Ravikumar Allampallam

Read only

0 Likes
796

I have tried. If u can pls do post the code to retrieve the field catalog of an internal table using the function u suggest...

I am writing the internal table code below.

TYPES:

BEGIN OF MYTYPE,

NAME TYPE SOMEZTABLE-NAME,

AGE TYPE SOMEZTABLE-AGE,

END OF MYTYPE.

DATA:

IT_TABLE TYPE TABLE OF MYTABLE INITIAL SIZE 0.

CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'

EXPORTING

I_INTERNAL_TABNAME = 'it_table'

CHANGING

ct_fieldcat = lt_alv_cat[].

I have declared the lt_alv_cat as reqd.

It says 'Field catalog does not exist'

Read only

0 Likes
796

Ravi,

Can you try declaring the table directly rather than through the types? I think it will work then.

Regards,

Ravi

Read only

0 Likes
796

Hi Ravi,

You need to declare internal table with out using types if you want to use the 'LVC_FIELDCATALOG_MERGE' function module.

You can populate the Filed catalog with out using the above function module, if you want to declare your internal table with types.

I think there is no specific reason for this.

Thanks,

Sreekanth