Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

offset for the currency field

Former Member
0 Kudos

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

4 REPLIES 4

Former Member
0 Kudos

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

naimesh_patel
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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         

Former Member
0 Kudos

last thread was usefull