Regarding padding Zeros

data :  DMBTR(12) TYPE P DECIMALS 3, 
   dmbtr  = 300.000-
How to pad this field with zeros in front of it.
Please help me in this regard
Thanks,
Lakshmi.

Hi,
Test the following Code.
Data: a(8) TYPE n.
a = '00000056'.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
  EXPORTING
    input         = a
IMPORTING
   OUTPUT        = a
WRITE: a.
a = '56'.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
  EXPORTING
    input         = a
IMPORTING
   OUTPUT        = a
WRITE: a.
Kind Regards,
Faisal

Similar Messages

  • Padded zeros which is removed need to be replaced by spaces

    Hi Friends,
    My requirement in XI is : Padded zeros which is removed need to be replaced by spaces.
    for removing padded zeros I used the UDF:
    int i = Integer.parseInt(a);
    return (Integer.toString(i));
    It is working fine.
    Please help as how to go abt in coding : whatever zeros get taken off , need to be replaced with spaces.
    Thanks in Advance,
    Meghna.

    Hi Raj,
    According to the logic given by Henrique, its working. But the point to the noted is that :
    The number of spaces need to be equal to the number of zeros removed, where it not happening in this case.for the below Ex when applied it returned '  12345' instead of '    12345'.
    For ex. source field is '000012345' then the target field need to be '    12345'.
    the Type declared in the data type for the receiver field is integer with length 15.
    Is it possible to move the field value to the right justified, so the the padded zeros code when applied will automatically load spaces.Becoz the code written for removing zeros contains String due to which it is left justified i think.
    The code written for removing zeros is :
    int i = Integer.parseInt(a);
    return (Integer.toString(i));
    please suggest in this regard.
    Regards,
    Meghna.
    Edited by: meghna swaraj on Feb 27, 2008 6:05 PM

  • A query on removing additionally padded zeroes from the pernr.

    Hi ,
    How can i remove the padded zeroes from the pernr, Ex pernr is 8 chars and if pernr has 6 chars it has to remove appended 2 zeroes from the left and should only print the 6 chars with no appended zeroes
    Thanks

    Hi Khaleel,
    Use FM <b>CONVERSION_EXIT_ALPHA_OUTPUT</b>
    Reward if useful.
    Thanks
    Aneesh.

  • Padding zeros

    Hi friends,
    I need a small help.
    My requirement is like,I need to pad zeroes in front of a quantity value.
    I am using CONVERSION_EXIT_ALPHA_INPUT.But,it is going into dump,because
    I am passing a quantity field as input.
    Can any one suggest any function module,to pad zeroes to a quantity value or decimal value.
    Points guaranteed,
    Imran

    hi masood,
    first Convert that Quantity field value into Char type and then pass it to conversion routine..
    ex:
    data: var(length) type c.
    var = quantity field.
    and then pass it to conversion routine.
    <b>Reward points if useful</b>
    Message was edited by:
            Chandra

  • UDF for padding zeroes

    Hi
    I need a UDF Code for the following requirement ,which is used in various fields across a lot of mappings
    Requirement is that if it is a fixed length file and the field length is 10 then whatever value thats coming should be right alligned and there shud be zeroes padded to the left of it
    for e.g
    field length is 10
    input value os 3456
    then the output should be 0000003456
    I want to make it a generic function wher i can take the field length and the input value as inputs
    Dev

    Hi,
    You can edit my function. What you can do is send the length as one input and then it should work. Add this code:
    Create a value udf with two input arguments a and input. Then add this code:
    Imports:  java.*;
    int len=input.length();
    int b = Integer.parseInt(a);
    for(int i=0; i<b-len;i++)
    input="0"+input;
    return input;
    Here pass the total length of the field in first argument and then send the input value to teh second argument. Then it should work for you.
    Regards,
    ---Satish

  • Filename manipulation to get padded zero

    Hi All,
    I am using a file adapter and used the file name as "source_target_fl_%yyyyMMdd%_%SEQ%.xml"
    From file adapter wsdl:
    <jca:operation
    LogicalDirectory="OUT_DIR"
    InteractionSpec="oracle.tip.adapter.file.outbound.FileInteractionSpec"
    FileNamingConvention="source_target_fl_%yyyyMMdd%_%SEQ%.xml"
    OpaqueSchema="false" >
    </jca:operation>
    Now is there any method that I can get the filename as source_target_fl_20090818_00001.xml , I mean I need to do left pad to the sequence, is this possible to do it in the wsdl itself.
    Regards,
    Sreejit

    Have you tried to use "APPS.FND_CONCURRENT" API?
    http://etrm.oracle.com/pls/trm11510/etrm_pnav.show_object?c_name=FND_CONCURRENT&c_owner=APPS&c_type=PACKAGE
    http://etrm.oracle.com/pls/trm11510/etrm_pnav.show_object?c_name=FND_CONCURRENT&c_owner=APPS&c_type=PACKAGE%20BODY
    Thanks,
    Hussein

  • Regarding zppending zeroes in ABAP.

    Hi,
    How can I code followng in ABAP ?
    If the length of field (ZDCM-ZIPCODE) is less than 5 digits, then append zeros at beginning so that length becomes 5 digits.
    Ex: If we have 45 then it should become    00045
          If we have 1 then it should become      00001
          If we have 3478 then it should become 03478
    Regards,
    Rajesh

    Here is an easy way.  Simple move it to a numeric with a length of 5 and then move it back to ZIPCODE.
    data: n(5) type n.
    n = ZDCM-ZIPCODE.
    ZDCM-ZIPCODE = n.
    Regards,
    Rich Heilman

  • Pad Zeros in user Exit

    What is the syntax to pad a value with zeros in a user exit code.
    I have a value of MONTH 01,02, 03...12.  Then to get previous month I do MONTH-1 but this gives me 1,2,3...12.  and I loose the zero which i will need when I concatenate with year to get what I need...
    help please

    hi,
    check the links,
    http://help.sap.com/search/highlightContent.jsp
    http://help.sap.com/search/highlightContent.jsp
    http://help.sap.com/erp2005_ehp_03/helpdata/EN/4f/d5276c575e11d189270000e8322f96/frameset.htm

  • Regarding Leading Zeros.

    Hello Friends,
    How can I remove leading zeros in an Internal Table Value. I am writing a BDC for User Defined Transaction. Here BDCDATA-Fval contains length of 132 chars. When I append a value to BDCDATA, it is appending as right justified. when we try to populate a value in to Screen field(CURRENCY FIELD), it is taking first 10 chars(from leftside) which are Zeros(leading zeros). for that, I would like to remove leading zeros for internal table BDCDATA. How can I do it?
    Thanks & Regards
    Sathish Kumar

    Hi Satish,
    To remove leading zeros and leading blanks
    Please use FM
    CONVERSION_EXIT_ALPHA_INPUT Conversion exit ALPHA, external->internal
    CONVERSION_EXIT_ALPHA_OUTPUT Conversion exit ALPHA, internal->external
    Hope this resolves your query.
    Reward all the helpful answers.
    Regards

  • IP Adresses - padding zeroes for ORDER BY

    Hi!
    I have a table with an IP address inside (type varchar2(50)). The data inside looks like 192.168.0.1. Now, my app should be able to ORDER BY this ip address. This means, when I do ORDER BY on this column without any changes, the output is wrong:
    192.168.0.1
    192.168.0.10
    192.168.0.11
    192.168.0.2
    and so on.
    Is there a way to temporarily pad the leading zeroes, e.g.
    to 192.168.000.001?
    Thanks in advance
    André
    PS: To all those who helped me with my large-table-speed-problem some months ago: The project has been dropped :-( Thanks again anyway.

    Depending on how much use you make of IP addresses in your application, it might be worth defining IP_ADDRESS as a type, as then it could have its own MAP or ORDER function and you can simply ORDER BY the IP address column.
    Here is a basic example using IPv4 n.n.n.n addresses. You could add IPv6, domain name, etc etc as necessary.
    CREATE OR REPLACE TYPE ip_address AS OBJECT
    ( hostname VARCHAR2(50)
    , address  VARCHAR2(25)
    , elements INTEGER_TT
    , CONSTRUCTOR FUNCTION ip_address
         ( p_address VARCHAR2 DEFAULT NULL )
         RETURN SELF AS RESULT
    , MAP MEMBER FUNCTION ip_to_integer
         RETURN INTEGER
    CREATE OR REPLACE TYPE BODY ip_address
    AS
         CONSTRUCTOR FUNCTION ip_address
              ( p_address VARCHAR2 DEFAULT NULL )
              RETURN SELF AS RESULT
         IS
              v_current_pos INTEGER := 1;
              v_next_pos    INTEGER := INSTR(p_address,'.');
              v_element_len INTEGER := v_next_pos - v_current_pos;
         BEGIN
              IF p_address IS NULL THEN
                   RETURN;
              ELSIF p_address NOT LIKE '%.%.%.%' OR p_address LIKE '%.%.%.%.%'
              THEN
                   RAISE_APPLICATION_ERROR
                   ( -20000
                   , '"' || p_address || '" is invalid: format should be n.n.n.n' );
              END IF;
              SELF.elements := INTEGER_TT(NULL,NULL,NULL,NULL);
              FOR i IN 1..4 LOOP
                   SELF.elements(i) := SUBSTR(p_address, v_current_pos, v_element_len);
                   IF SELF.elements(i) NOT BETWEEN 0 AND 255 THEN
                        RAISE_APPLICATION_ERROR
                        ( -20000
                        , '"' || p_address || '" is invalid: element ' || i ||
                          ' "' || SELF.elements(i) || '" is outside range 1-255' );
                   END IF;
                   v_current_pos := v_next_pos +1;
                   v_next_pos    := INSTR(p_address,'.',v_current_pos +1);
                   v_element_len := v_next_pos - v_current_pos;
                   IF v_next_pos = 0 THEN
                        v_element_len := 1000;  -- Arbitrary large value
                   END IF;
              END LOOP;
              SELF.address := p_address;
              RETURN;
         END;
         MAP MEMBER FUNCTION ip_to_integer
              RETURN INTEGER
         IS
         BEGIN
              RETURN
                SELF.elements(1) * 1e9
              + SELF.elements(2) * 1e6
              + SELF.elements(3) * 1e3
              + SELF.elements(4);
         END;
    END;
    show errors
    CREATE OR REPLACE VIEW ip_test_view
    AS
    SELECT address_var
         , IP_ADDRESS(address_var) AS address_obj
    FROM   ip_test
    SQL> desc ip_test_view
    Name                                      Null?    Type
    ADDRESS_VAR                                        VARCHAR2(25)
    ADDRESS_OBJ                                        IP_ADDRESS
    SQL> SELECT t.address_var, t.address_obj.address FROM ip_test_view t ORDER BY address_var;
    ADDRESS_VAR               ADDRESS_OBJ.ADDRESS
    192.168.0.1               192.168.0.1
    192.168.0.10              192.168.0.10
    192.168.0.11              192.168.0.11
    192.168.0.2               192.168.0.2
    2.168.0.2                 2.168.0.2
    92.168.0.2                92.168.0.2
    6 rows selected.
    SQL> SELECT t.address_var, t.address_obj.address FROM ip_test_view t ORDER BY address_obj;
    ADDRESS_VAR               ADDRESS_OBJ.ADDRESS
    2.168.0.2                 2.168.0.2
    92.168.0.2                92.168.0.2
    192.168.0.1               192.168.0.1
    192.168.0.2               192.168.0.2
    192.168.0.10              192.168.0.10
    192.168.0.11              192.168.0.11
    6 rows selected.

  • How to pad zeros at the left?

    Hi All,
    I have requirement where
    Input is 1234
    and Output should be :-0000001234(6 Zeros at left).
    Please let me knw how to do it.
    Thanks,
    Suraj

    hi Suraj,
    If you are sure its should be always prefixed with 6 zeros then u can use above mentioned method.
    But if you are not sure about the input string lenghth than below udf will help.
    s = "000000".substring(s.length()) + s;
    where s= input value which is 1234 in ur example given.
    hope this solves your problem.
    thanks and regards,
    Praveen T

  • CSS question regarding padding

    I have the following and form some reason the formText p is
    way lower
    than the formArea form, even though they have the same amount
    of top
    padding. Why is that?
    Here is the css I have.
    .formArea {
    float: left;
    width: 300px;
    height:46px;
    margin: 0;
    padding: 0;
    .formArea form{
    padding: 11px 0 0 0;
    .formText {
    float: left;
    width: 340px;
    height:46px;
    margin: 0;
    padding: 0;
    .formText p{
    padding: 11px 0 0 0;
    The page is here:
    http://www.tonalclothing.com/v2/
    Thank you for any help!
    Brian

    Add margin: 0; to the below css, as shown.
    .formText p {
    padding: 11px 0 0 0;
    margin: 0;
    Brian wrote:
    > I have the following and form some reason the formText p
    is way lower
    > than the formArea form, even though they have the same
    amount of top
    > padding. Why is that?
    >
    >
    > Here is the css I have.
    > .formArea {
    > float: left;
    > width: 300px;
    > height:46px;
    > margin: 0;
    > padding: 0;
    > }
    > .formArea form{
    > padding: 11px 0 0 0;
    > }
    > .formText {
    > float: left;
    > width: 340px;
    > height:46px;
    > margin: 0;
    > padding: 0;
    > }
    > .formText p{
    > padding: 11px 0 0 0;
    > }
    >
    >
    > The page is here:
    >
    http://www.tonalclothing.com/v2/
    >
    >
    > Thank you for any help!
    > Brian

  • Payables: Cannot start a Payment Document number with Zero

    Hi all,
    I have a bit of an unusual situation. One of my users wants to issue cheques from a book where the serial starts with 0 (015698, 015699 etc). However, Oracle Payables automatically deletes the 0 at the top of the string and leaves only rest of the integers in the cheque number field. This creates a problem in printing the payment voucher since the voucher will show the paid cheque number without the zero at the front.
    Any suggestions as to how i can overcome this?
    Miranga

    Hi Miranga,
    Note 1361688.1, R12: Payables Check Number Not Accepting Leading0. Ex: 060078, discusses this issue with the note  that:
    "This is a normal behavior, There is no chance to have leading 0 in the check number, The check number in the AP_CHECKS_ALL table is a numeric field, so we can't have padded zeros."
    For reconciliation, the leading check numbers are removed so matching can occur, assuming you have patch 12976660 applied.
      R12.0.X: ceabrmab.pls 120.62.12010000.32
      R12.1.X: ceabrmab.pls 120.56.12000000.40 
    Regards,
    Cheryl

  • Regarding Calling a Report Program

    Hi Gurus,
    1. I have an Requirement in which i need to call Program CATSSHOW.
        I need to Pass the Selection screen values from calling program by skipping the Selection screen of   Called Program.
    or
    2. Can i call the Transaction CADO(which is T-CODE for CATSSHOW Program)
        by passing selection screen values from calling program to call program skipping selection screen.
    I used  a. SUBMIT catsshow
                            WITH so_pers  IN r_pernr
                            WITH so_datum IN r_datum
                            AND RETURN.
                  which goes to the called program and does not pass the values to the ranges in called program.
    a. SUBMIT catsshow VIA SELECTION-SCREEN
                            WITH so_pers  IN r_pernr
                            WITH so_datum IN r_datum
                            AND RETURN.
                  which goes to the called program and pass the values to the ranges in called program and displays the selection screen. (which i needs to skip).
    Please help regarding this.
    Thanks and Regards
    Sanath

    SUBMIT catsshow
    WITH so_pers IN r_pernr
    WITH so_datum IN r_datum
    AND RETURN.
    this should work.. make sure r_pernr and r_datum are filled properly the option and sign fields...
    MOVE wa_parameter-parva TO s_vkorg-low.
    MOVE 'I'  TO s_vkorg-sign.
    MOVE 'EQ' TO s_vkorg-option.   "<<<<< this varies
    APPEND s_vkorg.
    MOVE wa_parameter-parva TO s_vkorg-high.
    MOVE 'I'  TO s_vkorg-sign.
    MOVE 'EQ' TO s_vkorg-option.    "<<<<< this varies
    APPEND s_vkorg.
    look at the padded zeros or conversion exits available for the field...

  • Leading Zeros Supression

    How Can I supress Leding zeroes into target Structure?. Iam getting 10 digits filled zeros left justified and my target systems doesn't need zeros. Is there Standard function in Mapping I can use?

    Hi,
    With th ehelp of Substring standard function you can achieve that, if you know the exact number or length.
    Elese it is prefer to write a Java User Defined function to achieve the same.
    Just check with <i>FormatNum</i> inbuilt functions.
    This thread discusses about padding zeros, instead of this, you need to substring it..
    Lpadding zeroes to a string in message mapping- material/customer format
    Regards,
    Moorthy

Maybe you are looking for

  • Write the Error log from background Job to the Spool request

    Hi , I have a situation where in i need to capture the error log of a Z program which runs as a background job and write that log into the spool request. My Z program calls runs RSEINB00 program using the SUBMIT statement. When this Job fails the err

  • How can I debug dbms_jog error( MV refresh error)  in 10g??

    Hi all. The database is 10g. I created a job by usning the following query for MV refresh. ALTER MATERIALIZED VIEW MV_OPTION_TEST_HO1 REFRESH FAST START WITH SYSDATE+30/86400 NEXT SYSDATE+10/86400; I can see the job in the DBA_JOBS dictionary. The re

  • Not getting header item in Open Hub Destnation.

    Hi Experts, when i am generating flatfile by using Open hub destination to my Desktop location, i am not getting the headers. How can i get the headers in my xcel out put?

  • IMac won't turn on

    I am having a problem with my iMac: After it is shut down, it will not turn on for about a day or so. It is a 2006, so it's out of warranty. Any idea what the source of this problem might be before I take it in to be fixed?

  • Rating folder in iPod menu

    is there any way i can have a rating folder in the iPod menu? What do i have to do?