Skip to Content
avatar image
Former Member

Help needed to display character vaiable in currency format

Hi Friends

In a SAP Script I am passing a currency field to the subroutine as an i/p parameter and since it gets converted to character format in subroutine because of 'itcsy' , ihave deleted the trailing zeroes and decimal points from the field and performed calculations on the field, now i need to pass this char field back to SAP script but i need to display that field in currency format with commas and decimal points in the script...how do i do that???

Thanks

Vishal.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    Aug 25, 2008 at 02:38 PM

    use write statment to move the character value back to currency field and pass currecny field to SCRIPT

    write wf_char to wf_curr.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 25, 2008 at 03:16 PM

    Hi,

    ihave deleted the trailing zeroes and decimal points from the field and performed calculations on the field

    I dont think you need to delete trailing zeroes and decimals from the fields.

    just check without that.

    regards

    padma

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 26, 2008 at 10:59 AM

    Hi Vishal,

    When you pass the currency amount into the perform, no need to remove the trailing zeros and the decimal point.

    Only thing you need to remove is the comma seperator as it gives a runtime error during calculation.

    To convert it back to the format with comma, write the below command:

    WRITE v_Item_total currency '2' to v_item_char.

    CONDENSE v_item_char.

    Here v_item_total is a number which is converted to comma seperated number and passed to char variable.

    This char variable is then passed to the SCRIPT.

    regards,

    Gaurav.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 23, 2010 at 09:57 AM

    Thanks

    Add comment
    10|10000 characters needed characters exceeded