Skip to Content
0
Aug 28, 2007 at 11:50 AM

dynamic column Name# Contains Invalid Characters. Bind_table() fails

118 Views

Hi WD experts,

I have tried to use the bind_table() on a dynamically generated table. Now it happens that this dynamic table contains columns like NAME# . This gave rise to a dump :

The Name NAME# Contains Invalid Characters. Valid Characters are A-Z, 0-9, _, and /.

Other tables which do not have such columns are correctly bound.

In my method , I first loop over the field catalog to retrieve some field names from a dynamicallt generated report...

LOOP AT lt_fieldcat_out INTO lwa_fieldcat.

comp-name = lwa_fieldcat-fieldname.

comp-type ?= cl_abap_typedescr=>DESCRIBE_BY_DATA( lwa_fieldcat-FIELDNAME ).

APPEND comp TO comp_tab.

ENDLOOP.

  • structure which represents the dynamic table

struct_type = cl_abap_structdescr=>get(

p_components = comp_tab

p_strict = abap_FALSE ).

node_info = wd_context->get_node_info( ).

node_info = node_info->add_new_child_node(

name = 'DYN_TAB_NODE'

IS_MANDATORY = ABAP_TRUE

IS_MANDATORY_SELECTION = ABAP_FALSE

IS_MULTIPLE = ABAP_TRUE

IS_MULTIPLE_SELECTION = ABAP_FALSE

IS_SINGLETON = ABAP_FALSE

IS_INITIALIZE_LEAD_SELECTION = ABAP_FALSE

static_element_rtti = struct_type

is_static = abap_false

).

struct_type = node_info->GET_STATIC_ATTRIBUTES_TYPE( ).

Afterwards, I bind a dynamic table to the new node...

Do you have an idea how to circumvent this ?

Thank you,

cheers,Zied.