on 05-11-2017 9:01 AM
Hi,
I have a custom table and one of the fields is defined as CHAR Length 10. If I enter with SE16 and try to search after this field like "not equal to blank" it finds me the records. If I search inserting the value 10 in this field it doesn't finds me any record even if there are records with value 10 for this field. If i search using 10* it finds me the records with value 10 in it. Why doesn't finds me anything when I search only with value 10?
Thanks
Ok.
If you programatically assign a value to a field with a conversion exit (and it would have helped for you to mention the domain as well) then it will be entered into the field as it is assigned.
eg
w_vbeln = '10'
Will be '10', not '00000000000010'.
When you assign a value to a field that has a conversion exit ( and you must check the domain but you get to know the majority in the end) you must use a conversion exit.
So VBELN has a conversion exit 'ALPHA', Conversion exits come in two halfs - _INPUT and _OUTPUT.
When you are populating a table field to save in the database you would use:
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = l_Vbeln
IMPORTING
OUTPUT = ls_Vbak-Vbeln.
Or, you could assign the value to a variable of the right type and WRITE it to another field.
This is especially important when you start using WBS Elements etc since these have a full text description which is converted to an 8 character number.
Conversion exits are called implicitly with SELECT-OPTIONS, PARAMETERS and WRITE statements.
Rich
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
Use conversion exit ALPHA in the domain of that field. This will solve your problem.
Thanks and Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Using se16, if I edit the table, delete the value 10, save, and write again the value 10, then if i display the records (using se16) this edited record is displayed like 0000000010 (I think because of the domain VBELN). So the problem is when the value is written in that field? Should be written in another way? I don't understand.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
More info: The domain used for this field is VBELN
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So, this one has ALPHA conversion exit. It means that when you enter the value "10" in the SE16 screen, SE16 will look for value "0000000010" in the table. But in the database table, you may theoritically, although abnormal, have values "10", "010", "0010", "00010", etc. Though, they are all displayed "10" because of the ALPHA conversion exit. You might even have in the database table the value "10" with leading blanks, which are not displayed if you're using the ALV grid display mode.
The OP states that it is a CHAR 10 field. Does not state that it has a domain etc (so me believing that he knows what he was talking about deleted my comment about conversion exits....)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Why not looking at the exact value of the table field and the value of the selection field? To do it, add a break point at statement "SELECT" (press F9 key in the debugger), and display the exact values via the debugger. You should then understand why they are different.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Maybe it was saved as 10XXXXXXXX【X=FULL BLANK SPACE】.
You can try to see the detail content in Tr-CODE se16n. Which have the detail technical contents of database.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
7 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.