I want to remove Trailing zeros from a charecter value

Hello ,
          i want to remove trailing zeros for a prticular value.Following is my code :
DATA: V_FLOAT TYPE F VALUE '4.8240000000000000E+03',
           V_CHAR(25) ,
           P10_4(10) TYPE P DECIMALS 4.
CALL FUNCTION 'CEVA_CONVERT_FLOAT_TO_CHAR'
EXPORTING
FLOAT_IMP = V_FLOAT
FORMAT_IMP = P10_4
ROUND_IMP = ' '
IMPORTING
CHAR_EXP = V_CHAR.
SHIFT V_CHAR RIGHT DELETING TRAILING '0'.
WRITE : V_CHAR ."NO-ZERO.
<u><b>Output:</b></u>
if we pass the value '1.3000000000000000E+01' it should be 13.0
ex2: '1.3400000000000000E+01' it should be 13.4
ex3:'4.8240000000000000E+03' it should be 4824
is there any way to get the solution without functional module. If so Please tell me with code.

hi
u can do it in number of ways.
Use TCODE SU3
Select default tab and select radio button 123467.89 in decimal notation and save it.
or u can try :
if you want to do this through ABAP program.
1. to delete trailing spaces.
SHIFT <V_VARIABLE> RIGHT DELETING TRAILING '0'.
to delete leading zeroes,
SHIFT <VARIABLE_NAME> LEFT DELETING LEADING '0'.
only for one abap program, u can use set country command
for all programs :
sap menu>system->go to user profil->own data>default --> and choose ur format.
hope this helps u.
Regards,
Prasanth
Reward all hepful replies

