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
Николай
Участник
Участник



Joined: 15 Jan 2008
Posts: 6

PostPosted: Wed Jan 23, 2008 3:14 pm    Post subject: Присвоение одному полю части другой Reply with quote

Добрый день!
У меня возникла проблема: каким образом можно присвоить часть значения одного поля другому.
Создана временная таблица:
Code:
TYPES: BEGIN OF comp_auak
           , kokrs LIKE auak-kokrs
           , bugjahr LIKE auak-bugjahr
           , buperio LIKE auak-buperio
           , stokz LIKE auak-stokz
           , wrttp LIKE auak-wrttp
           , versn LIKE auak-versn
           , perbz LIKE auak-perbz
           , objnr LIKE auak-objnr
           , belnr LIKE auak-belnr
           , short_objnr LIKE bkpf-xblnr
    , END OF comp_auak.
Data: t_auak TYPE STANDARD TABLE OF comp_auak WITH HEADER LINE.

в полях objnr хранятся данные в виде "ORXXXXXXXXXXXX" и мне нужно сделать так чтобы в полях short_objnr были данные вида "XXXXXXXXXXXX".
Я пытался сделать это в цикле:
Code:
LOOP AT t_auak.
   obj =  t_auak-objnr.
   SHIFT obj BY 2 PLACES.
   t_auak-short_objnr = obj.
ENDLOOP.

Но ничего не получается, подскажите в чём моя ошибка.
Back to top
View user's profile Send private message
Armann
Модератор
Модератор



Joined: 01 Jan 2008
Posts: 422
Location: Moscow

PostPosted: Wed Jan 23, 2008 3:31 pm    Post subject: Reply with quote

Вариантов много.
Например так:
Code:

LOOP AT t_auak.
   t_auak-short_objnr = t_auak-objnr+2(12).
   MODFIY t_auak.
ENDLOOP.
Back to top
View user's profile Send private message Blog
John Doe
Модератор
Модератор


Age: 46
Joined: 05 Nov 2007
Posts: 725
Location: КраснАдар

PostPosted: Wed Jan 23, 2008 3:34 pm    Post subject: Reply with quote

Соглашусь с Armann. Вы просто MODIFY T_AUAK забыли.
Back to top
View user's profile Send private message Blog
Николай
Участник
Участник



Joined: 15 Jan 2008
Posts: 6

PostPosted: Wed Jan 23, 2008 3:44 pm    Post subject: Reply with quote

Спасибо за помощь! Smile
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.