2011 Dec 09 1:34 AM
HI All,
I am creating internal table dynamically using the below syntax. Now I need to remove few of the fields from the internal table structure. Could you please help me how to go ahead in these cases?
* Create table dynamically for local data
CREATE DATA gv_table_l TYPE TABLE OF (<fs_tabname>).
CREATE DATA gv_wa_l TYPE (<fs_tabname>).
ASSIGN gv_table_l->* TO <fs_local_tab>.
ASSIGN gv_wa_l->* TO <fs_local_wa>.
Please let me know if you have any thoughts.
Thanks,
Raghu.
HI All,
I am creating internal table dynamically using the below syntax. Now I need to remove few of the fields from the internal table structure. Could you please help me how to go ahead in these cases?
* Create table dynamically for local data
CREATE DATA gv_table_l TYPE TABLE OF (<fs_tabname>).
CREATE DATA gv_wa_l TYPE (<fs_tabname>).
ASSIGN gv_table_l->* TO <fs_local_tab>.
ASSIGN gv_wa_l->* TO <fs_local_wa>.
Please let me know if you have any thoughts.
Thanks,
Raghu.
2011 Dec 09 4:47 AM
Hi Raghu,
If you have crated internal table with ref to Database table then you cant' do this. You can only achieve this by creating internal table with desired fields and then move data into this by using move-corresponding.
Regards,
Narinder pal
2011 Dec 09 5:21 AM
Hi friend
If you know the fields to be deleted then what is the use of the word dynamic ?
2011 Dec 09 5:41 AM
Hi ,
check this wiki
[Internal Table|http://wiki.sdn.sap.com/wiki/display/Snippets/Howtocreateinternaltable+dynamically]
in your case ...
1.Get filed list based on the type ...make use of "cl_abap_datadescr=>describe_by_type('MARA'), check for syntax or sample programs...
2.Delete fields which you dont want to be in your internal table....
3.Create internal table using method " CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE" ref attached link for sample code by Pinaki...
regards
Prabhu
2011 Dec 09 7:43 AM
Hi,
first you are creating a dynamic internal table. if you want to create or delete any field.at first u have to assign a variable for that field then maintain field catalog .Then create the dynamic internal table using call method.next step is used to display the output using reuse_alv_grid_display .
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |