Properly displaying currency amounts (negative sign) via WRITE statement

Dear forumers,
Using the WRITE statement, how may I properly display a currency amount that has a negative value?
In my program, the variable, V_AMOUNT to be displayed is originally of the type "WERTV12".
Using the WRITE statement for this, nothing gets displayed in the screen (blank only).
So, I assigned V_AMOUNT to another variable of the type "P DECIMALS 2", V_AMT.
Using the WRITE statement for this, the amount is displayed in the screen.
But, if the amount has a negative value, the negative sign is not displayed there.
I.e. If V_AMT has the value '500.00-', only '500.00' is displayed in the screen.
Finally, I changed the type of V_AMT as type string.
This works - any amounts with negative sign is displayed in the screen properly.
But, with this approach, I'm unable to "customize" the display of amounts according to currency, like this:-
DATA int TYPE i VALUE 12345678.
WRITE int CURRENCY 'EUR'.
The output of the WRITE statement is "123456,78".
Is there a better way to achieve this?

SAP display amounts/quantities as positive numbers with another field that denotes whether positive or negative.  You could change the value to a character field and put the negative where you need it (or put an additional field next to the amount with the sign)... but using a character field probably would negate the currency display, too....

Similar Messages

  • Displaying Currency as Negative Value

    Hi All,
    I have an object Amount. Based on a condition, i.e if movement_type is 500 then i need to display the amount field as negative value.
    IF movement_type = 500 then amount should be displayed as negative value.If amount is $10 then it shuld be displayed as -$10.
    How do we proceed to display amount as negative value.Do we need to do this at report level or at can i go ahead at update routine level.Please let me know how to do.
    Regards,
    Sudha.

    Try out the follwing  formula using Boolean Operations
    (movement_type == 500) * (Amount - (2*Amount)) + (movement_type <> 500) * (Amount)
    try with (Amount - (2Amount))* because *(Amount * (-1))* does not work.

  • Write statement after alv display

    Hi Experts,
                      My requirement  is that  i am displaying an output of ALV List display, in the List display i have a button which undergoes updation of records in Ztable.After pressing the button now i have to display Total no of records in write statement in which i should not have ALV display(i need 2 screens ).
    Regards,
    Vikram Sukumar

    <li>I don't know how you are doing but I am able to display. try this sample program for double click event.
    REPORT  ztest_notepad.
    DATA: BEGIN OF it_t001 OCCURS 0,
            bukrs TYPE t001-bukrs,
            butxt TYPE t001-butxt,
            adrnr TYPE t001-adrnr,
          END OF it_t001.
    TYPE-POOLS:slis.
    DATA:it_fieldcat   TYPE slis_t_fieldcat_alv,
         wa_fieldcat   LIKE LINE OF it_fieldcat.
    DEFINE fieldcat.
       wa_fieldcat-fieldname = &1.
       wa_fieldcat-tabname   = &2.
       wa_fieldcat-seltext_m = &3.
       append wa_fieldcat to it_fieldcat.
       clear  wa_fieldcat.
    END-OF-DEFINITION.
    START-OF-SELECTION.
       SELECT * FROM t001 INTO CORRESPONDING FIELDS OF TABLE it_t001 UP TO 10 ROWS.
       fieldcat: 'BUKRS' 'IT_T001' 'BUKRS',
                 'BUTXT' 'IT_T001' 'BUTXT',
                 'ADRNR' 'IT_T001' 'ADRNR'.
       CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
         EXPORTING
           i_callback_program      = sy-repid
           i_callback_user_command = 'USER_COMMAND'
           it_fieldcat             = it_fieldcat
         TABLES
           t_outtab                = it_t001.
    *&      Form  USER_COMMAND
    FORM user_command USING r_ucomm LIKE sy-ucomm rs_selfield TYPE slis_selfield.
       IF r_ucomm = '&IC1'.
         WRITE 'Venkat'.
       ENDIF.
    ENDFORM.                    "USER_COMMAND
    Thanks
    Venkat.O

  • Negative sign before amount in report display(urgent)

    i have one condititon in a rerport that if
    SHKZG is debitor then before that amount no sign means positive
    and if it is creditor then a minus sign should come before tha amount in list display.
    for example-
    if rs 100 is credit then it should display -100 otherwise hundred
    depending on SHKZG field which is creditor or debitor field .so depending on it only it has to display like above.
    plz its urgent .

    hi sanjeev,
    welcome to sdn!!!
    data : l_amt(15) value '435.46-'.
    CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'
           CHANGING
                VALUE = l_amt.
    write : l_amt.
    reward if helpful

  • Negative Sign in the front for amount

    Hi Friends,
    i am facing problem in negative sign
    while using fm : cloi_put_sign_in_front which accepts char variable.
    In my report amount type is char15 and here negative sign appears after using this fm but when i download this data in one other char structure DATA: BEGIN OF itab_proextract OCCURS 0,
            line(502) TYPE c,
          END OF itab_proextract.
    Amount is right justified always..but afterusing this amount gets displayed in left due to this my other variable which are getting downloded after amount comes as concatenated for ex...
    Before :
    00102384NALCUS/406FED      00AX          4.26-         5126.84-
    After
    00102384NALCUS/406FED      00AX-4.26           -5126.84
    Please help me....

    Hi,
      You can reer to the following links:
    negative sign in front.
    negative sign before amount in report display(urgent)
    or
    try this code
    data : l_amt(15) value '435.46-'.
    CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'
           CHANGING
                VALUE = l_amt.
    write : l_amt.
    or
    you can try this :
    DATA : BEGIN OF IG_DOWNLOAD OCCURS 0,
    F1(4),
    F2(4),
    F3 TYPE DMBTR,
    F4 TYPE I,
    F5 TYPE NETPR,
    F6,
    END OF IG_DOWNLOAD.
    DATA : BEGIN OF IG_DOWNLOAD1 OCCURS 0,
    F1(4),
    F2(4),
    F3(16),
    F4 TYPE I,
    F5(16),
    F6,
    END OF IG_DOWNLOAD1.
    DATA : VALUE(16).
    IG_DOWNLOAD-F1 = 'AAAA'.
    IG_DOWNLOAD-F2 = 'BBBB'.
    IG_DOWNLOAD-F3 = '-3.86'.
    IG_DOWNLOAD-F4 = 1.
    IG_DOWNLOAD-F5 = '4.58-'.
    IG_DOWNLOAD-F6 = 'A'.
    APPEND IG_DOWNLOAD.
    CLEAR IG_DOWNLOAD.
    LOOP AT IG_DOWNLOAD.
    MOVE-CORRESPONDING IG_DOWNLOAD TO IG_DOWNLOAD1.
    VALUE = IG_DOWNLOAD-F3.
    CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'
    CHANGING
    VALUE = VALUE.
    IG_DOWNLOAD1-F3 = VALUE.
    VALUE = IG_DOWNLOAD-F5.
    CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'
    CHANGING
    VALUE = VALUE.
    IG_DOWNLOAD1-F5 = VALUE.
    APPEND IG_DOWNLOAD1.
    CLEAR IG_DOWNLOAD1.
    ENDLOOP.
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    FILENAME = 'C:\A1.xls'
    FILETYPE = 'ASC'
    WRITE_FIELD_SEPARATOR = 'X'
    TABLES
    DATA_TAB = IG_DOWNLOAD1.
    Thank You.
    Regads,
    Dhanalakshmi L

  • Negative sign display for CURR field in ALV grid report

    I have a field BETRG defined as CURR field of length 15, decimal places 2. The value may be negative or positive. In case of negative values I am using EDIT_MSK option in the field catalog to bring the negative sign to the left of the value as shown below.
    Quote
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
          i_program_name         = sy-repid
          i_internal_tabname     = 'LT_FINAL'
          i_inclname             = sy-repid
        CHANGING
          ct_fieldcat            = fieldcat[]
        EXCEPTIONS
          inconsistent_interface = 1
          program_error          = 2
          OTHERS                 = 3.
    LOOP AT fieldcat.
        CASE fieldcat-fieldname.
            WHEN 'BETRG'.
            fieldcat-ctabname = ' '.
            fieldcat-cfieldname = ' '.
            fieldcat-edit_mask = 'RRV_______________.__'.
        ENDCASE.
        MODIFY fieldcat.
      ENDLOOP.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_buffer_active    = 'X'
          i_callback_program = sy-repid
          i_grid_title       = 'ABCD'
          is_layout          = gs_layout
          it_fieldcat        = fieldcat[]
          i_save             = 'A'
          is_variant         = gs_save
          it_events          = gs_events
        TABLES
          t_outtab           = lt_final
        EXCEPTIONS
          program_error      = 1
          OTHERS             = 2.
    Unquote
    On displaying the report using 'REUSE_ALV_GRID_DISPLAY' as shown above, when the value of BETRG is a smaller number like say 624, then the ALV output appears as '-            624.00' instead of '-624.00'.
    Is there any way that I can remove the space in between the negative sign and the number before displaying the ALV output using 'REUSE_ALV_GRID_DISPLAY'?

    Hi Deepak,
    I tried this and found that this doesn't work in case of currency field. Once you move back the char field (with negative sign to the left and condensed)  to the currency field, the negative sign again moves back to the right.
    I think that the only way a negative sign can be brought to the left of the currenct field is by using edit_mask of field catalog as I have shown above.
    Regards,
    Shayeree.

  • Transferring the negative sign from Right to Left for a currency field.

    Hi All,
    I am trying to transfer the negative sign in a currency field from right to left but in doing that i am not getting the comma seperators of the currency field.
    For eg : If the value is 12,345,678.00- then after converting it i am getting it as
    -12345678.00 and i am loosing the commas.
    I am trying to transfer the negative sign by first converting the currency field into character field.
    Kindly help for the same.
    Thanks,
    Sharadendu

    Hi,
    Use FM CLOI_PUT_SIGN_IN_FRONT.
    Try this code as well
    data: var(10),
    length type i.
    var = '300-'.
    write var.
    length = strlen( var ).
    length = length - 1.
    replace first occurrence of '-' in var+length(1) with ''.
    concatenate '-' var into var.
    write:/ var.
    Regards,
    Satish
    Message was edited by:
            Satish Panakala

  • To prefix an amount with a negative sign

    Hi All,
    I want to prefix a positive amount with a negative sign...for display...
    How will I be able to do that ?
    Regards,
    Archana

    amount = -1 * amount.
    if it does not work then you might need to change the type of amount field.
    Thanks,
    Ram

  • PE51 - Deduction  Wage Type amount showing with a negative "-" sign

    Dear All,
    We have pay slip configured for the client in PE51 - HR Foms Editor.
    Here, we have added the deduction wage types in Window tab and Cumulations tab.
    However, when we generate the pay slip, the custom wage types which are defined in deductions show up the amount with a negative " - " sign.
    Please advise how this negative sign can be removed.
    Please note that in Cumulations tab, under deductions, the MS value against all the deductions wage type is " +"
    Regards,
    Reema

    Hi,
    Write a rule to remove the prefix '-' for the WT's for the STD payslip
    Regards,
    Hemant V.Mahale

  • Adobe form not showing negative sign before amount

    Hi Experts,
    We are having a strange problem. Our developers displaying
    negative
    amount in my adobe output. Its working fine in our development
    system.
    But for the similar set of data in testing system, negative sign before
    the amount is not coming. The same adobe form, layout and print
    program
    is there in both development and test environment systems. Please
    help.
    Thanks,
    Sunny

    Hi Sunny ,
    Check with the development team .. The field attribute while display types which you can restrict in the adobe form layout settings.
    I am pretty sure this  will help you and revert back if you have any questions in this regard.
    Thanks ,
    Gowrisankar

  • Populate negative sign to amount fields

    Dear SDNers,
                          i need to populate a amout in local currency and amount in document currency fields with negative sign based upon debit./redit indicator. that is if debit/credit indicator gives s means we need to populate neagtive sign to for those fields, if it gives H nothing has to be populate.
    this is possible in update rules. plesae provide the code or else posible in bex.
    fields
    /BI0/OIOI_DMBTR-----amount in local currency
    /BIC/OIZWRBTR----amount in document currency
    /BI0/OIFI_DBCRIND----     Debit/Credit Indicator
    need the code for in update rules.
    help me on that

    Hi ,
         i am getting the following the error while checking the update routine
    E:Field "COMM_STRUCTURE-OIFI_DBCRIND" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement. "DATA"statement.
    PROGRAM UPDATE_ROUTINE.
    $$ begin of global - insert your declaration only below this line  -
    TABLES: ...
    DATA:   ...
    $$ end of global - insert your declaration only before this line   -
    The follow definition is new in the BW3.x
    TYPES:
      BEGIN OF DATA_PACKAGE_STRUCTURE.
         INCLUDE STRUCTURE /BIC/CSZADPAY.
    TYPES:
         RECNO   LIKE sy-tabix,
      END OF DATA_PACKAGE_STRUCTURE.
    DATA:
      DATA_PACKAGE TYPE STANDARD TABLE OF DATA_PACKAGE_STRUCTURE
           WITH HEADER LINE
           WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.
    FORM startup
      TABLES   MONITOR STRUCTURE RSMONITOR "user defined monitoring
               MONITOR_RECNO STRUCTURE RSMONITORS " monitoring with record n
               DATA_PACKAGE STRUCTURE DATA_PACKAGE
      USING    RECORD_ALL LIKE SY-TABIX
               SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
      CHANGING ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update
    $$ begin of routine - insert your code only below this line        -
    fill the internal tables "MONITOR" and/or "MONITOR_RECNO",
    to make monitor entries
    IF COMM_STRUCTURE-OIFI_DBCRIND = 's' .
    RESULT = COMM_STRUCTURE-OIOI_DMBTR * -1.
    ELSEIF COMM_STRUCTURE-OIFI_DBCRIND = 'h' .
    RESULT = COMM_STRUCTURE-OIOI_DMBTR.
    ENDIF.
    if abort is not equal zero, the update process will be canceled
      ABORT = 0.
    $$ end of routine - insert your code only before this line         -
    ENDFORM.

  • How to display NEGATIVE sign on the left side of a number in SMARTFORMS

    Hi,
         In smartforms I'm trying to print some negative values, but the negative sign is displayed on the right hand side of the number.
    How can I display the '-' sign on the left hand side of a number. I tried the logic &value(<), it works well in sap scripts. Why is it not working in smartforms ?
    Eg :   I'm getting  the output  as  126.75 -
             I want :  - 126.75

    see this wiki which gives details for restrictions of formatting options (I guess you didn't declare the variable correctly, i.e. with the right data element): http://wiki.sdn.sap.com/wiki/display/ABAP/SAPscript#SAPscript-WhatarethevarioustextformattingoptionsinSAPscript%3F

  • The option 'Display Credit Balance with negative sign" was not activated.

    I've encountered with a huge problem after load opening balance.
    I forgot to tick the  option 'Display Credit Balance with negative sign"
    It makes my client's Chart of Account  uncommon such as credit balance in Cash Account, AR .....
    However, I've search the sap  note to solve it  as follow:
      Description of the bug::     
    When creating the company in the system the option 'Display Credit Balance with negative sign' was not activated.
    Once transactions were created in the system the functionality can not be changed.
    Limits of the query:     
    After running the update query, please restart SBO first and then   run the restore 'GL account and bp balances';
    otherwise, the cashed value of SBO will not be updated and restore function may not take effect.
    1. Meaning of  restart SBO => restart SBO Service Manager right?
    2. Please help me please to find "The restore G/L account and bp balances" form.  Where is it?;
    Thank you

    Hi,
    I would think that you are following the PEQ instructions for note 970813, correct?
    If this is the case and you are using 2007 then you will find the restorev in the top menu; Help -> Support Desk -> Restore. You will find the functions here. Please note that this should only be used on direct instruction from support or a note like in this case. A backup should also be taken before running restore.
    Regards,
    Jesper

  • How to hide currency amount 0,00 but with icon_failure display in column?

    Hi Experts,
    I am doing with CL_GUI_ALV_TREE. The report will display tree hirarchy with currency amounts in columns.
    When there is 0,00 amount in column, I'd like to display an icon_failure (like a flash) in that column without 0,00.
    It works in initial screen:
    I cleared its currency so 0,00 will not appear.
    But when I click next page button in toolbar (display columns in next page..), I have to call CHANGE_NODE method. In this case, clear currency cannot work any more. 0,00 with icon_failure display together in one column.
    So is there any solution to display icon only without 0,00?
    Thanks,
    Ying

    Luckily team member heped solve it..
    if there is no change in field catalog when I shift page, my logic would be fine. However I do have change in field catalog and call CALL METHOD go_tree->set_frontend_fieldcatalog to update it. That is the problem...
    I should first call CALL METHOD go_tree->get_frontend_fieldcatalog to get it before update it. Then my logic works! (but without get method, my field catalog can update well too!!)
    isn't it a bug of ALV? ...sigh...

  • Check info "Amount paid is showning with negative sign"

    Hi ppl,
    After the RFFOUS_C program is run and after the check generated, If i go and check the "check inforamtion" in PAYR table. It is showing the paid amount as 2000.00-
    The amount is shown with a 'minus' sign at the end.
    What this means???
    Please help.... Thanks!

    Hi Sri,
    The Amount with negative sign is pulled out from the Payment document against the GL account. This means that the funds are going out or its an outgoing payment.
    Rgds,
    Vinod

Maybe you are looking for