2006 Mar 20 6:16 AM
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.
2006 Mar 20 6:26 AM
Ravi,
Look at this weblog.
/people/ravikumar.allampallam/blog/2005/05/31/expand-the-list-of-columns-in-a-report-dynamically
regards,
Ravi
Ravi,
Look at this weblog.
/people/ravikumar.allampallam/blog/2005/05/31/expand-the-list-of-columns-in-a-report-dynamically
regards,
Ravi
2006 Mar 20 6:26 AM
Ravi,
Look at this weblog.
/people/ravikumar.allampallam/blog/2005/05/31/expand-the-list-of-columns-in-a-report-dynamically
regards,
Ravi
2006 Mar 20 6:39 AM
Hi ravi,
I have tried LVC_FIELDCATALOG_MERGE but i get a message saying 'Field catalog not found'...
2006 Mar 20 6:41 AM
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
2006 Mar 20 6:49 AM
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'
2006 Mar 20 7:46 AM
Ravi,
Can you try declaring the table directly rather than through the types? I think it will work then.
Regards,
Ravi
2006 Mar 20 7:51 AM
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
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |