Numeric format with leading sign

Hi,
I am sending some data to external agency thru my info spoke extraction. They want the - sign leading the amount field, Eg I asm sending as 400- and they want -400. I am looking for any component type that supports this kind of format on currency filed. I am expecting this change to be done in the TARGET STRUCTURE, so I don't have to code it in my BADI to produce this format.
Any ideas. It is URGENT.
Thanks,
Alex.

Hi Alex,
   For this one, Function Module available in R/3. But that function module is not available in BW.
But you can create it: Thia is the code.
FUNCTION ZPUT_NEGATIVE_SIGN_FRONT.
""Local interface:
*"  CHANGING
*"     VALUE(VALUE)
  DATA: TEXT1(1) TYPE C.
  SEARCH VALUE FOR '-'.
  IF SY-SUBRC = 0 AND SY-FDPOS <> 0.
    SPLIT VALUE AT '-' INTO VALUE TEXT1.
    CONDENSE VALUE.
    CONCATENATE '-' VALUE INTO VALUE.
  ELSE.
    CONDENSE VALUE.
  ENDIF.
ENDFUNCTION.
Only specify parameters for Changing :
Here "Value" .
For your input : 100-, you will get outpt : -100.
Hope it Helps
Srini
Message was edited by: Srini

Similar Messages

  • Column format with percent ( % ) sign

    Is there column formatting for percent ( % ) signs?
    One of the fields in the report currently displays a number, e.g. "3.75", but need to add the percent ( % ) sign, e.g. "3.75%".
    I found the following:
    * To display "$5,234.10", I can use "FML999G999G999G999G990D00", this formats with a dollar ( $ ) sign and two decimal places.
    * To display "-5,234.10", I can use "S999G999G999G999G990D00", this formats with the sign ( + ) or ( - ) and two decimal places.
    However, I fail to find how to add the percent ( % ) sign...
    -Frank

    Thx for this hint. The only Problem with this solution is that the ‘%’ is also shown when the value is NULL.
    Has someone solved this also for NULL values where there should be nothing in the cell.
    Some solution but not very nice is to do this in the query itself.
    select ltrim(to_char(value, '999G999')||'%','%') from dual
    another one may by
    select to_char(b.COST_MATERIAL,'999G999L', 'NLS_CURRENCY = ''%''')
    from budget b

  • Format percentage with leading sign

    Does anyone know how to format a percentage so that the leading sign is always shown?
    eg format .126 as +12.60%
    and -.345 as -34.50%
    Thanks.

    Sorry, the above does not deal with +/- sign. For this you must use DecimalFormat and getxxxSuffix() and setxxxSuffix() methods.

  • Display numbers formatted with leading zeros or spaces.

    There are some cases where you might need to display numbers with leading zeros or leading spaces, or trailing zeros.  I experimented with several methods and came up with some examples.  This is a Console application, but the results can just
    as well be output to a listbox in a Windows form.
    Sub Main()
    Dim snum As String, inum As Integer = 56
    snum = inum.ToString()
    Console.WriteLine(snum & vbTab & " ToString()")
    snum = inum.ToString("D4") 'adds leading zeros
    Console.WriteLine(snum & vbTab & " ToString(""D4"")")
    snum = inum.ToString("F4") '4 decimal places with trailing zeros
    Console.WriteLine(snum & vbTab & " ToString(""F4"")")
    Console.WriteLine()
    snum = String.Format("{0,4}", inum) 'leading spaces
    Console.WriteLine(snum & vbTab & " Format{0,4}")
    snum = String.Format("{0:D4}", inum) 'leading zeros
    Console.WriteLine(snum & vbTab & " Format{0:D4}")
    snum = String.Format("{0:F4}", inum) '4 decimal places with trailing zeros
    Console.WriteLine(snum & vbTab & " Format{0:F4}")
    Console.WriteLine()
    snum = inum.ToString().PadLeft(4, "0"c) 'leading zeros
    Console.WriteLine(snum & vbTab & " PadLeft(4, ""0""c)")
    snum = inum.ToString().PadLeft(4, " "c) 'leading spaces
    Console.WriteLine(snum & vbTab & " PadLeft(4, "" ""c)")
    Console.ReadLine() Console.Clear()
            For x As Integer = 1 To 20
                snum = x.ToString("D4")
                Console.WriteLine(snum)
            Next x
            Console.ReadLine()
    End Sub
    Solitaire

    I would add that many of these methods also work with numeric types that are not integers.
    Note that the "D4" format string doesn't work for non-integral types (such as Double and Decimal), and the "F4" format string doesn't pad with trailing zeros, it rounds to 4 decimal places (which can lose information). PadLeft works with
    the entire string, it isn't aware of the decimal point.

  • Custom Number Format With Leading & Trailing Zeros

    Hi!
    How can I define following number format in Apple Pages (v3.5)?
    Positive numbers: +#'##0.00 (e.g. +0.30 or +5'000.00)
    Negative numbers: -#'##0.00 (e.g. -0.30 or -5'000.00)
    If I create a custom number format and enable Show Trailing Zeros, the leading zero is not shown (e.g. +.30 instead of +0.30). Number format with Thousands Separator enabled comes closest to what I need, but misses the plus sign for positive numbers (which I need to represent differences).
    Any ideas? Thanks in advance for your help!

    Hi Tuna,
    Maybe the currency format would work for you,
    The plus sign is problematic. With the above your negative numbers will be red and in brackets, positive numbers will be black. You could use conditional highlighting to change that.
    quinn

  • ABAP-based web service returns numeric values with leading zeros

    Hi SOA experts,
    I have created a web service out of an ABAP function module. Beside other values, this service returns a list of document numbers. All of these numeric values are returned by the web service with leading zeros, but we do want these values w/o leading zeros.
    Any ideas how I can tell the web service to not print any leading zeros?
    Thanks in advance for your help!
    Kind regards, Matthias
    PS: The according function module does not print any leading zeros for the numeric values

    hi,
    just a guess: I'd try to use I instead of NUMC for the document numbers.
    NUMC is no number but a character string with numeric characters only. only some display routines in SAP know that this string of numerals represents a number and omit leading zeroes.
    my 2 cents,
    anton

  • How to create field with LEADING sign?

    I have a request to create an output file that has any negative signs in a leading position.  Example, value is 100.00- but we want it stored/displayed as -100.00.  Anyone know if there is a FM (could not find one), etc. that does this?  Thanks!

    I don't know of any FMs that will do what you want.
    There are, however, several ways of doing this using the WRITE command to transfer a number to a character field. This is all you really need, since you say you are filling a field of a structure you will be downloading to an external file.
    1) You can try the <b>USING EDIT MASK <mask></b> additions to <b>WRITE</b>.
    2) You can use <b>SHIFT <field> CIRCULAR RIGHT</b> to move any sign that exists to the beginning of a character field. This is all the formatting you need to give Excel a negative number it can parse. Other end user programs may require more work to remove the gap between the "-" and the digits of the number.
    I've found (2) to be a better approach. Good luck!

  • Numeric Format with "dB" causes strange Increment and Decrement behavior

    To reproduce this, drop a numeric control in LabVIEW (Version 8.2 and later).
    Right click on the numeric control and select properties
    Select the "Format and Precision" tab
    Select the "Advanced editing mode" radio button
    Change the Format string to "%#_gdB" and press OK.
    Type "-123" into the numeric control.
    Place the cursor inbetween the 2 and 3.  Press the up arrow.  The normal response of the numeric is to increment the number to the left of the cursor, in this case the 2.  The expected number is -113.  However, with the "dB" in the format string, the number becomes -11.3.  This caused a problem with a Signal Generator whose power output (in Decibels) was controlled by this instrument.  in 2 keystrokes, the power went from -80dB to 0dB and almost damaged some equipment.
    The work around is to remove the dB from the format string or put it in parenthesis.  However, this seems like a bug.  If someone from National Instruments determines this is a bug, please post the CAR# to this thread.  Otherwise, it would be nice to have this behavior explained.

    Interesting behavior. I confirmed this with 8.2. What's more interesting is that the behavior is not consistent. If you use "Hz" the control works as you expected it to work. If you use "A", and perform the same steps, pressing the up arrow gets you "NaN". I tried putting a space before the "dB", and it made no difference. At first I thought that the "d" was being misinterpreted, but the result from using "A" made no sense. Very odd.
    Lesson learned from your experience: Always make sure to check the values that you want to set before you actually set them. You should have 2 layers of checking. The lowest level checks the values against the instrument's capabilities. In other words, making sure you don't try to program a level of 100 when the instrument can only handle 10. A higher level should check values against usage limits. This is where you put in the valid ranges for how you're using the instrument. For example, even though the instrument may be able to go to 13 dBm, in your testing you may only want a maximum setting of, say, -20 dBm. In my code I write a wrapper VI around each driver function to implement this. This requires extra code, but it can save your butt in many instances.

  • How do I use the print function to output a numeric variable with a fixed amount of leading zeroes

    I need to create an output from a T-SQL query that picks a numeric variable and uses the print function to output with leading zeroes if it is less than three characters long when converted to string.  For example if the variable is 12 the output should
    be 012 and if the variable is 3 the output should be 003.
    Presently the syntax I am using is PRINT STR(@CLUSTER,3) .  But if @CLUSTER which is numeric is less than three characters I get spaces in front.
    Please help!

    >> I need to create an output from a T-SQL query .. <<
    NO! NO! In RDBMS, we have a presentation layer that handles displays. We do not ever do it in the database. This is fundamental. But more than that, the purpose of PRINT is for debugging in T-SQL and never for output.
    You are still writing 1960's COBOL or BASIC, but you want to to it in SQL.  You probably picked the wrong data type (a numeric that should be a string) and are trying to repair your design error.  
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • How to read 16-bit signed integer in binary format with 2 byte sync. preceding??

    A flowmeter provides data as 16-bit signed integer in binary format with 2 byte sync. preceding
    I got i small problem by understanding the synchronasation.
    I read the data provided by the flowmeter, and then write it to a binaryfile.dat. i need to convert the data to decimal format. is it better to convert the data before or after writing it to the binary file. Coz i need to read the data out again for calculations and save it again in a new file.
    I understand that the synchronization  help one to see where to begin reading the usable data. is it right?
    Need any suggestions
    Thank you !
    Zamzam
    HFZ
    Attachments:
    DataOut.JPG ‏37 KB

    HI Rolf.k.
    Thank you for the small program it was helpfull.
    You got right about that proberly there  will be conflict with some spurios data, I can already detect that when writing the data to a spreadsheet file.
    I writes the data in such a way, that in each line there will be a date, a timestamp, a tab and a timestamp at the end. That means two columns.
    When i set given samplerate up, that controls the rate of the data outflow from the device, (1,56 Hz - 200 Hz),   the data file that i write to , looks unorderet.
     i get more than one timestamp and severel datavalues in every line and so on down the spreadsheet file.
    Now the question is: Could it be that the function that writes the data to the file,  can't handle the speed of the dataflow in such a way that the time stamp cant follow with the data flowspeed. so i'm trying to set the timestamp to be  with fractions of the seconds by adding the unit (<digit>) in the timestamp icon but its not working. Meaby when i take the fractions off a second within the timestamp i can get every timestamp with its right data value. Am i in deeb water or what do You mean!??
    AAttached Pics part of program and a logfile over data written to file
    regards
    Zamzam
    HFZ
    Attachments:
    DataFlowWR.JPG ‏159 KB
    Datalogfile.JPG ‏386 KB

  • Problem with Scorecard and Numeric Format

    Hi,
    I need some help with the Scorecard component.  i'm using Xcelsius 2008 SP 3.3, and MS Office 2007.  Everything is working great until i set the format of labels to numeric with negative value being red. Then, if the value is negative, my alert indicator will also turn red regardless of the color i set on Alerts tab.
    For instance,
    Name        M1     
    AAA        -1     
    BBB        2     
    CCC        3     
    Alert by value, low values are good, automatic color
    GREEN:  minimum to 0
    RED: 0 to maximum
    So, AAA indicates GREEN. After i set numeric format of column M1 so that negative value will display in red, AAA will indicate RED instead. Additionally, even if i set alert values to a different column in the spreadsheet, the result is the same.
    Is this behavior by design?  Is there any work around? (My boss really wants them red.) :P
    Currently, I'm in the process of downloading fix pack 3.4 with the hope that it might fix this. i'll let you know if it's does.
    Edited by: MrBank on Dec 21, 2010 5:16 AM
    fix pack 3.4 doens't help

    Have you tried conditional formatting in Excel ? That is an option worth exploring.
    Here are the fixed issues in SP 3.4:
    http://help.sap.com/businessobject/product_guides/xcelsius2008SP3/en/Xcelsius2008_FP3.4_fixed_issues_en.pdf
    Here is an excerpt specific to score card component.
    ADAPT01449290 (Xcelsius Scorecard shows inconsistent behavior)
    Description:
    The Xcelsius Scorecard component shows inconsistent behavior.
    New Behavior:
    This issue is resolved. The font-style value is retained when you rebind the data. Format information
    is not retained and will be retrieved directly from Excel for each binding. Column width is not updated
    when you rebind data.
    Edited by: Narender Jayachandran on Dec 23, 2010 4:20 PM

  • How can I format a number with leading zeros?

    I need to convert an int to occupy exactly 3 positions in a StringBuffer... I need the space in the StringBuffer to be filled with leading zeros where appropriate. Can anyone show me how to do this correctly please ?
    At the moment I am using a pretty dumb workaround to fill the target with "000" first and then parse the int into either 1 2 or 3 positions depending on its value ... it works, but there must be a more correct way to do this ...
    Thanks in advance ...

    Have you had a look at the class java.text.DecimalFormat? It does exactly what you want... example:
    StringBuffer sb = new StringBuffer();
    DecimalFormat format = new DecimalFormat("000");
    format.format(2, sb, new FieldPosition(0));
    System.out.println(sb);
    prints out the string 002.

  • Material class with " numeric format" in charaterstic store in which table

    Hi ,
    We had maintained material classification with "Material Class" , in charaterstic we have taken "Numeric format value" and we are giving this value manually in material when creating the material . These values will store in which table . Numeric value of charaterstic store in which table .

    Hi,
    Check table CAWN-ATFLV for numeric and CAWN-ATWRT for character type.
    u can check ATFLV field in AUSP also for numeric type and ATWRT for character type characteristiv
    Vijeta

  • Format a number with leading ones

    How do I format a number with leading ones or twos?
    This is what I'd do to format a number with 8 leading zeroes:
    String.format("%08d", 160)But, if I do the same with 8 leading ones, it does not work the way that I expect:
    String.format("%18d", 160)I'd appreciate your help.
    Thanks.

    933581 wrote:
    >
    What are you expecting?
    >
    I expected that "%18d" would pad with 1s.You assumed
    mmm I just thought that while "%08d" pads with 0s, the same would happen if I used "%18d" to pad with 1s.But if you would have looked at the javadoc of that method you would have very quickly known this was not the case and you wouldn't even had to create this thread. Why operate on guesswork when it is so easy to know reality? :(

  • I've purchased numerous books through itunes and now I'm unable to open ibooks; I get a "book format error, delete and redownload" which I've done numerous times with negative results.

    I've purchased numerous books through the itunes store in which I was able to read.  Now I'm unable to open some of the ibooks that I've purchased, I get an error message...book formate error, delete and redownload, which I've done numerous times with negative results.  What are my options?

    within the receipt that Apple sent to you via email is a Report a Problem link. use that link to report your issue.
    also you could try a basic reset and see if that resolves your issue. hold down the Lock button & Home button at the same time for ~15 seconds, the iPad should then perform a reset.

Maybe you are looking for

  • Calendar sync with exchange not working

    I connect my iMac to my corporate email using exchange and every few weeks I have to remove th account and add it again innorder for the calendar to update. Anyone have a fix for this?

  • Adding monitors to a laptop

    i just added an additonal monitor to my laptop and i need a second one to total three. They all need to be capable of showing different windows at the same time, is this possible? I dont have another VGA outlet on my laptop, is there an adapter. Also

  • Just some weirdness.

    When I set up a session I use a template, but somehow when I created the template I must have done something oddly wrong. When the session starts it appears OK, but when I try to edit the track, I can only copy it, I can't delete or silence any porti

  • Records in an internal table

    Hi, How to check if all the records in an internal table are identical. could you help soon

  • Timeline and display

    Hi all, I am wondering if someone can help. In Flash 8 and earlier, I would load data from a server-side script and then as the user made actions, either use goToAndPlay()/goToAndStop() actions to move along as necessary or else make a movie clip vis