Skip to Content
avatar image
Former Member

CL_ABAP_STRUCTDESCR ..... Invalid character error

Dear Friends,

I am creating dynamic table using RTTS and display in ALV. However, I am not able to use special character as column heading.

The error is caused at statement:

gr_struct_typ = cl_abap_structdescr=>create( p_components = gt_component ).

It gives following error.

I read some thread and tried like this but it did not work.

TRY.
gr_struct_typ = cl_abap_structdescr=>create( p_components = gt_component ).
p_strict = cl_abap_structdescr=>false ).
CATCH cx_sy_struct_creation .
ENDTRY.

I also tried p_strict = space but no success. Can anyone provide a suitable solution that how can i use Special Characters cl_abap_structdescr=>create .

Thanks

error.png (61.5 kB)
Add comment
10|10000 characters needed characters exceeded

  • By the way, your leading dot looks like some names in table DD03L (table of DDIC fields) used for including structures in other structures/tables. Maybe you want to add a component ABAP_ENTW_IN of a structure which would be named BCXE1D_AE. If it's correct that BCXE1D_AE is a DDIC structure/table, don't you want to add BCXE1D_AE as an include? Or do you want to add only one component of the structure?

  • Get RSS Feed

2 Answers

  • Best Answer
    May 24, 2017 at 08:35 AM

    Is your actual code similar to

      lo_structure_type = cl_abap_structdescr=>create(
                                p_components = lt_component
                                p_strict     = abap_false ). " or ' '

    In any case, look quickly at the source of the CREATE method, even with non-strict check, there is a limited list of allowed characters. In strict mode only 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789' are allowed, and in non-strict mode only 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789#$%&*-/;<=>?@^{|}' are allowed, so your leading dot is never allowed.

    Add comment
    10|10000 characters needed characters exceeded

  • May 25, 2017 at 09:34 AM

    You talk about column heading but the error is about a component name. The two are very different.

    Names must follow the standard abap element naming rules. If you want column headings you need to provide field descriptions, where you can use special characters. Provide those as part of your components and you should be OK.

    Add comment
    10|10000 characters needed characters exceeded