‎2005 Jul 22 3:45 PM
Hello all,
How can a simple statement like this one:
SELECT SINGLE * FROM tbl_smt INTO ls_smt
WHERE field = p_field.
<b>always</b> return sy-subrc = 4 ?
p_field is declared <i>like tbl_smt-field</i>
and is in fact a CHAR of length 30.
tbl_smt contains a few lines with data.
p_field is not a key field.
‎2005 Jul 22 4:00 PM
Also check whether the field's tbl_smt-field domain has a conversion routine. Goto the domain and copy the routine name for example ALPHA.
Now go to SE37 and check for ALPHA. You will get two function modules like CONVERSION_EXIT_ALPHA_INPUT and
CONVERSION_EXIT_ALPHA_OUTPUT. The first one is used to convert to internal and other one to external. You have to use the INPUT function module.
Thanks
Vinod
‎2005 Jul 22 3:54 PM
How is the value of field stored in the database?
Is it stored with leading zeros and you are hitting it with a value like 1234? For example in the material master table MARA. The matnr field is 18 characters, if the material number is a numeric value then in the DB it looks like this '000000000000001234'. In you select statement, you must make sure that you are hitting it with the same format.
Regards,
Rich Heilman
‎2005 Jul 22 3:56 PM
No, the field is a char field, storing simple city names.
Regards,
Bogdan
‎2005 Jul 22 3:57 PM
‎2005 Jul 22 3:58 PM
‎2005 Jul 22 4:00 PM
‎2005 Jul 22 4:01 PM
Yes. It is possible.
Check the Domain and you can find a checkbox.
‎2005 Jul 22 4:02 PM
‎2005 Jul 22 4:04 PM
‎2005 Jul 22 4:06 PM
‎2005 Jul 22 4:00 PM
Also check whether the field's tbl_smt-field domain has a conversion routine. Goto the domain and copy the routine name for example ALPHA.
Now go to SE37 and check for ALPHA. You will get two function modules like CONVERSION_EXIT_ALPHA_INPUT and
CONVERSION_EXIT_ALPHA_OUTPUT. The first one is used to convert to internal and other one to external. You have to use the INPUT function module.
Thanks
Vinod
‎2005 Jul 22 4:02 PM
‎2005 Jul 22 4:07 PM
‎2005 Jul 22 4:09 PM
‎2005 Jul 22 4:13 PM
‎2005 Jul 22 4:15 PM
SE16 doesn't return any values eather, when entering in the select-option corresponding to <i>field</i> a value that exists in the table.
Regards,
Bogdan
‎2005 Jul 22 4:25 PM
Well, I guess I'm too tired now.
The problem is solved.
The values in the database are indeed case sensitive.
I needed to TRANSLATE a bit the <i>field</i> before hitting the database with it, ofcourse.
Thank you, guys.
Bogdan
‎2005 Jul 22 4:32 PM
‎2005 Jul 22 4:30 PM
As you say, it is possible that this is an encoding problem.
Write a simple program to select some records from the table. Now put the your search value (p_field) similar to one of the value in the table.
Say the table contains following entries:
City
WALTHAM
BOSTON
CAMBRIDGE
WORCESTOR
QUINCY
You can set this as screen parameter
p_field = 'WALTHAM'.
SELECT * FROM table INTO it_data.
BREAK-POINT.
When this takes you to debugging mode, examine contents of it_data.
Enter it_data[1] & p_field in the fields to examine.
Click on the magnifying glass on the right hand side to see the Hexadecimal values.
This will allow you to compare what you are entering and what is there in the table, and tell you what you are doing wrong. You can examine other entries one by one if you don't get hit on first one.
~Sivaraj.
‎2005 Jul 22 4:31 PM