SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Не получается выбрать данные из таблицы



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP
View previous topic :: View next topic  
Author Message
Katya
Участник
Участник


Age: 36
Joined: 20 Oct 2011
Posts: 13

PostPosted: Thu Oct 20, 2011 3:14 pm    Post subject: Не получается выбрать данные из таблицы Reply with quote

Здравствуйте!

Я создала таблицу servicetype, в ней есть поле loedk, которое имеет тип - элемент данных, созданный на основе домена XFELD. Где то в моей таблице это поле имеет значение ' ', а где то 'X'.
Написала в программе:
select *
from servicetype
into corresponding fields of table table_servtyp.
where loedk <> 'X'.
И таблица table_servtyp почему то пустая. Если убрать условие, то туда выбираются все данные из таблицы, но почему то при loedk <>'X' не работает. Пробовала loedk = space, тоже не получается.
Подскажите, пожалуйста, в чем может быть проблема?
Back to top
View user's profile Send private message
Fami4
Специалист
Специалист


Age: 42
Joined: 04 Aug 2009
Posts: 62
Location: UA

PostPosted: Thu Oct 20, 2011 5:10 pm    Post subject: Reply with quote

Code:
select * from servicetype into corresponding fields of table table_servtyp
                 where loedk eq ''.

или
Code:
loedk ne 'X'.
Back to top
View user's profile Send private message
Armann
Модератор
Модератор



Joined: 01 Jan 2008
Posts: 422
Location: Moscow

PostPosted: Thu Oct 20, 2011 6:35 pm    Post subject: Reply with quote

Поле loedk было в таблице изначально или вы его добавили позже, когда в таблице уже были данные? Если второе - то в тех записях что уже были находится значение NULL, условие должно быть такое:
where loedk is NULL

А вообще лучше сразу ставить в таблице галочку 'Начальные значения', тогда там не будет NULLов
Back to top
View user's profile Send private message Blog
Katya
Участник
Участник


Age: 36
Joined: 20 Oct 2011
Posts: 13

PostPosted: Fri Oct 21, 2011 7:25 am    Post subject: Reply with quote

Да, я это поле добавила позже, loedk is null - работает.
Спасибо большое!
Back to top
View user's profile Send private message
Armann
Модератор
Модератор



Joined: 01 Jan 2008
Posts: 422
Location: Moscow

PostPosted: Sat Oct 22, 2011 9:21 am    Post subject: Reply with quote

Katya wrote:
Да, я это поле добавила позже, loedk is null - работает.
Спасибо большое!

Вы напишите маленькую программку для апдейта этого, чтоб избавиться от null'ов - жизнь будет проще. Ну и не забывайте про галочку 'Начальные значения'
Back to top
View user's profile Send private message Blog
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.