Similar Messages

  • How to remove trailing zeros from a decimal (type) value?

    Hi Everyone,
    I would like to 'drop' some trailing zeros from a decimal value, e.g.: 50.000000, and I am wondering how to go about this?
    The value is definitely of decimal type, and in this instance I know that I want to eliminate exactly six (6) zeros.
    Any help here will be greatly appreciated.
    Kind Regards,
    David

    Try the below:
    This is sort of a display issue, you may do it at Application side, which would be efficient.
    Declare @s Decimal(10,6)='50.0000000'
    Select Cast(@s as decimal(10,0))

  • How to remove trailing zeros from a fraction part.

    How to remove trailing zeros from fraction part, need standard API rather then some java code.

    user8726363 wrote:
    How to remove trailing zeros from fraction part, need standard API rather then some java code.I'm pretty sure we have all gathered that English is not your first language, but your question is not a good question in any language.
    Back up. Take a deep breath.
    Now - what's your problem ?
    Please illustrate with results, and the code (just the class/method; not your entire application) that is causing them.
    Winston

  • Removing leading zeros from a string value

    Hi All,
    i have a Requirement like , i need remove leading zeros from a string value,
    like , 00Raj00Shekar==>Raj00shekar,
    how can i do this ?
    if it is only with the custom functions ,where can add the fuction in Jdeveloper and SOA Middle ware?
    Thanks in Advance,
    Raj

    Hi Raj,
    you can use below function to get the desired output in xsl.
    <xsl:value-of select='translate(oraext:left-trim(translate(<inpString>,"0"," "))," ","0")'/>
    HTH,
    Regards,
    Vikas Manchanda

  • Conversion routine to remove leading zeros from nonnumeric values.

    Hi,
    Can anybody tell me any conversion routine while can remove leading zeros from a character value.
    Eg : 
    input : asdfe
            output : 0000asdfe and vice versa
    I tried with Alpha conversion routine but that is useful only with numeric values.
    Please help.
    Regards,
    Deepti Jain.

    Hi,
    See the following program, and the same logic you can apply in Transfer Rules/Transformations. Take ABAPer help.
    REPORT  ZALPHA_INPUT.
    DATA: ZI(18) TYPE C,
          ZO(12) TYPE C.
    DATA: ZS(12) TYPE C,
          ZR(18) TYPE C.
          ZI = '000000099999889925'.
          ZS = '099999889925'.
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          INPUT         = ZI
       IMPORTING
         OUTPUT        = ZO.
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
        EXPORTING
          INPUT         = ZS
       IMPORTING
         OUTPUT        =  ZR  .
    Write:/   ZI.
    Write:/   ZO.
    Write:/   ZS.
    Write:/   ZR.
    Thanks
    Reddy

  • How to delete trailing zeros from a quantity field to display in ALV?

    Hi there,
    i am retrieving the field LGMNG from LIPS table, which is of type QUAN(13). All LGMNG values there are stored as
    1,000
    20,000
    50,000 etc.
    But i want my values to be displayed as
    1
    20
    50 etc.
    i have tried the " shift v_variable right deleting trailing '0'" but it does not work.
    also, if the value of LIPS_LGMNG =  0,000, i need those columns in ALV empty(that is no zeros or comma displayed)
    can anyone please help?
    Thanks a lot,
    Mee

    hi,
    use this it will solve your problem, just write down this on your Fieldcatalog.
       WA_FIELDCATALOG-FIELDNAME = 'VALUE7'.
       WA_FIELDCATALOG-SELTEXT_L = 'Contribution EE(due)'.
      WA_FIELDCATALOG-DATATYPE = 'INT2'.           " it will remove trailing zero
      WA_FIELDCATALOG-DECIMALS_OUT = 0.
       APPEND WA_FIELDCATALOG TO IT_FIELDCATALOG.
       CLEAR WA_FIELDCATALOG.

  • How to remove leading zero from Material Number

    Hello Everyone,
    I need to figure it out how to remove leading zero from material number. Cureently extractor is sending material number as 100663. But when comes into BI i am getting as "000000000000100663" and similariy in report it is appearing as "000000000000100663". Now my client wants me to exclude preceeding zero for a material in all the reports.
    Is there any setting in query desinger to handle this issure or in the backend.
    Need your inputs.
    Thanks,
    Lasya.

    Hi
    you can use the function Module
    CONVERSION_EXIT_ALPHA_OUTPUT in the start routine
    to test this go to SE37  --- give the CONVERSION_EXIT_ALPHA_OUTPUT -
    >display -
    > F8
    in the input give 000000456
    and execute
    the out put will be 456
    for getting Zeros you can use
    CONVERSION_EXIT_ALPHA_INPUT--- to remove leading zeros
    Santosh
    Edited by: Santhosh Nagaraj on Oct 29, 2009 10:52 PM
    Edited by: Santhosh Nagaraj on Oct 29, 2009 10:54 PM

  • How to remove Leading zeros from MATNR "at Database Level"

    Hi,
    When we create a material in MM01 , we can either create material as Internal Material No. or External Material No. (By Explicitly entering a material No.)
    Our requirement is that: When we create an Internal Material , there should NOT be any Leading Zeros in MATNR.
    and for External Material No.  , Leading Zeros Should be there.  (In Database)
    1) Now , we can create the No. Range for material in such a way that it will allow only AlphaNumeric entries for Internal Material , and Only Numeric Entries for External Material No.
    This should slove the Purpose.
    But According to the Client's requirement , Material No can be Numeric OR Alphanumeric for Internal As well as External Material No.
    2) We can Add or Remove leading zeros from MATNR at application level.  i.e.  we can find some BADI / Enhancement where we will Use the Conversion FM (CONVERSION_EXIT_MATN1_OUTPUT or  CONVERSION_EXIT_ALPHA_OUTPUT) and remove Leading Zeros from MATNR. But these changes will NOT reflect at Database Level , Because in MATNR Domain , there is a conversion Routine  , That will Add Leading Zeros in MATNR While saving in the Database.
    3) While Displaying the Material In SE11 , we can also set the "Display Format" as With leading Zeros OR Without Leading Zeros.
    But we dont want to Just "Display" material with OR Without Leading Zeros.  we want to actually create materials in that way.
    What can we do , so that at Database Level our changes are Reflected.
    Thanks and Regards,
    Anand Gore
    Edited by: anandgore on May 18, 2011 3:47 PM

    That will Add Leading Zeros in MATNR While saving in the Database.
    That is because you have it configured that way.  You can configure the storage as you desire.  The default is the behavior you are describing.  You, or your functional analyst, need to review the documentation on the MM config settings for material master number storage.
    Never use CONVERSION_EXIT_ALPHA_OUTPUT for material conversion.  Also keep in mind that the MATN1 functions have their own BADI for extended formatting...

  • How to remove leading zeros from variable

    hi,
       how to remove leading zeros from variable like it_vbap-matnr.
    value in it_vbap-matnr is 000000000000000358
    i want to remove leading zeros so that it become 358
    regards
    deepak

    You can use Function Module <b>'CONVERSION_EXIT_MATN1_OUTPUT'</b>
    This Function Module will eliminate leading Zeros.
    For each MATNR Value read form DB Table,u can eliminate Leading zeros and then modify ur Internal table.
    I think u will not get leading Zeros into utr Internal table when u read from VBAP.
    Bcoz MATNR in VBAP itself have Conversion routine.
    If u r getting leading zeros,U can use following Logic.
    tables:
      vbap.
    data:
       t_vbap like standard table of vbap.
    select matnr
    from vbap
    into corresponding fields of table t_vbap.
    loop at t_vbap into vbap.
      CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT'
          EXPORTING
            INPUT         =  vbap-matnr
          IMPORTING
            OUTPUT        =  vbap-matnr
      modify t_vbap from vbap transporting matnr.
    endloop.
    Hope this will work.....

  • Remove leading Zeros from the mapped context node(Table)

    HI,
    I have he following requirement:
    In the Leave approval application , in the Approver worklist we have the coloumn to display the resuqester's Perner.
    The perner starts with leading zeros. We have to remove these leading zeros.
    I have refer the following threads:
    Removing leading zeros in a column
    How to remove leading zeroes of string
    and wiki document:
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/java/remove%252bleading%252band%252btrailing%252bzeros%252bfrom%252ba%252bstring
    but I am not able to create the calculated attribute in the Mapped Node( NWDS is not allowing indicating it is not allowed for mapped nodes.)
    Any pointer how I can remove leading Zeros from existing column?
    If I create the calculated attribute outside the mapped node then it is taking only the first value of the mapped node.
    Please note we do not want to modify the RFC.
    _vishal

    Hi,
    Thanks for inputs,
    Now I created a test application where the original structure is as follows in the View Controller:
    1) Context -> Z_Portal_Test_Input (mapped Node/folder) -> IT_Tab_Input(mapped Node/folder) -> Eid(Mapped attribute)
    note: this attribute Eid has the values (01, 02,03,04,05)
    2)Context -> Z_Portal_Test_Input (mapped Node/folder) -> Output(mapped Node/folder) ->IT_Tab_Input(mapped Node/folder) -> Eid(Mapped attribute)
    Now as per your suggestion I created another node like this
    Context -> Z_Portal_Test_Input (mapped Node/folder) ->testnode(value node) ->testValue(value attribute)
    testnode cardinality is 1..1 and singlton = false
    In the Layout
    The tablecell editor  of one coloumn is mapped to text     Z_Portal_Test_Input.testnode.testvalue
    It is expected that this will show the values like(1,2,3,4,5) but it is showing value(1,1,1,1,1)
    The code of get method is:
      public java.lang.String getTestnodeTestvalue(IPrivateTestpernerView.ITestnodeElement element)
        //@@begin getTestnodeTestvalue(IPrivateTestpernerView.ITestnodeElement)
          String  msg =wdContext.nodeZ_Portal_Test_Input().nodeOutput().nodeIt_Itab().currentIt_ItabElement().getEid();
            return removeLeadingZeroes(msg);
        //@@end
    the functon removeLeadingZeroes(msg) is implemented as per the wiki link.
    What wrong I am doing/ missing....
    _vishal

  • Formula in transformation file to remove trailing zeroes,BPC 7.5 NW

    Hi Experts,
    I have implemented automation of master data from BW info object to BPC dimension.
    I have few issues with the transformation file. employee percentage in BW is of type number and has lenght of 17.
    In BW 0EMPLPCT holds the value as 100,000 , 75,000  but when i send to BPC dimension the values are sent as 100,00000
    Emp percentage is maintained as below in the transformation  file.
    EMP_PC=0EMPLPCT
    However i wanted to remove the zeroes in BPC , i wanted to see the numbers as 100, 75, 50 and so on.
    Is there any way i can handle this in transofrmation file. Please let me know as this is really urgent. Thanks much.
    Regards,
    Sanjeev

    Hi,
    The properties in BPC are stored as string. So, you will have to convert it to string while loading. Secondly, it will be really difficult to use this percentage value in any script logic; since it is stored as string.

  • I want to remove the monitor from my 17" Macbook Pro 2008 to use as an external for my Macbook Pro 15" 2012. How can I convert lvds to Thunderbolt and power the monitor?

    I want to remove the monitor from my 17" Macbook Pro 2008 to use as an external for my Macbook Pro 15" 2012. How can I convert lvds to Thunderbolt and power the monitor?

    It's almost impossible.  The new iMacs have a Target Display Mode, but it's built to do that.  Without ripping your screen out, finding an acceptable power supply, frame, and whatever electronics to convert a Thunderbolt signal to the screen, the cost will be much larger than buying a cheaper HiDef monitor that runs with an HDMI to Thunderbolt cable to your MacBook 15.  In fact, you can sell your 17" MBP for a lot of money, unless it's broken or something, buying you a really sweet monitor.
    By the way, I found your answer by searching this forum.  I would suggest using the search function here in the futuere.

  • How can i see the "manage devices" in my itunes account? because i want to remove a device from using my apple id. tnx so much

    how can i see the "manage devices" in my itunes account? because i want to remove a device from using my apple id. tnx so much

    Thanks pvonk, I will try downloanding the book from the Iphone right now.......
    Just tried to download and it wants me to buy it again?  Is there some way around this?  I guess I thought that was the whole point of the cloud, buy it once and access from any of your devices right?
    Also, I have logged into the icloud.com as suggested and will plink around there for a bit and try to understand.  It is just all so dang different that what I am used to; Apple's way, that is.
    Thanks again for the Icloud tip and if you know of a way to download without making a 2nd purchase I would sure love to hear it!
    Geez. one other thing (I guess I am complaining) but I bought more space in the cloud, they took my cash fast enough but have not yet increase the size of my storage space yet?  Is Apple sometimes slow to get internal stuff done?

  • I keep all of my music on my iPod Classic. I inadvertently changed the sync setting on my iPhone 5 to sync the music with my phone. I am overcapacity and want to remove the music from my phone. How do I do that?

    I keep all of my music on my iPod Classic. In error, I changed the sync setting on my iPhone 5 to sync the music with my phone. I am overcapacity on my phone and don't want any music on my phone so I want to remove the music from my phone without disturbing my iTune music files on my PC and iPod. How do I do that?

    On your phone: Settings>General>Usage>Music...tap the Edit button...then the red minus sign. This will delete all music on your phone.

  • When I try to sync photos, I followed all the steps, picked one folder.  When I hit "apply" I get this error message: Are you sure you want to remove 30 apps from iPad.  This will delete these apps and their data from the iPad. What have I done wrong

    When I try to sync photos or music, I followed all the steps, picked onle folder, not the whole library.  When I hit "apply" I got this message:
    Are you sure you want to remove 30 apps from iPad.  This will delete these apps and their data from the iPad" What can I change to just download the photos and not interfere with the apps?
    (By the way, the memory is not even one quarter full)
    Thanks for your help - Pat

    I have the same problem.  I updated my mac to 10.5, which then had me update apps like itunes, etc. then it wanted me to sync my purchased music to my ipad before i updated the ipad...which worked ok. then when i was syncing the photos i got the same message when i hit "apply" asking are you sure you want to delete the 12 apps from the ipad -  clicked "no" and brought me back to the original screen. Got the same message when trying to move them from the hard drive to the ipad.  WHat is going on and how do I correct this? Thanks

