Skip to Content
0

CL_ABAP_STRUCTDESCR ..... Invalid character error

May 24, 2017 at 07:39 AM

81

avatar image
Former Member

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)
10 |10000 characters needed characters left 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?

0
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Raymond Giuseppi
May 24, 2017 at 08:35 AM
1

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.

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Dear Raymond,

Thanks for your reply. You are right. It will never wok in case of 'dot'. Yes, i tried the same way as you mentioned. So shall i remove leading dot? What would you suggest? Can you please also tell how can i check this with non-strict?

0

No choice, you must remove invalid characters...

0
Mike Pokraka May 25, 2017 at 09:34 AM
1

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.

Share
10 |10000 characters needed characters left characters exceeded