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

unusual problem(in table selection screen)

Former Member
0 Likes
1,634

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,279

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

8 REPLIES 8
Read only

Former Member
0 Likes
1,280

I would suggest to use LIKE statement in your SELECT.

SELECT * from Ztable

where aufnr like '1234%'.

Please check if it returns the data.

Read only

0 Likes
1,279

Hi Check your where clause .

regards,

erwan

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,279

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

Read only

0 Likes
1,279

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

Read only

0 Likes
1,279

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

Read only

0 Likes
1,279

I really think that the length of the field needs to be 12 in the database, you should change it to the same as any other AUFNR in the system. Like AUFK-AUFNR.

Regards,

Rich Heilman

Read only

0 Likes
1,279

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

Read only

0 Likes
1,279

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