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
the_voice
Участник
Участник



Joined: 10 Jun 2010
Posts: 4

PostPosted: Thu Jun 10, 2010 12:04 pm    Post subject: Числа Reply with quote

Здравствуйте, понимаю что уже не первая тема, но найденными тут способами получается не совсем то, выгружаю xml-отчет. В начале объявляю
l_value TYPE string
потом использую value = l_value, естественно данные числовые выгружаются как строка, а нужно числом вместо 0000001 и 1.00 соответственно 1 и 1, как можно это сделать?
Back to top
View user's profile Send private message
vga
Мастер
Мастер


Age: 85
Joined: 04 Oct 2007
Posts: 1218
Location: Санкт-Петербург

PostPosted: Thu Jun 10, 2010 12:33 pm    Post subject: Reply with quote

Присвойте нужному числовому типу, потом назад строке.

Code:
DATA: l_str TYPE String.
DATA: i TYPE P DECIMALS 0.

l_str = '0000001'.
i = l_str.
l_str = i.
WRITE / l_str.
l_str = '1.00'.
i = l_str.
l_str = i.
WRITE / l_str.

_________________
Молитва - это запрос разработчику на изменение кода программы.
Back to top
View user's profile Send private message Blog Visit poster's website
the_voice
Участник
Участник



Joined: 10 Jun 2010
Posts: 4

PostPosted: Thu Jun 10, 2010 12:54 pm    Post subject: Reply with quote

Не совсем понятно, как это сделать... Sad не могли бы поподробней, пожалуйста, объяснить
Back to top
View user's profile Send private message
vga
Мастер
Мастер


Age: 85
Joined: 04 Oct 2007
Posts: 1218
Location: Санкт-Петербург

PostPosted: Thu Jun 10, 2010 1:02 pm    Post subject: Reply with quote

Обновил первое сообщение.
_________________
Молитва - это запрос разработчику на изменение кода программы.
Back to top
View user's profile Send private message Blog Visit poster's website
the_voice
Участник
Участник



Joined: 10 Jun 2010
Posts: 4

PostPosted: Thu Jun 10, 2010 1:18 pm    Post subject: Reply with quote

не убирает, в теле программы вот эти поля таблицы должны быть числовыми, а программка эффекта не дает, может я ее не правильно использую? убрала write, так как вывод на экран мне не нужен, объявила в начале, попробовала заменить l_value = '00000001' на l_value = l_stpo-stlkn
Quote:


l_value = l_stpo-menge.
l_element_TTPObjectLinkAttr->set_attribute(
name = 'ValueAttr'
value = l_value ).

l_element_TTPObjectLinkAttr =
l_document->create_simple_element(
name = 'TTPObjectLinkAttr'
parent = l_element_TTPObjectLinkAttrLit ).

l_value = 'POSITION'.
l_element_TTPObjectLinkAttr->set_attribute(
name = 'Kod'
value = l_value ).

l_value = l_stpo-stlkn.
l_element_TTPObjectLinkAttr->set_attribute(
name = 'ValueAttr'
value = l_value ).
Back to top
View user's profile Send private message
vga
Мастер
Мастер


Age: 85
Joined: 04 Oct 2007
Posts: 1218
Location: Санкт-Петербург

PostPosted: Thu Jun 10, 2010 2:07 pm    Post subject: Reply with quote

Code:
DATA: i TYPE P DECIMALS 0.
i = l_stpo-stlkn.
l_value = i.
l_element_TTPObjectLinkAttr->set_attribute(
name = 'ValueAttr'
value = l_value ).

_________________
Молитва - это запрос разработчику на изменение кода программы.
Back to top
View user's profile Send private message Blog Visit poster's website
the_voice
Участник
Участник



Joined: 10 Jun 2010
Posts: 4

PostPosted: Thu Jun 10, 2010 2:41 pm    Post subject: Reply with quote

Спасибо огромное!!!! заработало
Back to top
View user's profile Send private message
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.