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

Table not showing data after refresh

AnjaneyaBhardwaj
Contributor
0 Likes
5,295

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 ...

1 ACCEPTED SOLUTION
Read only

AnjaneyaBhardwaj
Contributor
0 Likes
3,967

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 .

17 REPLIES 17
Read only

Sandra_Rossi
Active Contributor
0 Likes
3,967

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

Read only

madhu_vadlamani
Active Contributor
0 Likes
3,967

Hi Bharadwaj,

You can do as Sandra told. It will work.

Regards,

Madhu.

Read only

AnjaneyaBhardwaj
Contributor
0 Likes
3,968

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 .

Read only

0 Likes
3,967

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

Read only

0 Likes
3,967

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

Read only

0 Likes
3,967

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?

Read only

0 Likes
3,967

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 .

Read only

0 Likes
3,967

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

Read only

0 Likes
3,967

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 ?

Read only

0 Likes
3,966

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.

Read only

0 Likes
3,966

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

Read only

0 Likes
3,966

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

Read only

0 Likes
3,966

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

Read only

0 Likes
3,966

Hi Sandra,

It is a good discussion . I got a good point.

Regards,

Madhu.

Read only

0 Likes
3,966

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

Read only

0 Likes
3,966

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

Read only

0 Likes
3,966

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 ..