Leading zeros in query results

Hi,
have created a query that shows as result a number that have leading zeros in database. In the qurey result these are not available. Is there any possiblity to see the laeding zeros in qurey result.
This numbers are defined as charakter value in the InfoObject (these numbers are similar to material numbers).
Can you help.
Many thanks.

Hello,
These leading zeroes are not came from Source system...
Due to Alpha conversion system has placed this zeroes to avoid conversion problems...
so while displaying it will remove all the leading zeroes and it will display.
Regards,
Pavan.

Similar Messages

  • Leading zeroes substring query in SQL Server

    Can Someone please help me in padding leading zeroes for the months in End date
    Example: actual data is like    6222007
    ,11301998 in end date column the following query works fine for 11301998 and converts it as 19981130 which was correct.
    But 6222007
    fails because month has no leading zero and it converts it as 0076222 which is wrong.
    How can i make it as 20070622 with the following code
    select (case when replace (ltrim(rtrim(ltrim([end date]))), '|', '') in ('99999999','00000000') then NULL 
        else substring ([END DATE],5,4)+SUBSTRING([END DATE],1,2)+SUBSTRING([END DATE],3,2) end) as ConvEnd_date
    from AdventureWorks.dbo.[AccountTable]

    Something like:
    declare @i int = 6222007
    select @i%10000 year_number, @i/1000000 month_number, (@i/10000)%100 day_number
    select DATEFROMPARTS(@i%10000,@i/1000000,(@i/10000)%100)
    David
    David http://blogs.msdn.com/b/dbrowne/

  • Removing Leading zeros from query output.

    Hello Experts,
    Is it possible to remove leading zeros from the query output for a particular column?
    I have a characteristics 'Reference Document' which has values like '000001386'. The users just need '1386' to be displayed and have asked us to remove the leading zeros.
    Is there something that can be done for this at a query level? I can't modify the underlying InfoProvider because this requirement is just for one set of users, the other users need the document nmber in the original format.
    Thanks
    Arvind

    Hi,
    you can use ALPHA conversion option in the definition of that particular characteristic.
    Try this code  in a routine.,in query designer;
    data a(9) value '000001386'.
    SHIFT a LEFT DELETING LEADING '0'.
    write:/ a.
    Output will be : 1386
    Or use this method also
    data a(9) value '000001386'.
    Call function 'CONVERSION_EXIT_ALPHA_OUTPUT'
    Exporting
    input = a
    Importing
    output = a.
    write a.
    output:
    1386
    Regards
    CSM Reddy

  • Selection without leading zeros in query

    Hi Gurus
    In report, we have defined variable for item no. 
    Is it possible to change the selection for a defined variable (item no.) not to require the leading zeros. Ex u2013 Instead of entering 000000123 , user enters only 123. Its very difficult to search when you are selecting specific item no.
    Thanks
    BIT

    Hi,
    Yep, the values in the cube will reflect in the query input screen, but I guess you need to drop and reload the data after the change, inorder to not reflect the old values.
    Check the below links for the reference:
    How to remove leading zero from Material Number
    Need to strip the leading ZERO using ABAP code.
    Remove Leading Zero
    Remove leading zeros
    Hope this helps...
    Rgs,
    Ravikanth.

  • Remove leading zeros in query

    Hi Gurus,
    I have a alpha routine in update rule which will add leading zeros in omaterial,but now I want to display 0material in the report without leading zeros. How to do this ?
    Thanks
    Liza

    Easiest thing is remove the conversion routine in 0material, if you dont want leading zeros.
    Or
    In update rules, use truncate statement to remove leading zeros.
    Ravi Thothadri

  • Remove the leading Zero from the Query output in SAP BW ?

    Hi
    Experts,
    Vendor Number loaded  as   (0000010076) from R/3 to SAP BW.
    How to remove  Prefix  of Zero for  the Vendor Number(0000010076)  from Quey outpt.
    Regards.
    ASIT

    Hi,
    Please check out this thread.
    Remove leading zeros
    Also check if there is any conversion routine used for that particular infoobject.
    If ALPHA conversion is selected for your infoobject then it will automatically take away the leading zeros at query level.
    Regards,
    AL
    Edited by: AL1112 on Sep 16, 2011 9:15 AM

  • Removing leading 0 in query designer

    Hi guys,
    I have a characteristic with values like '0000000123'. How can I remove the leading zeros in query designer?
    Thanks.

    u can do this in a routine.The code is as follows
    data a(9) value '000012345'.
    SHIFT a LEFT DELETING LEADING '0'.
    write:/ a.
    Output will be : 12345
    Or use this method also
    data a(9) value '000012345'.
    Call function 'CONVERSION_EXIT_ALPHA_OUTPUT'
    Exporting
    input = a
    Importing
    output = a.
    write a.
    output:
    12345.
    assign points if helpful

  • SQ01 - remove leading zeros at selection screen

    Hi,
    I have an infoSet with tables AUSP and CABN. When I create a query using this InfoSet, I need to enter leading zeroes in the field I'm using at the selection-screen (AUSP-ATWRT). I'm only after the last 6 digits as this is my material number. If I enter all the leading zeroes, the query works just fine, but for an end-user this is not very convenient.
    Does anybody know if this can be done in the query or in the InfoSet, or do I need some programming skills here?
    Thanks in advance:)
    Br,
    Lars
    Edited by: Lars Hesleskaug on Apr 14, 2010 11:38 AM

    Hi Lars,
    You have to create your own field in the Infoset converting the real one to numeric value, so the leading zeros will be removed. The search then will be working based on this new field.
    Regards,
    Eli

  • SQ01 ABAP Query - input field contains leading zeros

    Hi,
    I have a ABAP query where some of the values are stored with leading zeros in the table. This means that the user have to enter the leading zeros as well in the selection screen in SQ01 in order to get any output.
    What I would like to do is to restrict the input in the selection screen to allow only the digits without any leading zeros. For example, the user should not enter 000000000602590, but 602590. Also, the output should be without the leading zeros.
    Does anyone know how to do this in the InfoSet?
    Thanks in advance
    Br,
    Lars

    Hi Lars,
    The leading zeroes are appearing because your field is either a Numeric or Packed decimal.
    The leading zeroes can be suppressed if you  assign the packed to a Character field.
    You have option to change the datatype of the field in Infoset.
    Try converting it to equivalent character type.
    Let me know your findings.
    Thanks
    Ajay

  • 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.

  • How to remove pound symbol # and preserve leading zeros in BEx Query

    Hi,
    I have two questions regarding the display in BEx Query.
    1. How can I remove the pound symbol # for blanks in BEx Query?
    2. How can I preserve leading zeros? At the moment, value "001" will be displayed as "1". But I need the leading zeros.
    Thanks.
    Joon

    Hi ,
    You can apply these settings in Bex query designer.
    If you need to remove pound symbol jsut make a new formula and use NODIM function you will find this function under data functions.
    So NODIM(Your price keyfigure) this will remove the Pound symbol.
    For # just find out against which  characterstic you are getting # then go to default values panel there you will find all your characterstic which you are using in report---Rt click -Restrict-single valuesdirect input-#-Move to selection(That forward arrow)--select that # and choose exclude from selection (That red square icon).
    And yes for leading zeros check out this thread
    Leading zeros not displaying
    Hope it helps you.
    Regards,
    AL
    Edited by: AL1112 on Jun 9, 2011 1:43 PM
    Edited by: AL1112 on Jun 9, 2011 1:47 PM

  • Display Leading Zeros in bex query

    Hi,
    I am new to BI and need to display leading zeros in bex report.
    There is an info-object billing number which is of type CHAR. The values, 00001 - 00010 has been given in the CSV file.
    when i generate the same in IP, the leading zeros are mentioned, but the same is not appearing in the bex query.
    I have tried ALPHA conversion but this has no affect on the output.
    How to achieve the same??
    thanks in advance for the answers

    Hi,
    To answer your question in detail, there is a  conversion routine at infoobject level( Tab- general ), that determines how the values are displayed in the front end. For ex, alpha conversion routine takes away the leading zeros when you display the value in query. ( 0001 displayed as 1 )
    Assuming this is custom infoobject, I would suggest you to remove the conversion routine from the infoobject. This will help you in displaying leading zeros in the report.
    However, you have to ensure that all the values loaded for this infoobject is properly alpha converted ( packed with leading zeros ) by adding a field routine in the transformation. This will avoid same values getting stored with different internal formats like 01,001 etc.
    Hope this explains.
    Thanks.

  • Grep query - optional character, leading zeros & shortening words

    I have recently been taught (thanks to this forum) how to use Grep searches (wish I’d known about it years ago!). I still can’t get my head around some of the search strings - hoping someone can shed some light & explain what the components are doing so I can further utilise them?
    I have dates for a travel brochure, given to me sometimes separated by commas without the date (2, 3, 4, 5) & I need to put each date into its own cell in a table with the month next to them (with no space & going across left to right) + with a leading zero for single digits (02Jan /t 03Jan /t 04Jan /t 05Jan).
    How can I get it to add a leading zero for single digits & add the month to the last number that doesn’t have the comma (which I otherwise utilise in the search)? (The way I get it currently is  2Jan /t 3Jan /t 4Jan /t 5).
    I can’t seem to work out the optional character command.
    The other problem I have is that the months need to be shortened to just the first 3 digits & I’m not sure how to do that, either.
    Any light shed would be appreciated!
    Using current Indd on Mac.
    Message was edited by: Alleyna Lenton I have just found (through searching IndesignSecrets) how to do the optional comma: (\d+),?    ->    $1Mar\t  (although I'm not clear whether the '+' after '\d' represents more than 1 or any number of digits?) Just the other 2 probs I have - abbreviating words to first 3 characters & adding a zero to the front of single digits.

    Very good -- GREP is a useful tool to master! If you can't work out the last few things, do let us know. Make sure to list a couple of Before-After examples.
    The + after \d is indeed for "1 or more", that is, at least one and then as much as possible (I don't think there is a realistic upper limit). Contrast with * which is "zero or more" and ? for "none or exactly 1".
    Cutting off month names after the first 3 characters was asked not too long ago, but I cannot recall what the offered solution was. Try something like this:
    (?<=\bJan)uary
    (replace with nothing). The (?<=xxx) is a positive lookbehind: it will search the text "uary" and only match it if preceded by "Jan". By writing out all months in one long string, you can change all of them:
    (?<=\bJan)uary|(?<=\bFeb)ruary|(?<=\bMar)ch|(?<=\bApr)il
    ... etc., etc., where the vertical bar is an OR operator. (It's a bit long written in full, but remember you only have to write this GREP once and then you can save it.)

  • IR - Column with leading Zeros issue

    Hello,
    I've got an IR report which includes as "default report settings" 1 column with leading 0s. In order to export to Excel that column as text rather than as a numeric I followed a workaround proposed before in this forum (excel copy drops leading zeros
    In essence this workaround is to create an identifical column but in "excel text format" and display the columns depending on the request value: INSTR(NVL(:REQUEST,'YABBADABBADO'),'CSV') <> 0 for example.
    This works just fine for the default report.
    The problem arise when a user creates his own customise report that includes the mentioned column and saves it as a named report. Here, when the results are exported to excel the "excel" column does not appear.
    In fact, just hiding one of the displayed columns produces the same undesired result.
    I would appreciate any comments or suggestions.
    Many thanks
    Edited by: Javier Gil on Jul 20, 2010 7:52 AM

    I have found a better method. In your IR query:
    SELECT LPAD(v.vendor, 7, ' ') vendor,
    /*Just LPAD to a length of the column defined in the database table or to 7, whichever is greater. */
    FROM v, r
    WHERE v.VENDOR = r.VENDOR
    AND date_rcv <= to_date(:P150_CUTOFF,'yyyy/mm/dd')
    AND inv_nbr = ' '
    AND to_stores <> 'T'
    AND (V.VENDOR = RPAD(:P150_VENDOR,10,' ') OR :P150_VENDOR = 'ALL')
    When you download to Excel by Download/XLS (Request=XLS), it preserves the leading zeros.
    In the case of dates, you should LPAD 10 minimum in this format.
    LPAD(to_char(date_rcv,'MM/DD/YY'), 10, ' ') date_rcv,
    I haven’t tried it yet but I think in the case of ‘MM/DD/YYYY’, you should LPAD 12 minimum in this format.
    LPAD(to_char(date_rcv,'MM/DD/YYYY'), 12, ' ') date_rcv,
    Drawbacks of this method:
    Since the string has leading white spaces, you cannot use the filter for the ‘=’ comparison operator. Even filtering using leading white spaces will not return anything. You must use the LIKE and NOT LIKE operator instead.
    Advantages of this method over the original one I posted yesterday:
    1)     You do not have to create another column for download, just one column will suffice.
    2)     Even though the query has leading white spaces, they will not display in the IR region.
    Edited by: richardlee on Aug 5, 2010 11:10 AM
    Edited by: richardlee on Aug 5, 2010 11:16 AM

  • LEADING ZERO IN MONTH

    Hi,
    is there any possibility of adding leading zero for month column in query output without writing ABAP CODE.
    SDay for March ,instead of 3 i need 03 in qury o/p.
    Thanks,
    shaw

    Hi,
    is it possible that u mean to eleminate the leading "zero" of a KF text variable?
    If yes, u can do this with the following steps:
    1. Go to query designer -> select your text variable
    2. Edit variable -> replacement path
    3. Section Offset settings-> edit offset start and offset lenght
    I dont know how 0Month is displayed, but with these two u can define at which point u the offset starts and how many text digits u want to display.
    For ex. 0FISCPER is displayed 0012008 normally, if u set offset start as 2 and offset lenght as 5 the result is 12008
    Hope it helps
    Regards

Maybe you are looking for

  • Radio Buttons and Event Structures

    Guys, I am hoping for some help here on something I probably should know but cant figure out how to do.  I am using a set of radio buttons and an event structure to run a UI.  The radio buttons are acting as both a user input and indicator of current

  • Hacked account - Support team link does not work

    i'm posting this on behalf of my parents, as they don't speak english but their account has been hacked. They received notifications that their password, and email was changed, which they definitely didn't do. I followed the steps on Password reset,

  • Used space in tablespaces

    Hi, in 10g, any query to find total used space in tablespaces ? thank you.

  • 1 image repeated multi-times in rendering

    One InDesign document 30 pages. On Master Page, 1 image, a tiff. When I make a PDF how do I get it to render that one image rather than 30x making my final PDF a smaller document rather than a huge one.

  • Audio discussion tool. which platform?

    hello! i would like you to help me choose the "correct" development platform for a project, which starts soon. my "tool" should provide following functionality: - upload mp3-files to a specific directory on a web-server, which can be streamed later v