‎2011 Jul 22 2:53 PM
Hi gurus ,
A unique problem We have added a field in the custom table . once moved to quality system it is not showing up the data whwn when we do a select query on that table in se16 . say total entries are ten thousand four of them are checked and when display not checked i.e eq space we get just 100 entries on number of entries ..i asked to regenerate the table in quality system but it did not help .The Quality system was refresh 1 month ago and we see it not working after it ..please suggest the correct steps we need to perform to recover the data . Adjust database with keep data has already been done ...
‎2011 Jul 25 5:41 AM
Hi instead my query is ...
select something from ZTABLE into table where newfield ne 'X' .
new field should give me all record which are not equal to 'X'
and in this case NULL and SPACE are similar ar'nt they ?
please suggest .
‎2011 Jul 22 8:43 PM
Hi Anjaneya Bhardwaj,
If I understand well, your issue is that you have a SELECT in your program, saying newfield is your newfield, something like:
SELECT ... FROM ztable INTO ... WHERE newfield = space.
and it doesn't return the records that existed in quality before newfield was added.
It it because, by default, when you add a field to an existing database table, with records already present, they are assigned the NULL value, which is different from space.
They can be retrieved using WHERE newfield IS NULL.
Usually, to avoid this issue, when we add a new field, we tick the "no null value" checkbox for this new field, in SE11 transaction. That will initialize the field of existing records, to the initial value (space for characters, 0 for numeric fields, etc.) Note: maybe it can be counter performant for big tables...
Solution for your issue, run this code once:
UPDATE ztable SET newfield = space WHERE newfield IS NULL.BR
Sandra
‎2011 Jul 24 5:57 AM
Hi Bharadwaj,
You can do as Sandra told. It will work.
Regards,
Madhu.
‎2011 Jul 25 5:41 AM
Hi instead my query is ...
select something from ZTABLE into table where newfield ne 'X' .
new field should give me all record which are not equal to 'X'
and in this case NULL and SPACE are similar ar'nt they ?
please suggest .
‎2011 Jul 25 5:45 AM
Are you getting all the data if you try retrieving it from SE16/SE11 directly. IE. if you give new field NE 'X' condition in SE16 , do you get all the records? If so its a problem with select. Otherwise it is a problem with the table transport.l
‎2011 Jul 25 5:52 AM
Hi,
Se16 is inconsistent and transports have been imported properly ....
i do not get all record ne 'x' when i click on the number of entries and that was my question ?
request all to read the original problem ........
Thanks
‎2011 Jul 25 6:18 AM
ok. If your se16 table is inconsistent, it should show your the reasons too. Are any warnings or errors or anything being displayed along with the inconsistency message?
‎2011 Jul 25 6:23 AM
When i say inconsistent it mean data it shows is inconsistent ...not the table itself ...there are no warning logs or error messages ....Domain being used is XFELD for this field . the whole inconsistency is with regards to this new field ...
Thank you .
‎2011 Jul 25 6:57 AM
Hi,
write your select like this .
select <field1>
<field2>
.
.
from <ztable> into table <itab>
where <newfield> = Space.
it will fetch you all the record which are not checked.
Hope this will helps you.
Regards,
Kiran
‎2011 Jul 25 7:18 AM
Did u try transporting your table a second time.??
And in QAS did u try checking the number of entries in the table when no conditions are given ?
‎2011 Jul 25 7:37 AM
Hi Anjaneya,
I understand, you mean that select is giving you much more data (which is correct) than se16 tcode.
Strange problem indeed. Try reimporting the table in QA and re-adjust using SE14.
I believe if there was any problem with respect to table stats gathering, then select and se16 both must have given same output at least, but you can still try re-gathering table statistics with help of basis team.
‎2011 Jul 25 9:37 AM
Hi,
Hi instead my query is ...
>
> select something from ZTABLE into table where newfield ne 'X' .
>
> new field should give me all record which are not equal to 'X'
> and in this case NULL and SPACE are similar ar'nt they ?
> please suggest .
No, NULL value is special. The record won't be returned if you don't use explicitly IS NULL. The right select would be:
SELECT ... WHERE newfield ne 'X' OR newfield IS NULL.So, I think the only and best solution in your case is to UPDATE the records (and using the database utility is useless, or with extra efforts). You'll have to do it for transport on next systems too. Next time, remember that it's better to tick the "initial value" checkbox of the new fields in the SE11 table definition.
BR
Sandra
‎2011 Jul 25 9:43 AM
Hi,
We face the same problem and the solution is for the field check the initial checkbox and activate it will replace all the null valuewith a blank and it works.
Thanks
‎2011 Jul 25 9:56 AM
Hi nabheetmadan09,
I thought the late ticking of that checkbox would not perform a table conversion, but I just tested and you're right (so, no need to program the UPDATE ourselves, it will be automatically done by the transport of the corrected database table)
Thanks!
Sandra
‎2011 Jul 25 10:08 AM
Hi Sandra,
It is a good discussion . I got a good point.
Regards,
Madhu.
‎2011 Jul 25 1:16 PM
Just a remark on the erroneous terms I used in my last post:
> I thought the late ticking of that checkbox would not perform a table conversion, but I just tested and you're right
Ticking that checkbox won't run a "SAP table conversion", but will simply lead to an "ALTER TABLE" SQL operation that does an update of existing records.
Sandra
‎2011 Jul 25 7:04 PM
Thank you all ...I have my problem solved ...it introduced another issue ...That is the table was earlier sorted based on two keys fields ...now it is not ................is has altered the sorting did i do anything wrong .......i simply made the check fthe initial checkbox ...and retransported it ................
Edited by: Anjaneya Bhardwaj on Jul 25, 2011 8:04 PM
‎2011 Jul 28 6:32 AM
The question has been answered and i am closing the thread ...the very basic but important point to rember understand the value of checkbox having heading initial ....
Thank you all ..