Skip to Content
0
Former Member
Aug 05, 2010 at 11:35 PM

Amount value corrupted

18 Views

I have amount balance say amt_bal coming from ftp server file and I have developed function module to derive Posting_type_key based on the amount balance (amt_bal).

Sometimes i_amt_bal value contians alphabets as 'T234567'.

In that case, my code isfailing/dumping

I coded the Function module with

IMPORTparameter as

I_AMT_BAL TYPE CHAR16.

EXPORT paramater as

POST_TYPE TYPE CHAR02.

Source code is below

*"----


""Local Interface:

*" IMPORTING

*" VALUE(I_AMT_BAL) TYPE CHAR16

*" EXPORTING

*" VALUE(POST_TYPE) TYPE CHAR_02

*"----


IF i_amt_bal < 0. ( here it is failing if the amt_bal contians 'T234567' )

post_type = '40'.

ELSE.

post_type= '50'.

ENDIF.

=======================

How to make sure the i_amt_val's value is only numericals and if and only if numerical then pass posting type code?