Skip to Content
avatar image
Former Member

Negative amounts in excel imported data from sap

Hi all,

i'm transportin data from an internal table to an excel sheet. Amounts are like '1954.52-' in internal table when amount is négative ( minus sign at right ). when exporting in excel sheet the format is an shown.

I hope to have amount with minus sign in beginin (at left) of cell as folowing :'-1954.52'.

How can i do it?

Thank you for you responses

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Sep 05, 2008 at 02:22 PM

    FM CLOI_PUT_SIGN_IN_FRONT Move the negative sign from the left hand side of a number, to the right hand side of the number. Note that The result will be left justified (like all character fields), not right justifed as numbers normally are

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 05, 2008 at 02:26 PM

    Hi Mohammed,

    Use CLOI_PUT_SIGN_IN_FRONT function module to get the minus sign to be front for negative numbers.

    Thanks,

    Vinay

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Mohammed,

      As 'value' is changing parameter, value is considered as both import and export parameter. The 'value' parameter will itself holds the resutls after execution of function modue.

      Try with this code.

      data lv_mntsld type i value '100-'.
      
      write lv_mntsld.   "Output as 100-
      
      call FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'
      exporting value = lv_mntsld.
      
      write lv_mntsld.    "Output as -100
      

      Thanks,

      Vinay