‎2005 Sep 23 2:05 PM
Hello Everyone,
i have one field in my database table , of type NUMC length 1.
It can have value either 0 or 1.
while creating entries, i enter 0 or 1.
when i see all table entries, it show blank instead of 0.
why is this happening.
is there any solution for this.
thanks
please help
‎2005 Sep 23 2:09 PM
Hi,
when printing numc on screen the system trim the leading '0'. (there is a '0' but you can't see it)
If you want to see the '0' with se16 you can use CHAR instead (define a domain with '1' and '0' as valid values)
Regards, Manuel
please reward some points if this answer helps you.
‎2005 Sep 23 2:09 PM
Hi,
when printing numc on screen the system trim the leading '0'. (there is a '0' but you can't see it)
If you want to see the '0' with se16 you can use CHAR instead (define a domain with '1' and '0' as valid values)
Regards, Manuel
please reward some points if this answer helps you.
‎2005 Sep 23 2:11 PM
‎2005 Sep 23 2:16 PM
when i see these contents in se11, i see zero , why
also if i download these using gui_download, i see zero
please advice,
Manuel i can't get what you mean by
define a domain with '1' and '0' as valid values)
thanks
‎2005 Sep 23 2:20 PM
Hi
depend on how you move the field to internal table for downloading.
If you use MOVE, the system don't use any input/output conversion routines, but if you use WRITE the system use it.
So if you have ZMY_TABLE-FIELD = 0.
If you do:
MOVE ZMY_TABLE-FIELD TO ITAB-FIELD => ITAB-FIELD = 0.
OR
ITAB-FIELD = ZMY_TABLE-FIELD => ITAB-FIELD = 0.
but
WRITE ZMY_TABLE-FIELD TO ITAB-FIELD => ITAB-FIELD = SPACE
Max
Message was edited by: max bianchi
‎2005 Sep 23 2:23 PM
you could define a domain in SE11 (domains specify the valid values of your field).
1. Define a new domain (type CHAR) with only '0' and '1' as valid values
2. define your field with reference to the domain you have created.
Now you have a CHAR value (instead of NUMC) that accepts only '0' and '1'. And will never be converted to space.
Manuel
‎2005 Sep 23 2:33 PM
Hi Manuel ,
i got you.
so as per above suggestions i should define it as CHAR
sure i will try that , and get back
thanks a lot
‎2005 Sep 23 2:35 PM
Hello Max
i what does symbol => refer in
WRITE ZMY_TABLE-FIELD TO ITAB-FIELD => ITAB-FIELD = SPACE
thanks for this suggestion
i didn't know this earliear
thanks
‎2005 Sep 23 2:42 PM
Hi
=> is only mathematic symbol and it means THEN, I usually use it, excuse me.
Anyway you do only:
WRITE ZMY_TABLE-FIELD TO ITAB-FIELD.
Now the value of ITAB-FIELD is space.
Max
Message was edited by: max bianchi
‎2005 Sep 23 2:14 PM
Hi
The type N has a convertion routine that replace the zero (at the left of last number) with space.
So if you have a field type N long 5 chars and its value is 00010, you show 10, and if it's 00000 you show space.
So you should use a field type C and not type N, if you want to see the 0 when value is 0.
Max
‎2005 Sep 23 2:14 PM
hi,
show your table with se16 :
1) with alv-grid
2) with abap-list
differences ?
i think , it's only the diff. formatting and representation
Andreas