Maybe you are looking for

  • Can my iPhone 5 be hacked through a free app downloaded from the App store?

    I updated my phone to iOS 6.1.3 today. This evening (two hours ago) I downloaded a free app called "Caption Pics" by Viral Media Entertainment. About 15 minutes ago, something weird happened. I had 6 apps that the App Store wanted to update. I went t

  • How to do an initial replication from R/3 to SRM 6.0?

    Hello everyone, We are working in a implementation of SRM with R/3. My question is about how I can replicate the existing information in R/3 (PR, PO, Invoices, etc) to SRM (as an initial replication). Especially, I wonder if the documents that are in

  • Dummy G/L a/c

    Hi, hi, 1. Can any one please explain me “At the time of transactional data uploading do we need to create dummy G/L a/c”. What is dummy G/L a/c. 2. If yes how many dummy G/L a/c do need to create. 3. Please provide me what are all prerequisites for

  • Web browser launched from B1

    hey All, I have done a nice bit of research on the topic of opening a web browser via the UI API in the B1 client. I cannot seem to find any examples or working code to do this. Yes there are samples of active x controls but none of them ever seem to

  • Deleting a contact that I've already deleted but still appears when I attempt to compose a text message

    I've deleted several contacts from my contacts. However, when I go to compose a text message, and I enter the name(s) of the contacts I just deleted, their names and numbers still come up. How do I permanently delete a contact?