Skip to Content
author's profile photo Former Member
Former Member

offset for the currency field

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Apr 30, 2008 at 02: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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Apr 30, 2008 at 02: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 30, 2008 at 02: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         
    

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 01, 2008 at 07:32 AM

    last thread was usefull

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.