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

Dynamic internal table

Former Member
0 Likes
562

Hi everyone.

I'm working on a dynamic ALV. I've solved the field catalog, but I'm still having some problems to deal with an internal table.

I have to build an internal table that has a field for each different result of a data selection, and whose name is the value of one of this results fields. To be a little more specific, I do a selecion from BSET, and I need an internal table with a field for each different BSET-KTOSL that I get.

Is there any simple way to do this?

Thanks a lot,

Fernando Villa.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
540

Your requirement is very much possible. Once Heilman worte a blog. I used the same code and it is working fine. Find the link below.

[Click Here.|https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/2071] [original link is broken] [original link is broken] [original link is broken];

All the very best to you.

- Mohan.

5 REPLIES 5
Read only

Former Member
0 Likes
540

here is the link for creating dynamic internal tables...

check whether this helps..

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

Read only

Former Member
0 Likes
540

here is the link for creating dynamic internal tables...

check whether this helps..

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

Read only

Former Member
0 Likes
541

Your requirement is very much possible. Once Heilman worte a blog. I used the same code and it is working fine. Find the link below.

[Click Here.|https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/2071] [original link is broken] [original link is broken] [original link is broken];

All the very best to you.

- Mohan.

Read only

Former Member
0 Likes
540
Read only

Former Member
0 Likes
540

Hi,

pls go through this program.

report z_dynamic.

type-pools : abap.

field-symbols: <dyn_table> type standard table,

<dyn_wa>,

<dyn_field>.

data: dy_table type ref to data,

dy_line type ref to data,

xfc type lvc_s_fcat,

ifc type lvc_t_fcat.

selection-screen begin of block b1 with frame.

parameters: p_table(30) type c default 'T001'.

selection-screen end of block b1.

start-of-selection.

perform get_structure.

perform create_dynamic_itab.

perform get_data.

perform write_out.

form create_dynamic_itab.

Create dynamic internal table and assign to FS

call method cl_alv_table_create=>create_dynamic_table

exporting

it_fieldcatalog = ifc

importing

ep_table = dy_table.

assign dy_table->* to <dyn_table>.

Create dynamic work area and assign to FS

create data dy_line like line of <dyn_table>.

assign dy_line->* to <dyn_wa>.

endform.

Regards,

Gowri sankar

if it is usful reward points