Application Development 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: 

Underscore as first lettern within SM30 entry

Former Member
0 Kudos

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

Former Member
0 Kudos

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

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

0 Kudos

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.

0 Kudos

Hi,

I tried with _abcd , abc,_abc_.

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

0 Kudos

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

0 Kudos

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,

0 Kudos

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

0 Kudos

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

0 Kudos

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.

0 Kudos

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

0 Kudos

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