Negative sign to type P variable

I have a variable with type P
I need to prefix a negative sign to the variable, how can this be done.

Hi,
Do like this,,,
data ll type p decimals 2.
ll = '222.33'.
ll = - ll.
write ll.
and to get this '-' sign in front try like this..
data : ll type p decimals 2,
       l(20) .
ll = '222.33'.
ll = - ll.
l = ll.
CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'
   CHANGING
     value         = l
write l.
Regards
Debarshi

Similar Messages

  • Prefix Negative sign in type P field in an ALV report

    Generally, -vs sign appears after the number in an ALV report. I have a type P field where I want to prefix the -ve sign ( before the number ). I donot want to convert it to C type as I want the sorting feature. Is there any other way ?

    U can do as per the suggestion given by Raja
    or
    U can copy the fm CLOI_PUT_SIGN_IN_FRONT to CONVERSION_EXIT_SIGN_OUTPUT and activate it. Then in edit mask use this '==SIGN' or u can create one domain and refer the domain to that field. In that domain u set the convertion routine = SIGN.
    regards
    gv

  • 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

  • Printing value fields with negative sign??

    Hello Experts,
    I have developed a interface, which writes the invoice data to application server/unix, this is a notepad. My specifications are as below,
    MWSK1(2)   TaxCode                         65     2     KONV-MWSK1     
    KWERT(13)  Condition Value                  67     13   KONV-KWERT     
    KSTEU(1)  Condition Control                80     1     KONV-KSTE
    I have to print KWERT value from 67th position until 13 positions, meaning until 80 positions, fine. My code is as below,
      MOVE: wa_invoice_price-mwsk1  TO unix_file+64(2).
      WRITE: wa_invoice_price-kwert    TO unix_file+66(13) RIGHT-JUSTIFIED.
      MOVE:  wa_invoice_price-ksteu    TO unix_file+79(1),
    So, it printing like below (pls. note 0.04 minus value in right bottom corner)
    P26701ZCG620101006C          100.00         0.00USD  1    UGL            0.00A A 9
    P60001ZF3520101006C          100.00         0.00USD  1    UGLG          0.04-H B 9
    But, business want to have like below (pls. note the DIFFERENCE for 0.04 minus value in right bottom corner),
    P26701ZCG620101006C         100.00        0.00USD  1    UGL               0.00   A A 9
    P60001ZF3520101006C         100.00         0.00USD  1    UGLG             0.04 - H B 9
    meaning, the 13th position should be negative sign (if at all any value does have a negative sign, else its normal)....so, the negative sign should sit on 13th postion. As am using WRITE statement with RIGHT JUSTIFIED am facing thisissue!! as u know we can not send a 'P' type value to unix/apps server, pls. let me know how to get it done?
    Thank you

    why can't the user live with a leading sign, like '-   0.04'?  If possible, do
    shift <fieldname> circular up to '-'.
    Or, if value is less than zero, set another variable to '-', else set to space, and multiply value with '-1', like:
    if <field> < 0.
       lv_sign = '-'.                " neagtive value
      <field> = <field> * '-1'.  "reverse the sign
    else.
    lv_sign = space.          "positive value
    endif.
    then, adjust your field length and insert a sign column or simply add a column for the sign....

  • 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

  • Missing negative sign in SAPScript

    Hi,
    There is one quantity variable defined as type QUAN in the printing program, it is caculated with a result like 7.000-, however when debugged in the related SAPScript Form, the variable = 7.000, the negative sign is gone and the printing result is 7.000 rather than 7.000-.
    Any clue?
    Thanks
    Amelia

    Hi Li,
    Quantity has only 3 decimal places.. the sign '-' comes after 3 decimal places so it cant read the sign and also cant display it. so assign the quantity to other variable which has 4 or more decimal places in that.
    hope it helps,
    reward if it helps
    Regards.
    Message was edited by: srinu k

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

  • 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

  • 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

  • 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

  • Positive and Negative Sign

    Hello everyone,
    May I know why the standard freight cost is negative sign in SD but positive sign in COPA.
    Also sales and various kind of cost are showing positive sign in COPA. No negative sign in COPA?
    Thank you.
    Regards.

    Hello,
    It is also possible to transfer conditions from MM to update billing data in pooled payment in the Information Systems (IS) retail system. These are transferred according to the same rules as SD conditions. Conditions from SD are always transferred to COPA with + signs, with the exception of credit memos and returns.  The reasons for this is that the signs for revenus are handled differently in the different applications of the system.  For example, revenus are positive in SD, while they are negative in FI. Consequently, COPA accepts all of the values as positive, and then subtracts deductions and costs from revenues in IS.
    Note that indicator transfer +/- is not used to compare the different use of +/- signs between FI or SD and COPA.  If you active the indicator, only the positive and negative values for the condition in question will be balanced.  This guarantees that the sum of the negative and positive condition values are displayed as a correct total value in the value field asigned to that condition.
    In order to perform transfer conditions from the billing documents the same definitions must be established for the value fields in Profitability Analysis and both pricing and conditions types must be defined in SD.
    Regards,
    Ravi

  • 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

  • Eliminate negative sign in WAD Chart

    hello experts,
    I have a WAD Chart and I am using the Stacked Columns100% 2.5D chart type. This chart is based on a query which has a two keyfigures Sales 1 and Sales2. Now some of the values in these key figures are in negatives. So, how can I eliminate those negative signs and allow my chart to treat those values as positive.
    for e.g Now My chart shows as Sales1 = -50% and Sales2 = -50%. I want to show these percent values in positive.
    Please help and points will be granted.
    Thanks,
    Rishi

    Hi,
    Try create a formula (if  the Key fig is based on formula )and use absolute function which is present in mathematical functions. That is Abs(Key Fig) is your formula.
    Option A.Steps :
    1. Make that key figure as always Hide in Display tab in the properties for this Key figure.
    2. Create a New formula on that Key figure.
    3.In Formula use Absolute Value function ABS on that key figure.
    4.Now this will give you the required result you needed.
    Option B. Also Create a formula.
    Now use this formula
    ( KF <= 0)( -1)(KF) OR (KF >= 0)*(KF)
    Hope this helps,
    Regards
    CSM Reddy

  • Negative sign disappears in Update Rule assignemnt

    Hello, I have a strange problem with an update rule. I try to copy a number with comma and sign into an attribute FI_TAXRT of an InfoObject. The number get ther ecorrectly but the sign deiappears.
    FI_TAXRT = Key Figure of type Number  (Dec =counter or amount field with comma and sign)
    The trasfer rule from my Data Source provides a field KBETR. This field is calculated from a an amount field in a condition table. In fact it is a percentage, so to remove the currency field I created a user exit in the data source to copy the amount field in a char field of the same length.
    This works fine because I get the correct number with comma and sign (I checked that in RSA3 and also in the PSA).
    When I debug the transfer and update rules the negative sign is there. I checked this by lgging a message in the update rule if the field is negative. (See code below)
    I get my messages in the log, but in the InfoObject, the field is displayed without sign when I do maintain master data or when I read the underlying table with SE16
    IF COMM_STRUCTURE-/BIC/FI_TAXRT < 0.
        MONITOR-msgid = 'Z_MSG'.
        MONITOR-msgty = 'I'.    
        MONITOR-msgno = '01'.
        CONCATENATE COMM_STRUCTURE-/BIC/FI_MWSKZ ' negative'
          INTO l_text.
        MONITOR-msgv1 = l_text.
        append MONITOR.
      ENDIF.
      RESULT = COMM_STRUCTURE-/BIC/FI_TAXRT.
      RETURNCODE = 0.
      ABORT = 0.
    I created the routine because a simple assignment of the InfoObject in the UR produced the same thing.
    Any ideas why this could happen?

    Please check if there is any conversioun routine defined for the InfoObject, which might change the sign.
    / Christian

  • How to shift Negative sign from Right to left

    Hi friends,
    please tell me How to shift Negative sign from Right to left for quan data type i am getting on right side but i want to display it on left exactly preceding my output number display.

    hi yogesh
    check this function module..
    <u><i><b>CLOI_PUT_SIGN_IN_FRONT</b></i></u>
    this will 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.
    chck this example..
    data: a1 type i value 56 ,
    a2 type i value 60,
    res type i.
    res = a1 - a2.
    data: res1(10).
    res1 = res.
    CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'
    CHANGING
    VALUE = res1
    write res1.
    I<u><i><b>MPORTANT</b></i></u>
    You can use this FM CLOI_PUT_SIGN_IN_FRONT.
    But you need to declare the amount field as char.
    Or you can code like this
    data int type i.
    data char(10).
    int = -4.
    int = int * -1.
    write int to char.
    concatenate '-' char into char.
    reward if useful..
    Message was edited by:
            navjot sharma

Maybe you are looking for

  • I can no longer connect with others using FaceTime after the mandatory update

    I updated my iPad software and now when I try to connect with someone using FaceTime I can never fully connect. Can anyone help me or seen this issue?

  • I need to change the sum of a column's total with javascript.

    Hi, The HTML output of a SUM column is as follows: <td align="center" headers="COST" class="t2data"><b> 827.49</b></td> I need to change the sum total with javascript. The initial loading of the page SUMs the DB values correctly. Then onchange JS for

  • RG1 Report requirements

    Hi all, Following is the clients requirements for RG1 report, 1. When there is opening qnty for materials,but no transactions(production or issues) the report should show the details of opening & closing stock of FG stocks, where as the above require

  • The Pages Full Screen option is the iPad screen!

    I haven't heard anyone mention this, but I think Apple did something very smart with the last iteration of Pages as a set up to Pages for iPad. For those of us who dream of having a writing station as small and light as the iPad, the real question is

  • Export Pics AND retain directory structure

    I'd like to use Bridge to manage the photos I put onto my iPod, here's the general workflow: All pictures are stored in directories by event (date) in the /pictures/ folder, for example: /pictures/2008-07-01 Hike in Woods /pictures/2008-07-02 Bike in