Negative Sign displaying as '/' in alv

HI,
I am using ALV Display, the field has a negative value in internal table but while displaying the negative sign is converted to '/' sign.
Can you plz tell me how to correct the same?
Regards,
Ashu Arora

Dear Ashu Arora,
Method SET_SIGN ofClass CL_SALV_COLUMN is used to set the sign. Method HAS_SIGN is used to check if it is displayed in the output.
Hope this will help.
Regards,
Naveen.

Similar Messages

  • 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.

  • Negative sign to change to prefix

    dear gurus
    please let me know how to change the negative sign to prefix in alv report. ( i.e transcode GRR2=>formating =>report layout => language dependent => debit/credit sign [+/-] ).
    Regards
    Vijayendran S

    hi,
    You can use <b>edit_mask</b> to serve your purpose.
    You can specify the formatting template as follows:
    'V'only with fields of type P or I:
    output of leading sign
    wa_fieldcat-edit_mask = 'V______'.
    Note:
    1)If the leading sign is to be output with a field of type P or I, you must specify the wildcard character V at the desired place. If this character does not appear in the template, no leading sign will be output if the value of f is negative.
    2)When formatting a field of type P with decimal places, the value is not aligned with a character in the template representing the decimal point (either a period or a comma). If you want to have this character in the output, you must insert it in the correct position in the template and define the formatting from the right. If there is no character for the decimal point in the template, no such character is output.
    Regards,
    Sailaja.

  • How to hide the negative sign while displayed in ALV

    Hi,
    I am having a field for 'Price' for which i need the negative sign to do the sum (i.e. futher calculation) but i dont want to display the negative sign which is with 'Price' field in the output screen.
    I tried with the attribute no_sign = 'X' in the field catalogue,but still the negative sign was getting displayed in the output.
    Please help me to not to display the sign in the output.
    Thanks in Advanced.
    Regards,
    Darshana

    Hi Darshana,
    Before displaying the ALV , check what is the value of that particulat field (in a loop ) and if it is less than 0 , make it positive.
    CALACULATION part
    LOOP AT itab into wa.
      IF wa-val1 < 0 .
        wa-val1 = wa-val1 * -1 .
        MODIFY itab from wa INDEX sy-tabix .
      ENDIF.
    ENDLOOP.
    Then build the field catalogue and finally display the ALV .
    Thanks

  • How to display the number with negative sign in the front in ALV.

    most important, this ALV is also can totalize.
    can someone give me some suggestion?
    thanks   
       jisuwen

    i hope you want a negative sign before a char but holding some number. then that case
    loop at itab.
    concatenate itab-char '-' into itab-char.
    modify itab.
    endloop.
    and you can display in ALV with negative sign...
    Totalling you need to Specify
    DO_SUM = 'X' while populating fieldcatalog...
    If subtotals then you have to Build sort table and based on that you can proceed./.
    examples are there you can find inn SLIS package..
    vijay.

  • Negative sign for DMBTR field in ALV output

    Hi Experts,
    Before posting I have searched for more than 3 hours in the forums to get a solution for this.
    I did not get any solution so I am posting this problem which I need to resolve.
    I have to display the DMBTR field in ALV output for which a grand total will have to be displayed.
    Here for all the values in DMBTR which are negative are getting displayed as '-        6673.56','-       289956.23' as I am using the edit mask 'V_____________.__'.
    I have to get the value shown as '-6673.56', '-289956.23'.
    I tried to use convert this DMBTR to String and have successfully displayed the negative sign correctly in front of the value but I am not getting the totals which I need to have
    PLease check and suggest for a solution.
    Regards
    Kishore

    Hi,
      If this is the case, then you can use character field to display the sign on the left. Sum up the total and use the event end of list to display the same. Remember to set the TECH and NO_OUT in the field catalog.
    Hope this helps.
    Regards,
    Siva

  • How to display -ve sign before amount in ALV grid

    Hi,
    I want to display -ve numbers in an ALV grid. But the sign always appear at the end of the number. Is there any option with which I can display -ve sign before the number.
    Regards,
    Deepti

    Hi,
    <b>You can refer to below threads:</b>
    ALV - negative sign in the front
    Prefix Negative sign in type P field in an ALV report
    Or
    USe Function Module <b>CLOI_PUT_SIGN_IN_FRONT</b>, may be this works in your case.
    <b>Reward if helpful</b>
    Rgds

  • Editable field in ALV does not accept negative sign values

    Hi guys,
    We have an editable field in ALV but it does not accept negative sign,,, it is causing an error... We need to input a negative value in that editable field...
    How to handle this?
    Thanks!

    Hi Mark,
      This topic has been just discussed at this thread:
    Problem with OO ALV
    Regards,
    Chandra Sekhar

  • 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 do I activate the 'Display Credit Balance with Negative sign'

    Dear All,
    How do I activate the 'Display Credit Balance with Negative sign'  that is already deactivated ? I checked through Trial Balance and did not find any balance for any BP or GL Account.
    Regards,
    William

    Hi,
    Please check Note No. : [970813|https://b1-support.wdf.sap.corp/sap/support/notes/970813]. The solution is available in the Note.
    Check the link in the Note for solution.
    Hope you are partner. If not, you can contact your partner for further investigation.
    Also, make sure that you have access to the PEQ Wiki page and also that all the instructions mentioned in the PEQ Wiki is followed.
    Kind Regards,
    Jitin
    SAP Business One Forum Team

  • 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....

  • 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 for Asset G/L Account balance

    hi
       I m having one problem....I created the sales invoice for a customer "ABC" of total INR 63000.00 and when the customer paid the amount for that invoice thru "Cheque" .Banking -
    >Incoming Payments and i selected the BP code "ABC" and the invoice related to him get displayed and i choose the related invoice and went to "Payment Means" -
    >"Check" tab
          G/L Account -
    > 124563 ( Initially this account balance is 0.00)
      I entered all the Cheque details and its amount and added that incoming payment.
        After adding when i check the account balance 124563 its showing the balance as -63000.00 , the amount is shown in negative sign
        Company Details
          Display Credit Balance with Negative Sign is unchecked
       Please anyone help me out in making the balance with positive sign
    Edited by: Rajeswari Palaniyappan on Nov 25, 2008 10:00 AM

    Hi Rajeswari
    This is a common error that consultants make when implementing SAP Business One. There is no quick fix for this and the best is to create a new database and re-import all the transactions and masters. Make sure this time that the Display Credit Balance with Negative Sign is ticked.
    Unfortunately this one tick affects the way amounts are posted to the journal tables & others and cannot be fixed manually. You could try raising a support message with SAP but I am sure they will tell you the same thing I have.
    Kind regards
    Peter Juby

  • ORA-06502 encountered due to negative sign

    Problem:
    I encountered the error in my sql statement with the message:
    declare
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    ORA-06512: at line 144
    I already found the problem:
    v_str:= lpad(nvl(to_char((to_number(display_r.CO_AMOUNT)/100),'999,999,999.99'),' '),'15',' ');
    DBMS_OUTPUT.PUT_LINE(v_str);Because the value of CO_AMOUNT has negative sign as: 00000000-381250
    As such, I would like to seek help in resolving the problem I encountered. Is there a way to still display the output with the negative sign?
    Thanks in advance.

    The negative sign is not the problem, it's the fact that it's in the middle of the string. SQL expects the sign to be at the beginning (or end) of a number.
    This is one of the side effects of using strings to hold numeric data. There are a number of reasons why you might have this behaviour, it really depends on what your app does and how it populates the CO_AMOUNT variable.
    Anyway, you can solve this specific problem with a simple LTRIM:
    SQL> SELECT to_number('00000000-381250') FROM dual
      2  /
    SELECT to_number('00000000-381250') FROM dual
    ERROR at line 1:
    ORA-01722: invalid number
    SQL> SELECT to_number(ltrim('00000000-381250', '0')) FROM dual
      2  /
    TO_NUMBER(LTRIM('00000000-381250','0'))
                                    -381250
    SQL> Cheers, APC

Maybe you are looking for

  • SRM7 classic scenario - backend PO creator and item requisitioner

    Hi all, In our current SRM4 with backend ECC 6.0 EhP4, the backend system was defined as ERP_2.0.  After shopping cart get approval and PO generated at backend, both the PO creator and item requisitioner are equal to shopping cart creator. We are upg

  • Sales employee wise sales report

    Hi, Can anyone explain me,how to write functional specifications to obtain sales employee wise sales report? Thanks in advance.. Regards.. Yogi...

  • Printers in 11.5.10.2

    i would like to know about the printers and their role in the oracle applications database 11.5.10.2.please say me the basic concept behind the printers in the oracle applications database Regards Aram

  • SWF grey border when exported

    Can someone give me direction on how to take off or change the color of this border? I've opened up html file and can checnge the background color but nothing is there to change the grey border. Any help would be AWESOME!

  • Add a custom field for Product Allocation

    Hi experts, I have copied S140 to S501 to add a custom field for product allocation. I have added the custom field in MCVBAKUSR, so it is visible in MCVBAK. However, I don't know whether I can populate data into custom field. I searched in forum, som