‎2007 Jul 30 9:42 AM
Hi friends,
Could anyone tell me the function module to split the price variable into two portions one with integer portion and another with decimal portion.....without using the Splitr command....because with this command i have to specify the split delimiter which may be changed with the user profile settings in the production.
‎2007 Jul 30 9:57 AM
Hi,
Use the following select query to find the decimal notation for a particular user.And then use split command.
SELECT SINGLE dcpfm FROM usr01 INTO v_dcpfm WHERE bname = sy-uname.
IF v_dcpfm = space OR v_dcpfm = 'Y' .
split v_price at '.' Into amount1 amount2.
ELSEIF v_dcpfm = 'X'.
split v_price at ',' Into amount1 amount2.
ENDIF.
‎2007 Jul 30 9:53 AM
Hi ramineni,
No need of Fun.module..this will do
DATA : TEMP TYPE P DECIMALS 3.
I = TRUNC( TEMP ). " integer part
D = FRAC( TEMP ). " decimal part
‎2007 Jul 30 9:54 AM
Hi
Use Functions:
<b>TRUNC</b> Interger part of x
<b>FRAC</b> Decimal part of x
Regards
Raj
‎2007 Jul 30 9:54 AM
i think u can use split command
SPLIT ITAB-LINE AT '.' INTO ZITAB-F1 ZITAB-F2
ZITAB-F3 ZITAB-F4 ZITAB-F5
‎2007 Jul 30 9:57 AM
Hi,
Use the following select query to find the decimal notation for a particular user.And then use split command.
SELECT SINGLE dcpfm FROM usr01 INTO v_dcpfm WHERE bname = sy-uname.
IF v_dcpfm = space OR v_dcpfm = 'Y' .
split v_price at '.' Into amount1 amount2.
ELSEIF v_dcpfm = 'X'.
split v_price at ',' Into amount1 amount2.
ENDIF.