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 MASchumacher on Jul 5 at 11:39 AM
Neal,

In case you don't have that FM in your system (we don't at ECC 6 sp 5) we found one that went away from ECC 5 and ended up creating a Z version. Here's the code

*"---
*"*"Local Interface:
*" IMPORTING
*" VALUE(INPUT_VAL)
*" EXPORTING
*" REFERENCE(OUTPUT_VAL)
*" EXCEPTIONS
*" INVALID_FORMAT
*"---
* Function Module : Z_CONVERT_QUAN_INPUT
* Date : 5-Aug-2010
* Description : Converts numeric representation to adjust for
* separators and different decimal values . vs ,
*
*Modification details
*
* Vers: xxx Date: 5-Aug-2010
* Description: Original Copied from ECC 5.0 best practice
* function /BEV3/CHCONVERT_QUAN_INPUT since it no longer
* exits in ECC 6.0
*---

IF input_val IS INITIAL.
CLEAR output_val.
EXIT.
ENDIF.

DATA:
dezzeichen(1) TYPE c, " Dezimalzeichen
dezstellen(1) TYPE n. " Dezimalstellen

* --- UNZUL?SSIGE ZEICHEN? ---
CONDENSE input_val NO-GAPS.
IF input_val CN '0123456789,.- '.
RAISE invalid_format.
ENDIF.
* --- DEZIMALZEICHEN: KOMMA ODER PUNKT ? ---
DATA:
char4(4) TYPE c,
refe(16) TYPE p.

refe = 12.
WRITE refe TO char4 CURRENCY '1'. " Dezimalzeichen an fester Position
dezzeichen = char4+1(1).
* --- TAUSENDERPUNKTE ELIMINIEREN ---
IF dezzeichen = ','.
TRANSLATE input_val USING '. '.
ELSE.
TRANSLATE input_val USING ', '.
ENDIF.
* --- VORZEICHEN ELIMINIEREN (d?rfte nicht vorkommen)---
* translate input_val using '- '.
CONDENSE input_val NO-GAPS.
* --- DEZIMALZEICHEN IN PUNKT ?NDERN ---
IF dezzeichen = ','.
TRANSLATE input_val USING ',.'.
ENDIF.
* --- PR?FEN, OB MEHRERE DEZIMALZEICHEN ?BERGEBEN WURDEN ---
DATA:
cbtrg(30) TYPE c.

IF input_val CS '.'.
cbtrg = input_val.
SHIFT cbtrg LEFT BY sy-fdpos PLACES.
SHIFT cbtrg LEFT.
IF cbtrg CS '.'.
RAISE invalid_format.
ENDIF.
ENDIF.

output_val = input_val.

ENDFUNCTION.


Margaret Schumacher

---------------Original Message---------------
From: halil kinik
Sent: Thursday, July 04, 2013 10:26 PM
Subject: Looking for IS_NUM in ABAP

Hi,

you can use this FM.

/TDAG/CP_LB07_CHAR_NUMBER_CONV

 
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
MASchumacher  

achievements
 
Mark as helpful
View this online
Ask a new question
 
In the Spotlight
Become a blogger at Toolbox.com and share your expertise with the community. Start today.

_.____.__

0 comments:

Post a Comment

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