form buildfields using value(p_fldname) type slis_fieldname
value(p_tabname) type slis_tabname
value(p_seltext) like dd03p-scrtext_m
value(p_do_sum) type char1.
value(hotspot) type char1.
wa_fcat-col_pos = c_count.
wa_fcat-fieldname = p_fldname.
wa_fcat-tabname = p_tabname.
wa_fcat-seltext_m = p_seltext.
wa_fcat-do_sum = p_do_sum.
append wa_fcat to it_fcat.
clear wa_fcat. endform.
Did you check this link ??
http://scn.sap.com/thread/779523