Skip to Content
0
Former Member
May 17, 2005 at 11:10 AM

Assigning fields(data) to field symbos of table

26 Views

Hi All,

Though there is lot of material available on the concept of field symbols I could not apply the logic of it to my problem. Hence posting this query.

I am creating dynamic internal table and want to populate that internal table with other itab.

i have created Field symbols now how to populate the part of the other itab to field symbols which

points to other itab.

My code is like

data : p_intab LIKE dfies-tabname .

data : begin of wbs occurs 0,

wbs type c,

objnr type proj-objnr,

end of wbs.

FIELD-SYMBOLS :

<fs_tab> LIKE LINE OF tab_info,

  • Output Structure****

<it_disptab> TYPE table .

p_intab = fieldcatalog.

ASSIGN p_intab TO <fs_tab>-tabname .

CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'

EXPORTING

i_structure_name = <fs_tab>-tabname

CHANGING

ct_fieldcat = it_grid_fcat.

*Creating internal table

CALL METHOD cl_alv_table_create=>create_dynamic_table

EXPORTING

it_fieldcatalog = it_grid_fcat

IMPORTING

ep_table = dref.

ASSIGN dref->* TO <it_disptab>.

PERFORM populate_grid_data .

CALL METHOD grid->set_table_for_first_display

EXPORTING

is_layout = struct_grid_lset

CHANGING

it_outtab = <it_disptab>

it_fieldcatalog = it_grid_fcat

. " Period

form populate_grid_data.

*i want to populate the fields of dynamic internal table <it_disptab>

with wbs

endform.

*once i display it to user he will edit the values that i want to save it back to transperant table from fields symbols <it_disptab>.

Best Regards

Sandeep