Skip to Content
0
Former Member
Jul 27, 2010 at 04:07 PM

Populating created Dynamic table for alv

28 Views

Hi Experts,

I have created a dynamic table as below :

CALL METHOD cl_alv_table_create=>create_dynamic_table

EXPORTING

it_fieldcatalog = i_lvc_cat

IMPORTING

ep_table = new_table.

  • Create internal Table

ASSIGN new_table->* TO <f_itab>.

  • Create workarea of type dynamic table

CREATE DATA new_table LIKE LINE OF <f_itab>.

ASSIGN new_table->* TO <f_wa>.

Also, I have internal table which is like : ITAB

WERKS BTRTL TEXT BONUSAMT LTC_AMT

3001 300A ADMIN 100.00 150.00

3001 300B FINANCE 200.00 250.00

3001 300C HR 300.00 350.00

3002 300D Bus Del 400.00 450.00

3002 300E Comp 500.00 550.00

Now, data in column TEXT would be the columns created dynamically in table <f_itab> i created above.

Depending on WERKS column data, I have to populate dynamic created table <f_itab> with values of table ITAB.

Eg : Column1 WERKS ADMIN FINANCE HR Bus Del Comp Total

BONUSAMT 3001 100.00 200.00 300.00 0.00 0.00 600.00

BONUSAMT 3002 0.00 0.00 0.00 400.00 500.00 900.00

LTC_AMT 3001 150.00 250.00 350.00 0.00 0.00 750.00

LTC_AMT 3002 0.00 0.00 0.00 450.00 550.00 1000.00

Please help me in coding this.

Thanks a lottt.

Regards,

Shital.

Moderator message - Please do not use words like "urgenttt" in your posts

Edited by: Rob Burbank on Jul 27, 2010 1:59 PM