We have added search box. Key in SAP issue keyword to search
TopBottom

Announcement: wanna exchange links? contact me at sapchatroom@gmail.com.

RE:[sap-dev] Looking for IS_NUM in ABAP

Posted by Admin at
Share this post:
Ma.gnolia DiggIt! Del.icio.us Yahoo Furl Technorati Reddit

Reply from Lukasz Pegiel on Jul 4 at 3:44 PM
I haven't found any good convertion exit for you Neal, but CONVERSION_EXIT_DEC_6_OUTPUT helpt to figure out that FM MOVE_CHAR_TO_NUM can help you as it's converting the characters on a base of user settings. Doesn't matter if this FM returns decimal part but at least you know if the string is number or not.
Example:
data: f_char(30) type c.
data: f_quan(16) type p.     f_char = '-455,6,554.444'.  call function 'MOVE_CHAR_TO_NUM'  exporting  chr = f_char  IMPORTING  num = f_quan  exceptions  convt_no_number = 1  convt_overflow = 2  others = 3.  if sy-subrc = 0.  "you got a number  endif.
Regards
Lukasz
abapblog.com

---------------Original Message---------------
From: R. N. Wilhite
Sent: Thursday, July 04, 2013 12:34 PM
Subject: Looking for IS_NUM in ABAP

We all know:

NUMERIC_CHECK.

if var CO '0123456789,.'.
*var is numeric.
else.
*non numeric.
endif.

To check for a number before moving it to a real number. We can extend this as:

if var CO '0123456789,. +-'.

Because "-12,345.678 "
should still scan as a number.

But then we get to:
1,23,456.00
1,2-3,45
1,2.3,45

None of these scan!

Do I need to make my own FM, or is there something simple to test this?

Neal

 
Reply to this email to post your response.
 
__.____._
Manage Settings | Unsubscribe | Create FAQ | Send Feedback
  
Copyright © 2013 Ziff Davis, Inc. and message author.
Ziff Davis, Inc. 28 E 28th Street New York, NY 10016
Lukasz Pegiel  

SAP Specialist (ABAP, PP, MM)
achievements
 
Mark as helpful
View this online
Ask a new question
 

_.____.__

0 comments:

Post a Comment

T r a n s l a t e to your language