Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Underscore as first lettern within SM30 entry

Former Member
0 Likes
1,675

Hello,

I have to insert an "_" in a charfield, using the SE16/SM30. This character is always deleted. Does has anyone an idea to avoid this behavior?

Thanks & Regards

Geert

10 REPLIES 10
Read only

Former Member
0 Likes
1,409

I have tried with char field, it doesnt get deleted.

COuld you tell exactly which field are you trying to populate.

Read only

0 Likes
1,409

It's a char 5 field within a customizing table. A table entry screen is generated and with the SE16/SM30 data will be entered.

Read only

0 Likes
1,409

Hi,

I tried with _abcd , abc,_abc_.

All is accepted. are you creating a z dataelement or directly refering to char5?

Read only

0 Likes
1,409

I tried both.

Z Domain:

Datentyp CHAR Zeichenfolg

Zahl der Stellen 5

Dezimalstellen 0

Ausgabelänge 5

Konvert.-Routine

Vorzeichen

Kleinbuchstaben

and also CHAR5

Thanks & Regards

Geert

Read only

0 Likes
1,409

Hi,

Its working fine ,i have tried with several combinations.

FIELD DATAELEMENT TYPE LENGTH DECIMAL DESCRIPTION

TEST CHAR5 CHAR 5 0 R/2 table

Try creating a dummy table and add just char5 data element and see if its working,

Read only

0 Likes
1,409

Hi Geert,

It's a char 5 field within a customizing table.

Is this customizing table a Z table or a standard SAP table?

Also look at the Modification events, if they have any code that deletes "_" or any special characters.

I tried the same with a Z table and it works fine.

Regards,

Chen

Read only

0 Likes
1,409

Hi Chen,

sorry for delay, I was on vacation ...

I didn't tell proberly what the problem is. The error orccurs if I write a single "_" or "__". In combination with any other character it works like you mentioned.

Regards,

Geert

Read only

0 Likes
1,409

Hi Geert,

Yes you are correct, we can not input only underscores in text field.

But this is not only in SM30/SE16 it is valid for Parameters and input output fields also.

Only underscore is considered as blank.

Thanks,

Anmol.

Read only

0 Likes
1,409

Hi Geert,

You cannot use '_' alone as an input in a text field, i suppose the reason for this is that "_" is a wild character in SQL that represents any character and hence not allowed as input to overcome SQL injection or something.

And Anmol is right, it is not only on the dialog screens but even selection screen elements ignore this. For ex: if you input _ in a mandatory field and execute it will throw an error to fill up the field.

Regards,

Chen

Read only

0 Likes
1,409

Hi Chen,

thats what I also recognized. I solved the problem with a workaround. If I want to use a single underscore I put a "&" as beginning and filter it during processing. It's a workaround as I menetioned and not a solution.

Best Geert

and thanks for your support