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



Joined: 29 Dec 2007
Posts: 31

PostPosted: Tue Apr 01, 2008 2:25 pm    Post subject: Замена букв и цифр Reply with quote

Посоветуйте команду для замены всех букв на 'X', а всех цифр на 0 в текcтовой строке?
Например: 'FA59-00022.12' заменить на 'XX00-00000.00'
Back to top
View user's profile Send private message
vga
Мастер
Мастер


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

PostPosted: Wed Apr 02, 2008 10:23 am    Post subject: Reply with quote

Например так:

Code:
DATA: let(52) TYPE C.
DATA: str(20) TYPE C VALUE 'FA59-00022.12'.
DATA: pos TYPE I, pos2 TYPE I.

TRANSLATE let USING ' A'.
DO 26 TIMES.
  let+pos2(1) = sy-abcde+pos(1).
  pos = pos + 1.
  pos2 = pos * 2.
ENDDO.

WRITE: / 'before=', str.
TRANSLATE str TO UPPER CASE.
TRANSLATE str USING '102030405060708090'.
TRANSLATE str USING let.
WRITE: / 'after =', str.
Back to top
View user's profile Send private message Blog Visit poster's website
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.