04-30-2008 3:01 PM
Hi frndz,
i having a amount (2000.00)
i need to convert to 2000
and next i need to apply offset functonality
to 2000 to split. but its telling this function cannt be applied for the p type data.
Edited by: Alvaro Tejada Galindo on Apr 30, 2008 1:44 PM
04-30-2008 3:05 PM
The more easier is to transfer your data in a field type I with A = B.
Yuo have also the possibility to truncate or to take a part of your amount. You will find some help on sap help.
Regards,
Christophe
04-30-2008 3:06 PM
Instead of split, try like this:
REPORT ZTEST_NP.
DATA: L_AMT TYPE P DECIMALS 2,
L_VAL2 TYPE I.
L_AMT = '200.25'.
L_VAL2 = FLOOR( L_AMT ).
WRITE: / 'Integer', L_VAL2.
Regards,
Naimesh Patel
04-30-2008 3:15 PM
Just another option
DATA:
amt TYPE p DECIMALS 2 VALUE '2000.00',
amt2(10) TYPE n,
amt3(10) TYPE c,
leftover(2) TYPE c.
amt2 = amt.
amt3 = amt.
SPLIT amt3 AT '.' INTO amt3 leftover.
write amt3 to amt3 right-justified.
WRITE:/ amt.
WRITE:/ amt2.
WRITE:/ amt3.
Output
2,000.00
0000002000
2000
05-01-2008 8:32 AM