Decimal(19,2) column data missing leading zero when value 1.0 through OLEDB

My column is defined as type decimal(19,2). When I select data through OLEDB(C++), I got .12 if the value is 0.12. The leading 0 is always missing. How do I define a right format of this kind of column? Here is my code fragment.
// Construct the binding array element for each column
for( iCol = 0; iCol < cColumns; iCol++ )
// Bind this column as DBTYPE_WSTR, which tells the provider to
// copy a Unicode string representation of the data into our buffer,
// converting from the native type if necessary
rgBindings[iCol].wType = DBTYPE_STR;

why do you need to do this? 0.12 and .12 represents same value so if your concern is more in terms of displaying value then you can use format functions in front end to display it.
there's no need of changing base datatype to string just for  this need IMHO
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs
It may be convinient for front-end to just display anything from a db query.

Similar Messages

  • Missing leading zeros using debug

    How we will find the particular record containing the missing leading zero and how we will add the missing leading zeroes using debug

    Hi,
    I would suggest to check out the psa. By sorting the data by different criteria you will see duplicates. Additionally you can filter the records based on different restrictions on each field and might be able to find the records containing or not containing fields with leading zeroes.....
    But anyway, some manual work has to be done.
    regards
    Siggi

  • Leading zeroes when loading data

    Hi ,
    I have infobject 0gl_account being used in production . I am now using it in a custom ods also.
    however , when i load data into the ods , GL account field gets loaded with leading zeroes.
    when i load master data to 0gl_account, there are no leading zeroes . My ODS activation gives
    an error saying NO SID exists for gl acct 000999999 , whereas gl acct 999999 exists in the
    master data.
    I can change settings of 0gl_account as it is already being used in production . is there
    a way to resolve this without creating a custom infoobject .
    pls guide
    thanks

    Hi,
    this sounds very strange, because normally the master data should come with leading zeroes. Additionally the conversion exit ALPHA is switched on for infoobject 0gl_account. Make sure that everything is set up correctly and your master data gets loaded correctly.
    regards
    Siggi

  • BPC 7.5 NW: Master Data with leading zeros

    In BPC 7.5 NW, is it still an issue to have Master data with leading zeros?
    In other words, is it still not advisable to have leading zeros in the Master data.
    Let me know your views.
    Thanks.

    I was also having the same issue almost in the same version.
    Other than what you mentioned, the master data was also jumbling up like 0120, 0130, 0145, were set up as 120, 145, 130....
    The workaround that we took was to put a leading alphabet, when the data comes into BPC.
    Try doing that, it will surely help.
    Hope this helps.
    Thanks.
    Anand

  • EAN number missing leading zeroes

    Hi,
    I have configured two types of EAN/UPC numbers, one being 12 characters and one being 14.  In our business, we have a situation where a material has a case UPC number 00099999123456 and a package UPC of 099999123456.
    When these values are displayed on the material master I will see either
    099999123456  or
    00099999123456 
    but not both values with the correct number of leading zeroes.
    Is there a way to have the correct value with the right number leading zeros when the EAN number is the same except for the leading zeroes?
    The standard conversion routines i've looked at do not take into account there could be a different number of leading zeroes based on the EAN type assigned as the type is not a import parameter for  CONVERSION_EXIT_EAN11_OUTPUT.
    thanks!

    Hi,
    As per your query this is related to your configuration setting. Pls consult with SD/FI consultant and also consult with ABAPER. If configuration is ok then may be your have develop a programe and the programe may be wrong.
    Anil

  • Truncation of leading Zeros when Down Loading into Excel - OLE Objects

    Hi,
    Can any one help me on this.
    I am using <b>OLE Objects</b> to download Data into Excel Sheet. Data with leading Zeros is getting truncated in Excel.
    Ex: Report Output is showing Plant Number as 0002. But when i am downloading to Excel Plant value will become 2 .
       I would like to have it as 0002 in Excel.
    I have declared Werks as CHAR of 4.I am using OLE Obects for Downloading into Excel Sheet.
    I am using "OLE2_OBJECT" I can not use any other FMs to down load to Excel.As i am modifying this program not creating.
    Thanks In Advance.
    K.Nirmala
    Message was edited by: Nirmala Reddy

    Hi Nirmala,
    While downloading to excel sheet, u need to change the number format of cell from General to Text, then leading zero's won't get deleted. For that u need to set the property of the cell. Please check this sample code,
    INCLUDE OLE2INCL.
    tables : zobrent.
    data : it_kna1 type table of zobrent with header line.
    handles for OLE objects
    DATA: H_EXCEL TYPE OLE2_OBJECT,        " Excel object
          H_MAPL TYPE OLE2_OBJECT,         " list of workbooks
          H_MAP TYPE OLE2_OBJECT,          " workbook
          H_ZL TYPE OLE2_OBJECT,           " cell
          H_F TYPE OLE2_OBJECT.            " font
    DATA  H TYPE I.
    DATA: cell1 TYPE ole2_object.
    *&   Event START-OF-SELECTION
    START-OF-SELECTION.
      select * from zobrent into table it_kna1
               where zopanid = '10001'
                and zo_brent = '050'.
    start Excel
      CREATE OBJECT H_EXCEL 'EXCEL.APPLICATION'.
      PERFORM ERR_HDL.
      SET PROPERTY OF H_EXCEL  'Visible' = 1.
    get list of workbooks, initially empty
      CALL METHOD OF H_EXCEL 'Workbooks' = H_MAPL.
      PERFORM ERR_HDL.
    add a new workbook
      CALL METHOD OF H_MAPL 'Add' = H_MAP.
      PERFORM ERR_HDL.
    output column headings to active Excel sheet
      PERFORM FILL_CELL USING 1 1 1 'EDate'.
      PERFORM FILL_CELL USING 1 2 1 'Brent'.
      PERFORM FILL_CELL USING 1 3 1 'Zopanid'.
      PERFORM FILL_CELL USING 1 4 1 'Contract Type'.
      PERFORM FILL_CELL USING 1 5 1 'Price Type'.
      PERFORM FILL_CELL USING 1 6 1 'Installation Type'.
      PERFORM FILL_CELL USING 1 7 1 'Volume'.
      PERFORM FILL_CELL USING 1 8 1 'AQ'.
      PERFORM FILL_CELL USING 1 9 1 '00000123'.
      LOOP AT IT_KNA1.
    copy values to active EXCEL sheet
        H = SY-TABIX + 1.
        PERFORM FILL_CELL USING H 1 0 IT_KNA1-zo_effdat.
        PERFORM FILL_CELL USING H 2 0 IT_KNA1-zo_brent.
        PERFORM FILL_CELL USING H 3 0 IT_KNA1-zopanid.
      ENDLOOP.
      CALL METHOD OF h_excel 'Cells' = cell1
        EXPORTING
          #1 = 1
          #2 = 1.
      FREE OBJECT H_EXCEL.
      PERFORM ERR_HDL.
      if sy-subrc eq 0.
       write : / 'year'(001).
      endif.
         FORM FILL_CELL
    sets cell at coordinates i,j to value val boldtype bold
    FORM FILL_CELL USING I J BOLD VAL.
      CALL METHOD OF H_EXCEL 'Cells' = H_ZL EXPORTING #1 = I #2 = J.
      PERFORM ERR_HDL.
      GET PROPERTY OF H_ZL 'Font' = H_F.
      PERFORM ERR_HDL.
      SET PROPERTY OF H_F 'Bold' = BOLD .
      PERFORM ERR_HDL.
    ***Changing the format of the cell from General to Text
      <b>SET PROPERTY OF H_ZL 'NumberFormat' = '@'.</b>
      PERFORM ERR_HDL.
      SET PROPERTY OF H_ZL 'Value' = VAL .
      PERFORM ERR_HDL.
    ENDFORM.
    *&      Form  ERR_HDL
    FORM ERR_HDL.
    IF SY-SUBRC <> 0.
      WRITE: / 'Fehler bei OLE-Automation:'(010), SY-SUBRC.
      STOP.
    ENDIF.
    ENDFORM.                    " ERR_HDL
    U just paste this code in a sample program & see.
    Please reward, if found helpful.

  • Need hel attendant console- missing leading zero

    I have a customer wher we did an upgrade from 4.1(3) to CUCM 7.1(2), we installed the AC plugin from the CUCM, and the AC is working but now the cutomer complains that they can't dial back from the AC because they are missing the leading zeros from the incomming calling numbers, on the phone the numbers are displayed with the zeros, what can be doen to have the leading zeros on the  AC
    Thanks

    Bradley,
    I cannot comment on the implementation you have gone through but I can comment on your comments about CUEAC.
    There is going to be a new release in June this year which will support directory integration directly to AD as well as the CUCM sync which is available today.
    The GUI iteself is to undergo a redesign in version 10, the date on this release is not yet known.
    Incremental search is something which is not on the roadmap but is something I will discuss with the Product Manager to see if it can be considered.

  • Padding a julian date with leading zeros ?

    Hi,
    I have gernerated a julian date, which I am appending to another two digit number to create a five digit serial number.
    Is there a simple way to pad the first 99 days with leading zeros ( i.e. 001, 002....025...099) so that I maintain a five digit serial number ?
    I am using   Get Date In Time/Seconds > Number To Decimal String > Unbundle >Number to Decimal String.
    Thank you in advance for any advice,
    Alan

    Here's the simplest way to do it (with he 2 digit number), I believe:
    Message Edited by Matthew Kelton on 02-21-2008 12:43 AM
    Attachments:
    Julian1.png ‏3 KB
    Julian2.png ‏2 KB

  • Export to Excel - data with leading zeros

    Does anyone have any tips or tricks for running a query then exporting to Excel without dropping leading zeros from the data?
    Examples: numeric Item codes with leading zeros, telephone numbers that have been entered with no spaces.
    Regards,
    Douglas McDove

    < Font Color="RED" Size = 3 Face=Verdana>
    I liked the challenge and therefore.......I got this for you
    </Font>
    SELECT CHAR(28) + T0.CardCode [BP Code\] FROM  [dbo\].[OCRD\] T0
    SELECT CHAR(29) + T0.CardCode [BP Code\] FROM  [dbo\].[OCRD\] T0
    SELECT CHAR(30) + T0.CardCode [BP Code\] FROM  [dbo\].[OCRD\] T0
    SELECT CHAR(31) + T0.CardCode [BP Code\] FROM  [dbo\].[OCRD\] T0
    Any of the above 4 should work.  T0.CardCode is the database field I tested, you can substitute this with any database field and it should work.
    Regards
    Suda

  • G/L Account line item display-text column data missing-t-code faglb03

    Dear friends,
    MY client requirement like below,
    In the GR/IR Clg account no.xxxxxxxxx. the bill no was displayed in the text column. Hence we can compare the debit entry wrt to the credit entry so that the left out credit entries can be traced and booked. The vendor code was displayed against the invoice no.before upgradation. 
    But now After upgradation this facility is not available.text column data not fletching, If the text [i.e invoice no. } is not available how can we identify which vendor bill was not posted or booked. Which was in this ledger before upgradation.
    kindly help me out to sort out this issue.
    regards
    kalyanam

    Hi Cheran
    initial screen
    Double click on on Accumulated field then it will display you the line item
    Text column is displaying at line item
    kindly check the Layout if still it does not showing there
    then add this field in below Tcode then it will display
    Tcode:  OBVU
    Table : Bseg
    Field name : SGTXT
    and save it
    hope this will help you
    Thanks
    Trinath

  • Create Master Data with leading zero

    Dear Expert,
    Our customer request to create Customer Master/Vendor Master/Material Master with leading zero. For example: they want to create Customer 0234578.
    I can do that for material, would you please advise how to do the same for customer/vendor?
    Thanks you,

    Dear Mr.
    Our customer number is in numeric, then this error happen. If customer number constants 1 char, then system will keep zero leading (ex: 012A4) But if customer number constants only numeric, even i type zero, system will remove leading zero.(01234 ==> 1234)
    Please help.

  • Leading zeros when loading file into BPS

    Hi all,
    i'm trying to load a flat file into BPS cube via sap GUI according to the indication of the correspondent "How to paper".
    As first column i have cost center (10 ch lenght). Usually in the File the leading zeros are not specified and in the paper it's specified to pay extra attention to those zeros.
    So the question is:
    HAVE i to include leading zeros in the file (for cost center)? Is it a mandatory task?
    Thanks in advance.
    Fabio

    Hi Anand,
    Is it possible to load Excel or CSV file into BPS using the standard function module ?
    If we use CSV format, then the leading zeros should be wiped out anyway.
    I tried both format. None of them working. Is only TXT format allowed ?
    Your help is much appreciated.
    Regards,
    Manish Jain

  • Display of leading zeroes when downloaded from ALV to excel

    Hi All,
    I have a problem in ALV grid display.
    There is a specific field which has value starting from '001' to '999'. This is a char(3) type of variable.
    The problem is that the display shows the value as '001' which is correct. but when the same file is dwnloaded to excel using standard SAP functionality, the value of the field gets changed to '1' instead of '001'.
    Is there any option by which this can be controlled. Please let me know, its urgent!!
    thanks

    hi Ankur,
    the Excel download is done by Z program? IF yes you have to do:
       SET PROPERTY OF go_cell 'NumberFormat' = '@'.
    this will set the Excel cell to Text type and leading zeros won't be lost.
    ec

  • Conditionnal Formating Data  with leading zeros

    Hi,
    I have a report which is displaying the name of CD's lile this:
    C2009-1
    C2008-257
    C2008-3456
    C2008-12984
    In the database, there is a column
    Type: C
    Year: 2008
    CDNum: 1
    How, when I'm displaying the report, it always return a 5 digits number, with zero before to have this output:
    C2009-00001
    C2008-00257
    C2008-03456
    C2008-12984
    thanks,
    Roseline
    Edited by: Roseline on Oct 1, 2009 8:58 PM
    Edited by: Roseline on 6 oct. 2009 08:50

    Thanks for your help.
    My boss ask me to show 4 digits if the year = 2008 or 2007 or 2006, etc
    and 5 digit if the year = 2009
    C2009-1
    C2008-257
    C2009-3456
    C2008-12984
    In the database, there is a column
    Type: C
    Year: 2008
    CDNum: 1
    SELECT type || year || '-' || LPAD(cdnum, 5, '0') *IF YEAR < 2009*
    FROM your_table
    or
    SELECT type || year || '-' || LPAD(cdnum, 5, '0') *IF YEAR = 2009*
    FROM your_tableSo basiccly, I need to insert an IF in my SQL statement, can I do that??
    thanks,
    ROseline
    Edited by: Roseline on 6 oct. 2009 08:45
    Edited by: Roseline on 6 oct. 2009 08:49

  • Data in Parked document in FB60 & FV60  data missing in FBV0 when displayed

    Hi Gurus
    In SAP, when creating a parked document, we entered payment method C and payment block - Invoice verification and saved the document as Completed
    When the document is viewed in FBV0, the payment method and payment block does not appear and have to be added again. 
    This happens in  FB60 &  FV60  in park mode where when you see in FBV0 to post  the data  is missing.
    But if you park it in F-63 it can be displayed in FBV0.
    I want to know why is it not reflectin when parked through FB60 & FV60.
    Thanks in Advance
    Vishwaas K

    Thanks
    I will see and get back to you
    Cheers
    Vishwaas K

