Skip to Content
0
Jan 29, 2014 at 12:19 PM

Error in creating dynamic structure?

415 Views

Hi Guys,

i'm getting an error while creating a structure from components.

lo_struct ?= cl_abap_typedescr=>describe_by_name( 'TY_FINAL' ).

lt_comp = lo_struct->get_components( ).

APPEND LINES OF lt_comp TO lt_tot_comp.

LOOP AT it_ztqm_unit_hygien INTO wa_ztqm_unit_hygien.

la_comp-name = wa_ztqm_unit_hygien-zarea.

lo_element ?= cl_abap_elemdescr=>describe_by_data( lv_zhygiene_score ).

la_comp-type = cl_abap_elemdescr=>get_p( p_length = lo_element->length

p_decimals = lo_element->decimals ).

APPEND la_comp TO lt_tot_comp.

CLEAR: la_comp, wa_ztqm_unit_hygien.

ENDLOOP.

lo_new_type = cl_abap_structdescr=>create( p_components = lt_tot_comp // this is the place where i'm getting error

p_strict = space ).

lo_new_tab = cl_abap_tabledescr=>create(

p_line_type = lo_new_type

p_table_kind = cl_abap_tabledescr=>tablekind_std

p_unique = abap_false ).

CREATE DATA lo_data TYPE HANDLE lo_new_tab.

ASSIGN lo_data->* TO <table>.

I'm getting the following error..

Component Name 'BOILER HOUSE' of the Component 6 Contains an Invalid Character

I'm having the components like "xxx,yyy " , " LAB." , " RM & PM STORE" , "WASTE STORAGE YARD".

Does somebody have an idea how to slove this.


Thanks in Advance


Regards


satish