Insert Leading Zeroes

How Do Everyone!
I have a currency amount say 144.66 and I want to insert leading zeroes.
I want to convert it to say 000000144.66
I have used the FM CONVERSION_EXIT_ALPHA_INPUT but because
there is a decimal point in the number it is not quite working.
Any ideas anyone??
Cheers
Andy

Hi,
Please try this.
DATA: P TYPE P DECIMALS 2 VALUE '144.66'.
DATA: N(12) TYPE C.
N = P.
SHIFT N RIGHT.
TRANSLATE N USING ' 0'.
WRITE:/ N.
Regards,
Ferry Lianto

Similar Messages

  • Inserting Leading Zero's into Parameter

    Within the database there are records that can be a total of 10 characters
    For example the Packing List record within the database is 0000000257
    I would like to create a parameter where the users only needs to enter in "257" and the report will find and return the information for the "0000000257" packing list.

    Actually, that will NOT work!  The formula given will cause a DB value of 1234567890 to match parameter value 890!
    You need to do this instead (basic syntax):
    formula = ({db field} = mid("0000000000", 1, 10 - length({?parameter})) + {?parameter})
    HTH,
    Carl

  • How do I add leading zero(s) to exported files' names?

    I'm using Lightroom 1.4 on an iMac, with OS X 10.4. When I export a batch of photos, they get numbered automatically. For example, if they're pictures of my dog, I'll specify "Dog" as the name to be used and 1 as the starting number. Lightroom will then export them as "Dog-1.tif" and "Dog-2.tif" and so on.
    The problem is that when I then load these files into another application, it thinks that "Dog -1.tif" should be followed by "Dog-11.tif," then "Dog-12.tif," and so on to "Dog-19.tif" and then "Dog-2.tif," "Dog-20.tif," "Dog-21.tif," etc.
    One solution to this would be to have them numbered as 01, 02, 03. . . 09, 10, 11, etc. Rather than add those leading zeros to the file names manually, I'd like to have Lightroom put them in when it exports the files, but I can't figure out how to do that. I've tried entering 01 as the starting number in the "Export" dialogue box, but that doesn't do the trick.
    Can anybody tell me how to get Lightroom to add a leading zero (or zeros, when I export more than 99 files at a time) to the file names?

    >What if I just wanted to name the images 0001, 0002, 0003, etc? Can't seem to figure that out.
    In the Filename Template Editor, simply insert the [Sequence # (0001)] token as the only entry in the template field.

  • Suppressing Leading Zeroes in the Query output

    Hi,
    I have selected a data field(0MATERIAL) as a free characteristics, It displays text and key and the key has leading zeroes.
    In the infoobject 0MATERIAL, ALPHA conversion routine is not selected, I can't change and insert the ALPHA right now because it would end up with reloading a large volume of data in different targets. To avoid this or to reduce the impact, in the reverse way,
    Could it be possible to suppress this leading zeroes at the query level? I was hoping that there would be a change that I could make at the query level, since it is 0Material and am looking at the point of minimal impact.
    Thank You.

    Hi Senthil,
    create InfoObject ZMATERIAL like a copy of 0MATERIAL, delete all the attributes and insert ALPHA conversion.
    Insert this ZMATERIAL like display attribute of 0MATERIAL. In InfoSource for 0MATERIAL map also ZMATERIAL with the same field that is feeding 0MATERIAL (MATNL). In your query insert 0MATERIAL and ZMATERIAL, and then hide 0MATERIAL (you need to insert also 0MATERIAL because ZMATERIAL is only in display), you will see only the values of ZMATERIAL, that is the material without the zeros in front.
    You can also decide to transform ZMATERIAL like navigational attribute, but in this case you have to change all the structure where do you want ZMATERIAL, because you need to flag it like navigational in that specific structure.
    Ciao.
    Riccardo.

  • XmltoQuery removing leading zero

    Hi,
    I have a function that takes in a raw xml and covert to query.  The problem is any leading zeroes are gone.  For example, 000123 will become 123.  Is there any way or function in CF that will stop from removing leading zeroes?
    Thanks,

    Oh, sorry.  It's not the XML to Query problem but it's the cfquery problem.  When I cfdump the data, it shows 000123, but when I use <cfquery> to insert the data into a dabase, it strips the leading zeroes and in the db table it shows only 123.  Is there a function or something to prevent this?
    <cfoutput query="get_xml_data">
    <cfquery name="test" datasource="db">
         INSERT INTO table (id, name)
         VALUES (#get_xml_data.id#, #get_xml_data.name#)
    </cfquery>
    </cfoutput>

  • Adding leading Zeros to table

    Hi i have a table having structure as
    CREATE TABLE "OMPODI"."END_RECORD"
    "RECORD_TYPE" CHAR(5 BYTE),
    *"TOTAL_NUMBER" CHAR(10 BYTE)*
    and insert statement is as
    insert into ompodi.end_record
    (select 'END',to_char(count(*)+2) from omp.ompproduction where locationid='MES2'
    and (select distinct to_char(to_date(productionweek,'YYYYMMDD'),'ww') from omp.ompproduction)>=(SELECT TO_CHAR(sysdate,'WW') FROM DUAL))
    I want to have leading zeros for total_number.
    e.g:- i i have a count of 10 then it should be displayed as '000000010'.
    How it can be achieved?
    Edited by: MaheshGx on Feb 5, 2012 10:29 AM
    Edited by: MaheshGx on Feb 5, 2012 10:29 AM
    Edited by: MaheshGx on Feb 5, 2012 10:30 AM

    MaheshGx wrote:
    Hi i have a table having structure as
    CREATE TABLE "OMPODI"."END_RECORD"
    "RECORD_TYPE" CHAR(5 BYTE),
    *"TOTAL_NUMBER" CHAR(10 BYTE)*
    and insert statement is as
    insert into ompodi.end_record
    (select 'END',to_char(count(*)+2) from omp.ompproduction where locationid='MES2'
    and (select distinct to_char(to_date(productionweek,'YYYYMMDD'),'ww') from omp.ompproduction)>=(SELECT TO_CHAR(sysdate,'WW') FROM DUAL))
    I want to have leading zeros for total_number.
    e.g:- i i have a count of 10 then it should be displayed as '000000010'.
    How it can be achieved?
    Edited by: MaheshGx on Feb 5, 2012 10:29 AM
    Edited by: MaheshGx on Feb 5, 2012 10:29 AM
    Edited by: MaheshGx on Feb 5, 2012 10:30 AM
      1* select to_char(10,'0000000009') from dual
    SQL> /
    TO_CHAR(10,
    0000000010

  • Document Templates in MS Word - how to cut the leading zeroes in number

    Hello CRM gurus !
    We use document templates in MS Word but have the document number printed with the leading zeroes.
    example we have now:
    0005000681
    example we want to have:
    5000681
    Question - how to do that?
    Is that in standard? The document number is the ObjectID tag as far as I know. Do I need to create another tag?
    Or may be just call a function? Do I need to change my current Web Service Tool? Is that some extra ABAP to be inserted?
    Thank you very much.

    Hi,
    have you tried to use this function call to delete de leading zeros?:
         CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
           EXPORTING
             input  = value
           IMPORTING
             output = value.
    Best regards
    Manfred

  • Need leading zeros to fill the front of a 10 character parameter being passed-HELP!

    I have a prompt 10 character parameter that some people forget to insert the zero at the beginning of the number. ex.(they type "594468010", suppose to be "0594468010").  How can I fill in the leading zeros for them after they type in the prompt box?  My prompt comes from a command.  Here is a sample of the where clause:  WHERE DB.ID_NUMBER = '{?I_IDNO}'
    I tried to use LPAD('{?I_IDNO}',10,0), it works with plsql, but not when I run the crystal report.
    Does anyone have any ideas?  thanks for your help in advance!

    a) you can always use your database specific cast / convert function to convert the text field into a number for the purpose of record selection. then change the prompt type to numeric. crystal commands are database specific so you'd want to check your database help on what specific syntax to use for the cast / convert in the command.
    b) the other choice to leave the command & prompt type alone & use an edit mask on the command prompt...this would then force the end user to enter the leading zeroes as the edit mask would force a certain length on the entry. so in the crystal field explorer edit the prompt and put in an edit mask of 000000000 for example if you wish to force the end user to enter 9 numeric characters.

  • Leading zeros trimmed!

    I am extracting data from a text file and putting it in an SQL Server 2000 database. When I insert fields with leading zeros into the database, the zeros are trimmed away. All my data are string type and I use VARCHAR in the database for those fields.
    When I insert literal strings with leading zeros, the zeros do appear in the database.
    Any help is much appreciated.
    Akz

    This is the code I use to update my SQL Server database. As you can see, 5 strings are declared and initialized; some have leading zeros.
    4451972 129293 040504 015011 000319
    When I open the databse , the leading zeros are missing.
    The database record for the record I just inserted looks like the following:
    4451972 129293 40504 15011 319
    What happens to the leading zeros?
    This is the code:
         String url = "jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=CRD_DB";
         Connection con;
         Statement stmt;
         String caller="4451972", called="129293", date="040514", startTime="015011",
    duration="000319";
         try {               
         Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
         } catch(java.lang.ClassNotFoundException e) {
         System.err.print("ClassNotFoundException: ");
         System.err.println(e.getMessage());
         try{
         con = DriverManager.getConnection(url,"pola", "pola" );
         stmt = con.createStatement();
         stmt.executeUpdate("INSERT INTO CRDTableNew values("+caller +"," + called+","+date
    +","+startTime+","+duration+")");
         stmt.close();
         con.close();
         catch(SQLException ex){
         System.err.println("SQLExc.:" + ex.getMessage());
         }

  • Removal of leading zero in &*BSID-SGTXT&.

    Hi ,
    I need to remove the leading zero from my sacscript fileld &BSID-SGTXT&.  When its &BSID-SGTXT& I can put &(Z)BSID-SGTXT&.*
    Since i am using &BSID-SGTXT&  insertion of Z before is not compressiving zero.*
    How to compress leading zero in &BSID-SGTXT&.   case.*Thanks *

    Hi Kiro,
    Don't post Duplicate threads,
    You can continue here till your Issues gets resolved.
    Removal of leading zero from &*BSIS-SGTXT&
    &(Z)BSID-SGTXT&. " Instead of puttin z at initial position change as below
    &BSID-SGTXT(Z)&.
    how to delete leading zeros in sap script
    Cheerz
    Ram

  • Exporting Numbers file with leading zeros as csv file

    When I export a list of mobile phone numbers with leading zeros (086* etc.) from Numbers as a csv file, the leading zeros are stripped out, although the cells are previously formatted as text. What can I do about this?

    "When I export a list of mobile phone numbers with leading zeros (086* etc.) from Numbers as a csv file, the leading zeros are stripped out, although the cells are previously formatted as text. What can I do about this?"
    Well, the first thing you could do would be to post your question in one of the forums for Numbers.
    Click Discussions to get to the Discussions index page, then the section for the version of iWork you're using, then the Numbers forum in that section.
    In AppleWorks (which doesn't offer an opportunity to Save as or Export as csv) I'd force the application to see the phone numbers as text by inserting some non-numeric characters into the string of digits.
    Examples: 000-123-4567, 000 123 4567
    It may also be a function of the application you are using to open the csv file.
    When I did a brief test of the suggestion above with Numbers '09, I got this result on opening the file in Text Edit:
    ,1234567890,num
    ,123-456-7890,tex
    ,0123456789,num
    ,012-345-6789,tex
    ,0001234567,num
    ,000-123-4567,tex
    Note that both the examples entered as a string of digits only (num) and those entered with inserted hyphens (tex) kept the leading zeroes. Cell format for the column containing the phone numbers was set to Text.
    Regards,
    Barry

  • Numbers with leading zeros

    I am using Framemaker 8 - unstructured.
    I have a requirement that the work packages/documents within a book contain an identifying number that begins with leading zeros and is four-digits long. This number also increments from one document to the next.
    For example, first work package is '0001', next one is '0002', '0003', .... '0010', '0011', etc.
    For the automatic incrementing, I am treating these work packages as chapters. However, I have not seen an automatic way to have the leading zeros.
    I've come up with the following process:
    First, I've created a text box on the master pages in which I entered 000 and then I insert the Chapter Number variable at the end. The tricky thing here is when I reach the tenth work package, the number on the master page has to change slightly to 00<$chapter number>. Note: I've tried also using the <n+> autonumbering scheme but this didn't work out as well as the chapter number variable.
    I've looked briefly into using conditional text for automatically deciding when '000' or '00' is used, but have been unable to figure this out.
    Any suggestions for something more automatic?

    You can fake this using paragraph autonumbering and create a tab leader where the "0" digit is used as the leader. Set a right-aligned tab position where you want the right-most digit of the id number to begin. You have to play around with position and font size to get it to look right.

  • How to append leading zeros

    Dear Friends,
    In a transparent table xyz I have one field 'Bill No.' which is of character type & length 10. when I insert data in this table the value for this field gets stored as '0000000001'.
    I am facing a problem when the user is giving  value of  Bill No. as '1'. It doesn't pick the data because the corresponding value in my table is '0000000001'.
    Once I have used the function CONVERSION_EXIT_ALPHA_OUTPUT' to remove the leading zeros but here I have to append the leading zeros.
    How to overcome this pls advise.
    Regards,
    Alok.

    Hi,
    Use the following FM:
    CONVERSION_EXIT_ALPHA_INPUT converts any number into a string fill with zeroes, with the number at the extreme right
    Example:
    input  = 123
    output = 0000000000000...000000000000123
    Hope this helps.
    Reward if helpful.
    Regards,
    Sipra

  • Procedure truncating leading zeros

    Hello,
    I'm setting up sequences for my sample database, in my design I have my ID columns in this format Staff: S110001, Parents: P110001 etc.
    When I try to implement this in a sequence like:
    create sequence Pnt_seq1 start with 0001;
    insert into parents
    (parent_id, f_name, m_init, l_name, house_n, street, city, postcode)
    values
    (('P' || to_char(sysdate, 'yy')|| Pnt_seq1.nextval), 'Jim', 'I', 'Brown', 34, 'Barker St', 'Wrexham', 'LL11 8UH');
    It trims or truncates the leading zeros giving me P111 instead of P110001. Is there a way around this or am I better off changing my domain definitions/schema to start at P111001 or something?
    Thanks a lot
    Mike

    A sequence is always numeric, so leading zeros have no place
    Nothing is trimmed.
    If you want leading zeros in the code you posted use
    to_char(Pnt_seq1.nextval,'fm0009')
    Sybrand Bakker
    Senior Oracle DBA

  • Append Leading Zero's

    Hi ,
    the follwing SQL generates Zero's prefixed to the rownum. While inserting the data into table all the zero's go away
    why ?
    How can i insert data with Zero's ?
    <SQL>
    select
    (Case length(rownum)
    when 1 then '0000'||rownum
    when 2 then '000'||rownum
    when 3 then '00'||rownum
    when 4 then '0'||rownum
    else
    to_char(rownum)
    END )
    from
    SELECT o.class_code d
    FROM sun_oracle_schedule_backup@ougbs_ougbs.world o
    Union
    SELECT to_number(m.schedule_id,'99999') d
    FROM sun_MYSQL_schedule_backup@ougbs_ougbs.world M
    Union
    SELECT o.class_code d
    FROM sun_internal_schedule_backup@ougbs_ougbs.world o
    <SQL>
    Out put of the above query
    00001
    00002
    00003
    00004
    00005
    00006
    00007
    When used with INSERT statement the table has the values as
    1
    2
    3
    4
    5
    6
    7
    Where did the Zero's GO?????
    the table column data type is Number......
    Thanks
    --- Raj

    Is the ciolumn that you are inserting into ..declared as a number or is it a varchar2?
    sql> create table t(
      2    id number
      3  );
    Table created.
    sql> insert into t values (0001);
    1 row created.
    sql> insert into t values(0002);
    1 row created.
    sql> commit;
    Commit complete.
    sql> select * from t;
            ID
             1
             2If you declare it as a varchar2...
    sql> create table t(
      2    id varchar2(10));
    Table created.
    sql> insert into t values ('0001');
    1 row created.
    sql> insert into t values ('0002');
    1 row created.
    sql> commit;
    Commit complete.
    sql> select * from t;
    ID
    0001
    0002But why do you want to store the values appended with leading zero's in your table..???

Maybe you are looking for

  • How do I get back my Before/After Icons?

    The icons for the before and after view have disappeared on my lower menu bar.  They were always displayed just above the thumbnails at the bottom of my screen, and now they are gone.  How do I get them back I appologize for this simple question in a

  • How do I change the highlight color of forms?

    I'm using Acrobat Pro X. I need the form highlights to be transparent when another user opens the pdf, views and fills individual forms out. Trying to keep this very simple for end user. I don't want to give the user instruction on how to go to prefe

  • Upgraded to FCP 7.0.3 and having difficulty with playback

    I have opened a project that was working perfectly in FCP 6 in FCP 7.0.3 on the same system I am getting the following alert: "One or more frames were dropped during playback..." Mac Pro My OSX is updated to 10.5.8 Processor 2x3 GHz Dual-Core Intel X

  • Has anyone seen incorrect date metadata on import?

    I'm importing HDV video and have tried it with both a Canon XH A1 and Vixia HV40. I'm seeing the date offset by exactly one day-what appears as 11/20/2010 1:30 PM on the camera gets imported as 11/19/2010 1:30 PM in FCP X. I've confirmed that the dat

  • Adobe Acrobat Business Tools X

    I bought a new Dell laptop last year which included Acrobat Business Tools, on which I have a serial number. I recently downloaded Acrobat XI, which deletedmy X software. My online purchase history does not reflect the purchase (probably because I di