2009 Feb 19 8:26 PM
HI all,
I am creating a dynamic internal table. Everything id fine but when creating dynamic structure if field name contains space its giving me dump.Can you please suggest me any other methos which takes space in the field name.
Iam using the following method:
gr_struct_typ ?= cl_abap_structdescr=>create( p_components = gt_component ).
In the gt_component i have one of the field with space like ( RU STAND) and its giving error.
Any help will be appreciated.
thanks
Suku.
2009 Feb 19 8:33 PM
can't you just check it and change it if it is not compliant?
DATA:
colname(80) TYPE c VALUE 'RU STAND'.
REPLACE ALL OCCURRENCES OF REGEX '[^A-Z_0-9/]'
IN colname WITH '' IGNORING CASE.
TRANSLATE colname TO UPPER CASE.
WRITE colname.
2009 Feb 19 8:33 PM
can't you just check it and change it if it is not compliant?
DATA:
colname(80) TYPE c VALUE 'RU STAND'.
REPLACE ALL OCCURRENCES OF REGEX '[^A-Z_0-9/]'
IN colname WITH '' IGNORING CASE.
TRANSLATE colname TO UPPER CASE.
WRITE colname.
2009 Feb 19 8:44 PM
Hello Sukumar
If the space in the fieldname is a mistake then you could simply use:
CONDENSE ld_fieldname NO-GAPS.
However, I guess your fieldname should contain this space:
>...suggest me any other methos which takes space in the field name.
>
Well, have you ever seen a field or column name in SAP standard containing a space in its name???
Regards
Uwe
2009 Feb 19 8:50 PM
Hi Uwe,
I know that SAP field name doesnt contain spaces. Actually I am showing field values as columns.
I think now you understood.
thanks
suku