Maybe you are looking for

  • I am having problems exporting to PDF using InDesign for Mac.

    Hi all! I just started using the Creative Suite on Mac and have run into a couple problems. One is that when I set up a document in InDesign using "Facing Pages" and then export to PDF, the document exports each set of "Facing Pages" as one singular

  • Tabular Material consumption with batch char info in PI Sheet

    Hi, I am currently creating PI sheet for blending in a mining company. We blend several coal with some grade to get the grade we obtain. coal with different grade maintain in different material with classification, not in batch classification In PI s

  • Are imac 5k (retina)  now supported fully in illustrator and photoshop ?

    i cant seem to find any clarification as to whether all issues with adobe products have been fixed and now imac retinas are now fully supported. many thanks ash

  • How to reduce size of a database

    Hi, i have inserted too much data in my database 9i Lite, i drop a lot of them but the size of my .odb do not change. How i can do to re-estimate the size of my .odb (it reaches 5 Mo that is too much for a pocket PC) thanx for any answers Arnaud.

  • Acrobat 8 suddenly asks for serial number, won't launch

    I have Acrobat Professional 8.1.3 as part of CS3 Design Premium, student license. Acrobat was not a separate disk. It was installed along with the rest of CS3 and always launched normally. Today, it requested the serial number and would not launch wi