Separating number in inputext with comma

hi all
I need to separate numbers with comma without using Enter .
I have an input text and used an clientListner on it : code is bellow
  <f:view>
    <af:document id="d1">  
     <af:resource type="javascript" source="/js/accounting.js"/>
     <af:resource type="javascript" source="/js/functions.js"/>
     <!--<af:resource type="javascript" source="/js/accounting.min.js"/>-->
      <af:form id="f1">
<af:panelGroupLayout id="pgl1">
<af:inputText label="Label 1" id="it1">
<af:clientListener method="formatNum" type="keyUp"/>
</af:inputText>
        </af:panelGroupLayout>
      </af:form>
    </af:document>
  </f:view>
I run this JavaScript on HTML page that is OK and my input text show separated number during entering ,
but I run my above jspx page ,it does not show until press the Enter key ...
please guide me .... I have an emergency condition please answer me soon
and then use this function for handling...
function.js :
function formatNum(evt) {
    var inputfield = evt.getSource();
    var num = accounting.unformat(inputfield.getValue());
    var formatNum = accounting.formatNumber(num);
    inputfield.setValue(formatNum);
    return true;
accounting.js
* accounting.js v0.3.2
* Copyright 2011, Joss Crowcroft
* Freely distributable under the MIT license.
* Portions of accounting.js are inspired or borrowed from underscore.js
* Full details and documentation:
* http://josscrowcroft.github.com/accounting.js/
(function(root, undefined) {
/* --- Setup --- */
// Create the local library object, to be exported or referenced globally later
var lib = {};
// Current version
lib.version = '0.3.2';
/* --- Exposed settings --- */
// The library's settings configuration object. Contains default parameters for
// currency and number formatting
lib.settings = {
currency: {
symbol : "$", // default currency symbol is '$'
format : "%s%v", // controls output: %s = symbol, %v = value (can be object, see docs)
decimal : ".", // decimal point separator
thousand : ",", // thousands separator
precision : 2, // decimal places
grouping : 3 // digit grouping (not implemented yet)
number: {
precision : 0, // default precision on numbers is 0
grouping : 3, // digit grouping (not implemented yet)
thousand : ",",
decimal : "."
/* --- Internal Helper Methods --- */
// Store reference to possibly-available ECMAScript 5 methods for later
var nativeMap = Array.prototype.map,
nativeIsArray = Array.isArray,
toString = Object.prototype.toString;
* Tests whether supplied parameter is a string
* from underscore.js
function isString(obj) {
return !!(obj === '' || (obj && obj.charCodeAt && obj.substr));
* Tests whether supplied parameter is a string
* from underscore.js, delegates to ECMA5's native Array.isArray
function isArray(obj) {
return nativeIsArray ? nativeIsArray(obj) : toString.call(obj) === '[object Array]';
* Tests whether supplied parameter is a true object
function isObject(obj) {
return obj && toString.call(obj) === '[object Object]';
* Extends an object with a defaults object, similar to underscore's _.defaults
* Used for abstracting parameter handling from API methods
function defaults(object, defs) {
var key;
object = object || {};
defs = defs || {};
// Iterate over object non-prototype properties:
for (key in defs) {
if (defs.hasOwnProperty(key)) {
// Replace values with defaults only if undefined (allow empty/zero values):
if (object[key] == null) object[key] = defs[key];
return object;
* Implementation of `Array.map()` for iteration loops
* Returns a new Array as a result of calling `iterator` on each array value.
* Defers to native Array.map if available
function map(obj, iterator, context) {
var results = [], i, j;
if (!obj) return results;
// Use native .map method if it exists:
if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);
// Fallback for native .map:
for (i = 0, j = obj.length; i < j; i++ ) {
results[i] = iterator.call(context, obj[i], i, obj);
return results;
* Check and normalise the value of precision (must be positive integer)
function checkPrecision(val, base) {
val = Math.round(Math.abs(val));
return isNaN(val)? base : val;
* Parses a format string or object and returns format obj for use in rendering
* `format` is either a string with the default (positive) format, or object
* containing `pos` (required), `neg` and `zero` values (or a function returning
* either a string or object)
* Either string or format.pos must contain "%v" (value) to be valid
function checkCurrencyFormat(format) {
var defaults = lib.settings.currency.format;
// Allow function as format parameter (should return string or object):
if ( typeof format === "function" ) format = format();
// Format can be a string, in which case `value` ("%v") must be present:
if ( isString( format ) && format.match("%v") ) {
// Create and return positive, negative and zero formats:
return {
pos : format,
neg : format.replace("-", "").replace("%v", "-%v"),
zero : format
// If no format, or object is missing valid positive value, use defaults:
} else if ( !format || !format.pos || !format.pos.match("%v") ) {
// If defaults is a string, casts it to an object for faster checking next time:
return ( !isString( defaults ) ) ? defaults : lib.settings.currency.format = {
pos : defaults,
neg : defaults.replace("%v", "-%v"),
zero : defaults
// Otherwise, assume format was fine:
return format;
/* --- API Methods --- */
* Takes a string/array of strings, removes all formatting/cruft and returns the raw float value
* alias: accounting.`parse(string)`
* Decimal must be included in the regular expression to match floats (defaults to
* accounting.settings.number.decimal), so if the number uses a non-standard decimal
* separator, provide it as the second argument.
* Also matches bracketed negatives (eg. "$ (1.99)" => -1.99)
* Doesn't throw any errors (`NaN`s become 0) but this may change in future
var unformat = lib.unformat = lib.parse = function(value, decimal) {
// Recursively unformat arrays:
if (isArray(value)) {
return map(value, function(val) {
return unformat(val, decimal);
// Fails silently (need decent errors):
value = value || 0;
// Return the value as-is if it's already a number:
if (typeof value === "number") return value;
// Default decimal point comes from settings, but could be set to eg. "," in opts:
decimal = decimal || lib.settings.number.decimal;
// Build regex to strip out everything except digits, decimal point and minus sign:
var regex = new RegExp("[^0-9-" + decimal + "]", ["g"]),
unformatted = parseFloat(
("" + value)
.replace(/\((.*)\)/, "-$1") // replace bracketed values with negatives
.replace(regex, '')         // strip out any cruft
.replace(decimal, '.')      // make sure decimal point is standard
// This will fail silently which may cause trouble, let's wait and see:
return !isNaN(unformatted) ? unformatted : 0;
* Implementation of toFixed() that treats floats more like decimals
* Fixes binary rounding issues (eg. (0.615).toFixed(2) === "0.61") that present
* problems for accounting- and finance-related software.
var toFixed = lib.toFixed = function(value, precision) {
precision = checkPrecision(precision, lib.settings.number.precision);
var power = Math.pow(10, precision);
// Multiply up by precision, round accurately, then divide and use native toFixed():
return (Math.round(lib.unformat(value) * power) / power).toFixed(precision);
* Format a number, with comma-separated thousands and custom precision/decimal places
* Localise by overriding the precision and thousand / decimal separators
* 2nd parameter `precision` can be an object matching `settings.number`
var formatNumber = lib.formatNumber = function(number, precision, thousand, decimal) {
  // Resursively format arrays:
if (isArray(number)) {
return map(number, function(val) {
return formatNumber(val, precision, thousand, decimal);
// Clean up number:
number = unformat(number);
// Build options object from second param (if object) or all params, extending defaults:
var opts = defaults(
(isObject(precision) ? precision : {
precision : precision,
thousand : thousand,
decimal : decimal
lib.settings.number
// Clean up precision
usePrecision = checkPrecision(opts.precision),
// Do some calc:
negative = number < 0 ? "-" : "",
base = parseInt(toFixed(Math.abs(number || 0), usePrecision), 10) + "",
mod = base.length > 3 ? base.length % 3 : 0;
// Format the number:
return negative + (mod ? base.substr(0, mod) + opts.thousand : "") + base.substr(mod).replace(/(\d{3})(?=\d)/g, "$1" + opts.thousand) + (usePrecision ? opts.decimal + toFixed(Math.abs(number), usePrecision).split('.')[1] : "");
* Format a number into currency
* Usage: accounting.formatMoney(number, symbol, precision, thousandsSep, decimalSep, format)
* defaults: (0, "$", 2, ",", ".", "%s%v")
* Localise by overriding the symbol, precision, thousand / decimal separators and format
* Second param can be an object matching `settings.currency` which is the easiest way.
* To do: tidy up the parameters
var formatMoney = lib.formatMoney = function(number, symbol, precision, thousand, decimal, format) {
// Resursively format arrays:
if (isArray(number)) {
return map(number, function(val){
return formatMoney(val, symbol, precision, thousand, decimal, format);
// Clean up number:
number = unformat(number);
// Build options object from second param (if object) or all params, extending defaults:
var opts = defaults(
(isObject(symbol) ? symbol : {
symbol : symbol,
precision : precision,
thousand : thousand,
decimal : decimal,
format : format
lib.settings.currency
// Check format (returns object with pos, neg and zero):
formats = checkCurrencyFormat(opts.format),
// Choose which format to use for this value:
useFormat = number > 0 ? formats.pos : number < 0 ? formats.neg : formats.zero;
// Return with currency symbol added:
return useFormat.replace('%s', opts.symbol).replace('%v', formatNumber(Math.abs(number), checkPrecision(opts.precision), opts.thousand, opts.decimal));
* Format a list of numbers into an accounting column, padding with whitespace
* to line up currency symbols, thousand separators and decimals places
* List should be an array of numbers
* Second parameter can be an object containing keys that match the params
* Returns array of accouting-formatted number strings of same length
* NB: `white-space:pre` CSS rule is required on the list container to prevent
* browsers from collapsing the whitespace in the output strings.
lib.formatColumn = function(list, symbol, precision, thousand, decimal, format) {
if (!list) return [];
// Build options object from second param (if object) or all params, extending defaults:
var opts = defaults(
(isObject(symbol) ? symbol : {
symbol : symbol,
precision : precision,
thousand : thousand,
decimal : decimal,
format : format
lib.settings.currency
// Check format (returns object with pos, neg and zero), only need pos for now:
formats = checkCurrencyFormat(opts.format),
// Whether to pad at start of string or after currency symbol:
padAfterSymbol = formats.pos.indexOf("%s") < formats.pos.indexOf("%v") ? true : false,
// Store value for the length of the longest string in the column:
maxLength = 0,
// Format the list according to options, store the length of the longest string:
formatted = map(list, function(val, i) {
if (isArray(val)) {
// Recursively format columns if list is a multi-dimensional array:
return lib.formatColumn(val, opts);
} else {
// Clean up the value
val = unformat(val);
// Choose which format to use for this value (pos, neg or zero):
var useFormat = val > 0 ? formats.pos : val < 0 ? formats.neg : formats.zero,
// Format this value, push into formatted list and save the length:
fVal = useFormat.replace('%s', opts.symbol).replace('%v', formatNumber(Math.abs(val), checkPrecision(opts.precision), opts.thousand, opts.decimal));
if (fVal.length > maxLength) maxLength = fVal.length;
return fVal;
// Pad each number in the list and send back the column of numbers:
return map(formatted, function(val, i) {
// Only if this is a string (not a nested array, which would have already been padded):
if (isString(val) && val.length < maxLength) {
// Depending on symbol position, pad after symbol or at index 0:
return padAfterSymbol ? val.replace(opts.symbol, opts.symbol+(new Array(maxLength - val.length + 1).join(" "))) : (new Array(maxLength - val.length + 1).join(" ")) + val;
return val;
/* --- Module Definition --- */
// Export accounting for CommonJS. If being loaded as an AMD module, define it as such.
// Otherwise, just add `accounting` to the global object
if (typeof exports !== 'undefined') {
if (typeof module !== 'undefined' && module.exports) {
exports = module.exports = lib;
exports.accounting = lib;
} else if (typeof define === 'function' && define.amd) {
// Return the library as an AMD module:
define([], function() {
return lib;
} else {
// Use accounting.noConflict to restore `accounting` back to its original value.
// Returns a reference to the library's `accounting` object;
// e.g. `var numbers = accounting.noConflict();`
lib.noConflict = (function(oldAccounting) {
return function() {
// Reset the value of the root's `accounting` variable:
root.accounting = oldAccounting;
// Delete the noConflict method:
lib.noConflict = undefined;
// Return reference to the library to re-assign it:
return lib;
})(root.accounting);
// Declare `fx` on the root (global/window) object:
root['accounting'] = lib;
// Root will be `window` in browser or `global` on the server:
}(this));

hi all
I have an input text that I want to separate it's value with comma
this is my input text :
<af:inputText value="#{bindings.LacreditAmt.inputValue}"
label="#{bindings.LacreditAmt.hints.label}"
required="#{bindings.LacreditAmt.hints.mandatory}"
columns="#{bindings.LacreditAmt.hints.displayWidth}"
shortDesc="#{bindings.LacreditAmt.hints.tooltip}"
id="it8"
maximumLength="#{bindings.LacreditAmt.hints.precision}"
converter="converter.BIGDECIMALMONEYCONVERTER"
clientComponent="true">
<f:validator binding="#{bindings.LacreditAmt.validator}"/>
<!--<af:convertNumber groupingUsed="false"
pattern="#{bindings.LacreditAmt.format}"/>-->
<af:clientListener method="handleNumberFormatConversion" type="keyUp"/>
</af:inputText>
and use this  java Script for comma separated value :
problem is : when I used firebug for testing this java Script ,everything is OK and 'result' variable shown
the correct value (comma separated value) but in fact the correct value did not show
in input text  !!!!!
please guide me soon.
I appreciated in advance
function handleNumberFormatConversion(evt){
        var inputField = evt.getCurrentTarget();
        var keyPressed = evt.getKeyCode();
        var oldValue = inputField.getSubmittedValue();
        var validKeys = new Array(48,49,50,51,52,53,54,55, 56,57,96,97,98,99,100, 101,102,103,104,105,AdfKeyStroke.ARROWRIGHT_KEY, AdfKeyStroke.ARROWLEFT_KEY, AdfKeyStroke.BACKSPACE_KEY, AdfKeyStroke.DELETE_KEY, AdfKeyStroke.END_KEY, AdfKeyStroke.ESC_KEY, AdfKeyStroke.TAB_KEY);
        var numberKeys = new Array(48,49,50,51,52,53,54,55, 56,57,96,97,98,99,100, 101,102,103,104,105, AdfKeyStroke.BACKSPACE_KEY, AdfKeyStroke.DELETE_KEY);
        var isValidKey = false;
        for (var i=0; i < validKeys.length; ++i){
            if (validKeys[i] == keyPressed) {
                isValidKey = true;
                break;
        if(isValidKey){
                var isNumberKey = false;
            for (var n=0; n < numberKeys.length; ++n){
                if(numberKeys[n] == keyPressed){
                    isNumberKey = true;
                    break;
            if(isNumberKey){
                var formatLength = 25;
                if(formatLength == oldValue.length){
                    inputField.setValue(oldValue);
                    evt.cancel();
                else {
                    var firstNeg = false;
                    var lastNeg = false;
                    if (oldValue.charAt(0) == '(')
                        firstNeg = true;
                    if(oldValue.contains(')')){
                      lastNeg = true;                              
                    oldValue = oldValue.replace('(', "");
                    oldValue = oldValue.replace(')', "");
                    var result = "";
                    while (oldValue.contains(",")) {
                        oldValue = oldValue.replace(",", "");
                    for (i = oldValue.length - 3;i > 0;i -= 3) {
                        result = ",".concat(oldValue.substring(i, i + 3), result);
                    result = oldValue.substring(0, (oldValue.length % 3 == 0) ? 3 : oldValue.length % 3).concat(result);
                    if (firstNeg)
                        result = '(' + result;
                    if (lastNeg) {
                        result = result + ')';
                    inputField.setValue(result);
                    evt.cancel();
                    return true;                   
        else {
            inputField.setValue(oldValue);
            evt.cancel();

Similar Messages

  • Output number with comma separator

    I have the value 1250 as an amount in a smartform.  And I want to output this as 1,250.  How do I do this?

    Hi...
    Use this function module.....
    it will satify your requirements...
    pass that changing parameter to the smartform..
    DATA: v_cur like TCURX-CURRKEY,
            c_cur(10) type c VALUE '1250'..
      CALL FUNCTION 'SD_CONVERT_CURRENCY_FORMAT'
        EXPORTING
          i_currency                  = v_cur
    *   IMPORTING
    *     E_CURRENCY_INT_FORMAT       =
        changing
          c_currency_ext_format       = c_cur
       EXCEPTIONS
         WRONG_FORMAT                = 1
         OTHERS                      = 2
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      WRITE: C_CUR.
    I believe this will greatly help you.
    Thanks and regards
    Bhuvana

  • How can i get all these values in single row with comma separated?

    I have a table "abxx" with column "absg" Number(3)
    which is having following rows
    absg
    1
    3
    56
    232
    43
    436
    23
    677
    545
    367
    xxxxxx No of rows
    How can i get all these values in single row with comma separated?
    Like
    output_absg
    1,3,56,232,43,436,23,677,545,367,..,..,...............
    Can you send the query Plz!

    These all will do the same
    create or replace type string_agg_type as object
    2 (
    3 total varchar2(4000),
    4
    5 static function
    6 ODCIAggregateInitialize(sctx IN OUT string_agg_type )
    7 return number,
    8
    9 member function
    10 ODCIAggregateIterate(self IN OUT string_agg_type ,
    11 value IN varchar2 )
    12 return number,
    13
    14 member function
    15 ODCIAggregateTerminate(self IN string_agg_type,
    16 returnValue OUT varchar2,
    17 flags IN number)
    18 return number,
    19
    20 member function
    21 ODCIAggregateMerge(self IN OUT string_agg_type,
    22 ctx2 IN string_agg_type)
    23 return number
    24 );
    25 /
    create or replace type body string_agg_type
    2 is
    3
    4 static function ODCIAggregateInitialize(sctx IN OUT string_agg_type)
    5 return number
    6 is
    7 begin
    8 sctx := string_agg_type( null );
    9 return ODCIConst.Success;
    10 end;
    11
    12 member function ODCIAggregateIterate(self IN OUT string_agg_type,
    13 value IN varchar2 )
    14 return number
    15 is
    16 begin
    17 self.total := self.total || ',' || value;
    18 return ODCIConst.Success;
    19 end;
    20
    21 member function ODCIAggregateTerminate(self IN string_agg_type,
    22 returnValue OUT varchar2,
    23 flags IN number)
    24 return number
    25 is
    26 begin
    27 returnValue := ltrim(self.total,',');
    28 return ODCIConst.Success;
    29 end;
    30
    31 member function ODCIAggregateMerge(self IN OUT string_agg_type,
    32 ctx2 IN string_agg_type)
    33 return number
    34 is
    35 begin
    36 self.total := self.total || ctx2.total;
    37 return ODCIConst.Success;
    38 end;
    39
    40
    41 end;
    42 /
    Type body created.
    [email protected]>
    [email protected]> CREATE or replace
    2 FUNCTION stragg(input varchar2 )
    3 RETURN varchar2
    4 PARALLEL_ENABLE AGGREGATE USING string_agg_type;
    5 /
    CREATE OR REPLACE FUNCTION get_employees (p_deptno in emp.deptno%TYPE)
    RETURN VARCHAR2
    IS
    l_text VARCHAR2(32767) := NULL;
    BEGIN
    FOR cur_rec IN (SELECT ename FROM emp WHERE deptno = p_deptno) LOOP
    l_text := l_text || ',' || cur_rec.ename;
    END LOOP;
    RETURN LTRIM(l_text, ',');
    END;
    SHOW ERRORS
    The function can then be incorporated into a query as follows.
    COLUMN employees FORMAT A50
    SELECT deptno,
    get_employees(deptno) AS employees
    FROM emp
    GROUP by deptno;
    ###########################################3
    SELECT SUBSTR(STR,2) FROM
    (SELECT SYS_CONNECT_BY_PATH(n,',')
    STR ,LENGTH(SYS_CONNECT_BY_PATH(n,',')) LN
    FROM
    SELECT N,rownum rn from t )
    CONNECT BY rn = PRIOR RN+1
    ORDER BY LN desc )
    WHERE ROWNUM=1
    declare
    str varchar2(32767);
    begin
    for i in (select sal from emp) loop
    str:= str || i.sal ||',' ;
    end loop;
    dbms_output.put_line(str);
    end;
    COLUMN employees FORMAT A50
    SELECT e.deptno,
    get_employees(e.deptno) AS employees
    FROM (SELECT DISTINCT deptno
    FROM emp) e;
    DEPTNO EMPLOYEES
    10 CLARK,KING,MILLER
    20 SMITH,JONES,SCOTT,ADAMS,FORD
    30 ALLEN,WARD,MARTIN,BLAKE,TURNER,JAMES
    CREATE OR REPLACE FUNCTION concatenate_list (p_cursor IN SYS_REFCURSOR)
    RETURN VARCHAR2
    IS
    l_return VARCHAR2(32767);
    l_temp VARCHAR2(32767);
    BEGIN
    LOOP
    FETCH p_cursor
    INTO l_temp;
    EXIT WHEN p_cursor%NOTFOUND;
    l_return := l_return || ',' || l_temp;
    END LOOP;
    RETURN LTRIM(l_return, ',');
    END;
    COLUMN employees FORMAT A50
    SELECT e1.deptno,
    concatenate_list(CURSOR(SELECT e2.ename FROM emp e2 WHERE e2.deptno = e1.deptno)) employees
    FROM emp e1
    GROUP BY e1.deptno;
    DEPTNO EMPLOYEES
    10 CLARK,KING,MILLER
    20 SMITH,JONES,SCOTT,ADAMS,FORD
    30 ALLEN,WARD,MARTIN,BLAKE,TURNER,JAMES
    CREATE OR REPLACE TYPE t_string_agg AS OBJECT
    g_string VARCHAR2(32767),
    STATIC FUNCTION ODCIAggregateInitialize(sctx IN OUT t_string_agg)
    RETURN NUMBER,
    MEMBER FUNCTION ODCIAggregateIterate(self IN OUT t_string_agg,
    value IN VARCHAR2 )
    RETURN NUMBER,
    MEMBER FUNCTION ODCIAggregateTerminate(self IN t_string_agg,
    returnValue OUT VARCHAR2,
    flags IN NUMBER)
    RETURN NUMBER,
    MEMBER FUNCTION ODCIAggregateMerge(self IN OUT t_string_agg,
    ctx2 IN t_string_agg)
    RETURN NUMBER
    SHOW ERRORS
    CREATE OR REPLACE TYPE BODY t_string_agg IS
    STATIC FUNCTION ODCIAggregateInitialize(sctx IN OUT t_string_agg)
    RETURN NUMBER IS
    BEGIN
    sctx := t_string_agg(NULL);
    RETURN ODCIConst.Success;
    END;
    MEMBER FUNCTION ODCIAggregateIterate(self IN OUT t_string_agg,
    value IN VARCHAR2 )
    RETURN NUMBER IS
    BEGIN
    SELF.g_string := self.g_string || ',' || value;
    RETURN ODCIConst.Success;
    END;
    MEMBER FUNCTION ODCIAggregateTerminate(self IN t_string_agg,
    returnValue OUT VARCHAR2,
    flags IN NUMBER)
    RETURN NUMBER IS
    BEGIN
    returnValue := RTRIM(LTRIM(SELF.g_string, ','), ',');
    RETURN ODCIConst.Success;
    END;
    MEMBER FUNCTION ODCIAggregateMerge(self IN OUT t_string_agg,
    ctx2 IN t_string_agg)
    RETURN NUMBER IS
    BEGIN
    SELF.g_string := SELF.g_string || ',' || ctx2.g_string;
    RETURN ODCIConst.Success;
    END;
    END;
    SHOW ERRORS
    CREATE OR REPLACE FUNCTION string_agg (p_input VARCHAR2)
    RETURN VARCHAR2
    PARALLEL_ENABLE AGGREGATE USING t_string_agg;
    /

  • Displaying a number with commas in gid

    Hi EveryOne,
                       This is Ram Prasad.I want to display a number with commas in the grid (eg:1,000).In the grid it is shown as 1000.I wan to add commas for this number to be shown in the grid display template.Can any one help on this.

    That's an odd format, so I assume you mean 1 million to be displayed as:  1,000,000 ?
    http://help.sap.com/saphelp_xmii115/helpdata/en/Applet_Reference_Details/ParameterReference.htm#Number Formatting
    #,##0 should provide you with a comma as the thousands separator for all numbers in this column of your iGrid.

  • Download internal table as text file with comma separation

    hi all
    I wanted text file separated by comma. I used the CSV function module, but the result is separeted by semicolon,instead i need comma.
    Kindly suggest some solution.
    Thanks
    Subha

    use this fm to convert to csv file
    CALL FUNCTION 'SAP_CONVERT_TO_TEX_FORMAT'
        EXPORTING
          I_FIELD_SEPERATOR    = ','
        TABLES
          I_TAB_SAP_DATA       = ITAB_FINAL
        CHANGING
          I_TAB_CONVERTED_DATA = ITAB_OUTPUT
        EXCEPTIONS
          CONVERSION_FAILED    = 1
          OTHERS               = 2.
      IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    itab_output is of type ITAB_OUTPUT TYPE TRUXS_T_TEXT_DATA,
    and then download using gui_download
    CALL FUNCTION 'GUI_DOWNLOAD'
          EXPORTING
            FILENAME                = W_FILENAME
            FILETYPE                = 'ASC'
          TABLES
            DATA_TAB                = ITAB_OUTPUT
          EXCEPTIONS
            FILE_WRITE_ERROR        = 1
            NO_BATCH                = 2
            GUI_REFUSE_FILETRANSFER = 3
            INVALID_TYPE            = 4
            NO_AUTHORITY            = 5
            UNKNOWN_ERROR           = 6
            HEADER_NOT_ALLOWED      = 7
            SEPARATOR_NOT_ALLOWED   = 8
            FILESIZE_NOT_ALLOWED    = 9
            HEADER_TOO_LONG         = 10
            DP_ERROR_CREATE         = 11
            DP_ERROR_SEND           = 12
            DP_ERROR_WRITE          = 13
            UNKNOWN_DP_ERROR        = 14
            ACCESS_DENIED           = 15
            DP_OUT_OF_MEMORY        = 16
            DISK_FULL               = 17
            DP_TIMEOUT              = 18
            FILE_NOT_FOUND          = 19
            DATAPROVIDER_EXCEPTION  = 20
            CONTROL_FLUSH_ERROR     = 21
            OTHERS                  = 22.

  • Covert number to comma separated number

    I have to covert number to comma separated number
    Please let me know how to do this.
    Example :
    Input: 10000 Output: 100,00
    Input: 1000 Output: 10,00
    Input: 1000044 Output: 100,00,44

    Like this
    with t as
    ( select 1234 a from dual union all
      select 1234456 from dual union all
      select 123 from dual union all
      select 12 from dual union all   
      select 124579652 from dual union all
      select 12235 from dual
    select to_char(a,'999,99,99,99,99,99') formatted
      from t Regards
    Arun

  • Adding a parameter with comma separated having different values

    i want to add a parameter with comma separated having different values of a column. e.g i have column having values from 10000 to 99999. i want to create report for the selected values of 11111,12111,131111 etc. This selection can be one or more values as desired. Second problem is restricting the records as per parameter.

    Reports doesn't allow multi-selection of a parameter in its parameter form. You need to use Oracle*Forms or an HTML Form to front end more advanced parameter form options.
    However, you could have multiple parameters and combine their selections into a single parameter in the after parameter form trigger. This would at least allow you to give the user the option for selecting up to 'n' parameters. The single parameter would have to be of type "character" and you probably want to add appropriate quotes around the values in the after parameter form trigger.
    Second problem is restricting the records as per parameter. Once you've got the comma seperated values into a single parameter (say p_myValues with a default value of '') then you can just use a lexical parameter to restrict the values as in:
    select * from emp
    where to_char(empno) in (&p_myValues)

  • Currency with comma separator

    Hi all ,
    I have a currency filed TFULLVACWTG. I am summing all values like this
    TFULLVACWTG = VFWTG001 + VFWTG002 + VFWTG003 + VFWTG004 + VFWTG005 . iam getting output like  this 14092.00 i should get output like this 14,092.00
    I should write output with comma separator .is there any key word or f.m for this one?

    Hi Priya,
    You have two options.
    1) Changes in user master record ie change thousand separator as , and decimal separator as .(dot).
    You can do this with transaction SU3.
    2) If you dont want to change master record then try with this code.
    DATA VC_TFULLVACWTG(18).
    VC_TFULLVACWTG = TFULLVACWTG.
    TRANSLATE VC_TFULLVACWTG USING ',#'.
    TRANSLATE VC_TFULLVACWTG USING '.,'.
    TRANSLATE VC_TFULLVACWTG USING '#.'.
    WRITE VC_TFULLVACWTG.
    Thanks,
    Vinay

  • Separation of digits with comma

    Dear friends,
                         At present in my sap system amounts in thousands are separating with 'dot'. But I want to separate the amounts in thousands with 'comma'. How can I change this? Plz help me.
    Regards
    Jay

    Hi,
    Goto TCODE: SU3
    In the defaults tab - in decimal notification you can change as required.
    VVR

  • Formatting a number element with commas and decimals.

    I have a dataset with numbers.  I already set the column type to "number".
    I want to format the number data with commas and decimals.  I found a way to add decimals, but I'm still very confused how to do commas and to combine that with the decimal formatting.
    Also, how do I apply that to a repeat region in my spry region?
    Any help would be appreciated.  Thank you very much.

    I found this on one of the forum questions.
    Excel dont preserve the trailing zeros.
    try opening the xcel and type 5.0000 and tab out, it wont preserve the trailing zeros after decimal.
    try finding out how to disable the option in excel. if you do that, you will see what you send out from the report.
    But you can try to convert the number into a text by trying to append a space at the beginning. See if that would work.
    Thanks
    Swarna

  • One column having multiple values with comma separator.

    Hey Guys,
    In my db, one culmn having multiple values with comma separator. like column_name = 'value1,value2,value3'. Now I want to compare this column to another column and fetch in Cursor.
    and each value having corresponding email_id, By fetching cursor, I need to populate email_ids.
    Thanks in advance!!
    -Lakshman

    Please compare and fetch cursor and populate result with out extract data into temp table. Give me the query!You have not provided DDL for table so I don't know table or column name to write any SQL.
    You have not provided DML for test data to run SQL against.

  • Display a number with commas

    Here's a way to display a number with commas. See attached
    code.
    I had searched here for help on how to do it, and couldn't
    find anything. So, then I wrote this. I'm a hack, self-taught
    coder, so there may be a more eloquent way, but this does
    work.

    Nice, I'm always happy to be humbled.
    One more point. If you're going ot use a return statement I
    like to keep it
    at the very end of the function. So, in a conditional
    statement, setting a
    local variable to the value to be returned allows you to
    return that local
    variable and always keep the return statement as the last
    line. It just
    saves a little searching around for returns in longer
    functions. Just a
    style choice not necessarily better.
    Craig Wollman
    Word of Mouth Productions
    phone 212 928 9581
    fax 212 928 9582
    159-00 Riverside Drive West #5H-70
    NY, NY 10032
    www.wordofmouthpros.com
    "duckets" <[email protected]> wrote in
    message
    news:[email protected]...
    >
    quote:
    Originally posted by:
    FasterPastor
    > I had searched here for help on how to do it, and
    couldn't find
    > anything.
    >
    > You should have asked! here's one I have had sitting
    around for a while.
    > (code
    > attached below). It handles lots of cases which the
    other handlers posted
    > so
    > far do not. Specifically:
    >
    > Negative numbers - input: -123456
    > - craig's: -,123,456
    > - dougs's: -,123,456
    > - mikes's: -,123,456
    > - duck's: -123,456
    >
    > Floating point numbers - input: pi
    > - craig's: 3
    > - dougs's: 3
    > - mikes's: 3.1,416
    > - duck's: 3.1416
    >
    > Numbers larger than the maxinteger - input: 149668992000
    > - craig's: -,654,863,360
    > - dougs's: -,654,863,360
    > - mikes's: 14,966,899,200,0.0,000
    > - duck's: 149,668,992,000
    >
    > Negative floats - input: -123456.7890
    > - craig's: -,123,457
    > - dougs's: -,123,457
    > - mikes's: -12,345,6.7,890
    > - duck's: -123,456.789
    >
    > Floats larger than the maxinteger - input:
    2233445566.7788
    > - craig's: -2,061,521,729
    > - dougs's: -2,061,521,729
    > - mikes's: 223,344,556,6.7,788
    > - duck's: 2,233,445,566.7788
    >
    > Yes.. the code is longer, but if you want to print
    something like the
    > distance
    > in meters to the sun, you need to handle floats
    properly!
    >
    > enjoy ;-)
    >
    > - Ben
    >
    >
    >
    > on stringNumber n
    >
    > outputString = ""
    > inputString = string(n)
    >
    > if inputString.char[1] = "-" then
    > negative = true
    > delete inputString.char[1]
    > else
    > negative = false
    > end if
    >
    > fraction = ""
    >
    > if inputString contains "e" then
    >
    > mantissa = inputString.char[1..(offset("e",
    inputString)-1)]
    > exponent = value(inputString.char[(offset("e",
    > inputString)+1)..inputString.length])
    >
    > decimalChar = mantissa.char[2]
    > mantissa = mantissa.char[1] &
    mantissa.char[3..mantissa.length]
    >
    > if mantissa.length < exponent+1 then
    > plainNumber = mantissa
    > repeat while plainNumber.length < exponent+1
    > put "0" after plainNumber
    > end repeat
    > else
    > plainNumber = mantissa.char[1..(exponent+1)]
    > fraction = mantissa.char[(exponent+2)..mantissa.length]
    > end if
    >
    > else
    >
    > if offset(".", inputString)>0 then
    > decimalChar = "."
    > end if
    > if offset(",", inputString)>0 then
    > decimalChar = ","
    > end if
    >
    > if offset(decimalChar, inputString)>0 then
    > plainNumber = inputString.char[1..(offset(decimalChar,
    > inputString)-1)]
    > fraction = inputString.char[(offset(decimalChar,
    > inputString)+1)..inputString.length]
    > else
    > plainNumber = inputString
    > fraction = ""
    > decimalChar = string(1.2).char[2]
    > end if
    >
    > end if
    >
    > if decimalChar = "." then
    > separatorChar = ","
    > else
    > separatorChar = "."
    > end if
    >
    >
    > repeat while plainNumber.char[1] = "0"
    > delete plainNumber.char[1]
    > end repeat
    >
    >
    > repeat while plainNumber.length > 0
    > if plainNumber.length > 3 then
    > nextDigits =
    >
    separatorChar&plainNumber.char[plainNumber.length-2..plainNumber.length]
    > delete
    plainNumber.char[plainNumber.length-2..plainNumber.length]
    > else
    > nextDigits = plainNumber
    > plainNumber = ""
    > end if
    > put nextDigits before outputString
    > end repeat
    >
    > repeat while fraction.char[fraction.length] = "0"
    > delete fraction.char[fraction.length]
    > end repeat
    >
    > if fraction.length > 0 then
    > put decimalChar&fraction after outputString
    > end if
    >
    >
    > if negative then
    > put "-" before outputString
    > end if
    >
    > return outputString
    >
    > end
    >

  • Currency field to be displayed with commas and asterisks(formatting)

    I have a field REGUH-RWBTR in my sap script code. I need to have the currency displayed with commas. And also if the digits are less, then left pad it with asterisks for remaining spaces.
    For eg, If the Digit is 12345678912.23 (max value), it should print as 12345,678,912.23.
    And If the digit is 12345.89, it should print as ******12,345.89
    Please help me to solve this problem.Its urgent.
    Thanks,
    Sandeep.

    Hello,
    You can use the WRITE using EDIT MASK.
    USING { {NO EDIT MASK}|{EDIT MASK mask} }
    Effect
    This addition overrides a conversion routine defined through reference to the ABAP Dictionary. The addition NO EDIT MASK only switches off the execution of an assigned conversion routine. The addition EDIT MASK calls either another conversion routine or defines an edit mask. For mask, a data object of the same name is expected.
    In order to call an arbitrary conversion routine CONV, mask must contain two equals signs, followed directly by the name of the conversion routine: "==CONV". During output, the content of dobj is passed to the function module CONVERSION_EXIT_CONV_OUTPUT, converted there, and then the result is displayed. If the function module is not found, an exception that can be handled is triggered (as of Release 6.10). The statement DESCRIBE FIELD contains an addition in order to fill mask accordingly.
    If the output length is specified explicitly with len, the conversion routine is executed for the specified length; otherwise for the implicit output length. If * or ** is specified for the output length, the appropriate rules are used for the converted result.
    If the first two characters in mask are not equals signs, the content is interpreted as an edit mask in which some characters have a particular meaning. The WRITE statement does not then output the content of dobj directly, but the character string in mask as follows:
    If the first two characters in mask are "LL" or "RR ", these are not output, They control whether the edit mask is left-justified or right-justified. If the first two characters are other characters, the edit mask is left-justified.
    All "_" characters are replaced from the left (in the case of "LL") or from the right (in the case of "RR") with characters for character-type types or numbers for the types p or i from dobj. In the case of fields of type c, closing blanks are ignored. Data objects of type f or x are converted into type c before editing. Superfluous characters "_" in mask are replaced by blanks. Characters from dobj for which there are no characters "_" in mask are not displayed.
    If dobj is of type i or p, the first character from the left "V" in mask is replaced with "-" in the case of a negative number and by blank in the case of a positive number.
    All the other characters of the edit mask are displayed unchanged.
    If no output length is specified, the implicit output length of dobj is used. If len is specified for the output length, the value of len is used. If * is specified for the output length, exactly that length that is required for the list display is set. If, in Unicode systems, characters of the edit mask are replaced by characters that take up more than one column on the list, the output length is increased accordingly and the output is filled with blanks in the list buffer. If ** is specified for the output length, double the length of the edit mask mask is used.
    If other formatting options are specified concurrently for an edit mask, these are used first and then the special characters in the edit mask are replaced by the interim result. The date masks date_mask are an exception to this. If these are specified, the edit mask is ignored.
    Notes
    In Unicode systems, you must remember that a character "_"in the edit mask does not necessarily correspond to a column in the list display since the space required in the display depends on the character to be replaced.
    The minus sign for a negative number is not displayed if no edit character "V" is specified. The decimal separator of a packed number with decimal places must be specified at the required position in the edit mask.
    Example
    Edited output of time duration. In the first output, the function module CONVERSION_EXIT_DURA_OUTPUT is executed. This converts the duration specified in seconds into minutes. In the second output, the edit mask is output according to the above rules. However, the underscore characters "_" are replaced by the characters from time.
    DATA: dura TYPE i,
          time TYPE t VALUE '080000'.
    dura = sy-uzeit - time.
    time = dura.
    WRITE /(30) dura USING EDIT MASK '==SDURA'.
    WRITE /(30) time USING EDIT MASK
                           'RRThe duration is __:__:__'.
    Regards,

  • Currency with Comma -- Unable to multiply

    Hi all
       I am having a Amount Field(with comma as Unit separator like 1,010) saved in Char Field. Now I neeed to multiply this Amount Field with X number.
    When there is no comma (like 300.00), then amount is succeesfully multipled but when I have amount 1,010(having comma), it short dumped !
    How to over come this issue ?
    Thanks

    Hi,
    Try like this:
    data: amt(10) type c,
          l_amt(10) type n.
    amt = '1,200'.
    move amt to l_amt.
    l_amt = l_amt * 250.
    write:/ amt,
          / l_amt.
    Regards,
    Bhaskar

  • Problem with comma and point

    Hello,
    I have a problem with comma and point in a double-digit.
    I use a english driver for HM8142. When I get the values then I only get
    int-digits. How can I change "Use comma as separator" . I tried to change
    the option in LabVIEW.
    I changed it, then I got the window. "To change, restart the programm". I
    have done this. But when I have a look at the option, it is not changed.
    What can I do?
    I am not the admin on the computer.
    Martin

    Hi Martin,
    you do not have to change any system settings neither in LabVIEW nor in your windows.
    All instrument drivers should use a point as decimal separator. You can overwrite the decimal point handling in the string functions "Scan from string" and "Format into string".
    Make a right click on the function and use "Edit Scan String". In the dialog open the ring under "Selected operation", the last entry allows you to set the character for the decimal separator. This separator will be used for all the following floating point numbers.
    From your name and problem I think you are located in central europe. I do not have a german version of LV so I cannot tell you how the elements are named in german.
    Waldemar
    Waldemar
    Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
    Don't forget to give Kudos to good answers and/or questions

Maybe you are looking for

  • Fixed Asset: Current Year Depreciation

    Dear Experts, Previously, fixed assets was managed manually in an excel sheet and depreciation was calculated manually in the excel sheet. My client wants to start using the FA Addon in March. I managed to import all the fixed asset master data with

  • When I download a Numbers file from iCloud to my Mac, it isn't the latest version.

    Today I worked on a Numbers file on my iPad 2 from 4:40 pm to 6:30 pm. A few hours later, when I tried to download the file from iCloud to my Mac, none of today's changes appeared. When I looked at it again on the iPad, on the main Numbers page where

  • How can I export table and cell styles to use in another InDesign document?

    I've been looking-and looking but can't find out how to export table styles within InDesign CC. If there is a load table styles option within the panel, it stands to reason there should be an export. Any help would be appreciated, thanks.

  • How to view contents in Long Raw datatype column

    Hi, We have two node RAC database with 10.2.0.4.0 version. OS - IBM AIX. We have a table with a column with datatype "LONG RAW" in production. It stores image files. We need to send the images from few rows to third party vendor. Basically, they need

  • Colour peeling off please help!!

    Hiii I just brought an iTouch 5th gen a few months ago........and noticed today that  the blue colour has been slightly chipped off at the bottom...its still in the warranty period....wat should i do ???? please help