2006 Oct 06 2:12 PM
Hi ALL,
I HAVE A ZTABLE IN WHICH I HAVE A AUFNR FIELD.
i have records with my username and for that record i have
a order no i.e aufnr has a value.
When i give the only the order number in my selection screen(se11
) it says
no records found ,if i put a star at the end for the order then it
gives me the record.
The length of the field is 12 char
and it has convers routine ALPHA for the domain.
The field is AUFNR.
The values for my record is of length 6,even if i add zeros in the front, iam not able to get that record thisis in the selection screen of SE11.
i HAVE to RETRIEVE DATA BASED ON THIS FIELD USING SELECT statement ,BUT IT ALWAYS RETURN SY-SUBRC 4.
cAN SOMEBODY EXPLAIN AS TO WHY IS THIS HAPPENNING AND WHAT SHOULD I DO TO OVER COME THIS
THANKS
Kajol
2006 Oct 06 2:15 PM
I would suggest to use LIKE statement in your SELECT.
SELECT * from Ztable
where aufnr like '1234%'.
Please check if it returns the data.
ARe you sure that the data is being stored with leading zeros in the db table? Go to SE16 and run a query, does the AUFNR field have leading zeros? If not, then this is your problem.
Regards,
Rich Heilman
2006 Oct 06 2:15 PM
I would suggest to use LIKE statement in your SELECT.
SELECT * from Ztable
where aufnr like '1234%'.
Please check if it returns the data.
2006 Oct 06 2:17 PM
2006 Oct 06 2:23 PM
2006 Oct 06 2:33 PM
Hi all,
My value in the table is 0001234567,the length of the field is 12.
when i give the value 1234567in table selection screen,it says no record found
i tried this way 0001234567,000001234567,it doesn't work.
IF I GIVE THIS WAY, IT WORKS,1234567
Please let me know.
Thanks
KAJOL
2006 Oct 06 2:36 PM
Hi all,
The data is storing in as 0001234567,because iam storing it 10 digit because the max length for this field in my company iss10 so we are adding leading zeros while storing to make the length 10.
if the value 1234 then we would add 0000001234 and save in datebase , but the problem is while retrieving the data.
Thanks
Kajol
2006 Oct 06 2:41 PM
2006 Oct 06 2:48 PM
Hi rich,
You mean to say i need to add leading zeros while saving in database so as to make 12 .
if i t is possible to retrieve data using this fm
alpha_exit_conversion_output or input.
PLS LET ME KNOW
2006 Oct 06 2:52 PM
I really think that you need to keep to the length of 12 for this field in the database and yes it would have leading zeros in the db table. Make the field in your DB table 12, you may have to write a conversion program to convert the field values already in the DB to 12 instead of the 10.
Question(just curious) why did you make the field 10 instead of 12? Someone tell you to do that?
My suggestion when working with custom tables that use "Standard" table fields, like AUFNR or VBELN etc, is to always use the data element which from the standard table, this way you know that the value will be stored the same way, and all will be consistant.
Regards,
Rich Heilman
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |