Removing Default Zeros

Hi,
the UI-Element Table which I have created has in some fields default Zeros.
UI-Element Table is editable.
The current Contextname is ZHEAD. And there are 3 columns
affected e.g. MKG etc.
How can I remove those zeros.
Best regards
ertas ilhan

Hi,
You can use set_attribute_null( ) method to clear the input field.
Refer the code below:
DATA lo_el_context TYPE REF TO if_wd_context_element.
  DATA ls_context TYPE wd_this->element_context.
* get element via lead selection
  lo_el_context = wd_context->get_element( ).
** get single attribute
  lo_el_context->set_attribute_null(
    EXPORTING
      name =  `ABC` "ABC is the name of attribute that is binded to the input field.
You can use this code in wddoinit method to clear the input field in the table.
Or you can set the Display Leading Zero property of the attribute that is binded to the input field as Zeros as Blank.
I hope it helps.
Regards
Arjun
Edited by: Arjun Thakur on Apr 28, 2009 1:13 PM

Similar Messages

  • 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

  • Remove Leading zeros for Material in Transformation

    Hi Experts,
    I'm using DTP first time. I don't have much exp on DTP & Transformations.
    I'm creating infocube with some objects. I want to remove leading zeros for zmaterial.
    In 3.x writen update routines as fallows:
    data: zmat(18) type c.
    zmat = COMM_STRUCTURE-/BIC/ZMAT.
    shift zmat left deleting leading '0'.
    result value of the routine
      RESULT = zmat.
    I'm confusing in Transfermation where to write this routines.
    I'm writing in Transformation as fallows:
    data: zmat(18) type c.
    zmat = SOURCE_FIELDS-/BIC/ZMAT.
    shift zmat left deleting leading '0'.
    RESULT = zmat.
    But it's getting remove zero's.
    Anybody suggest on this.
    Siri

    Dear Sir,
    No confusion at all.
    Just double click on the Target Infoobjct i,e Material object in Transformation, you will see a wizard popping up.
    There you will see a option called "RULE TYPE" and the default value will be "Direct Assignment". In the same check box click on the drop down icon and select "Routine".
    The moment you select the routine option, it will open up ABAP workspace where in you can write your routine and get the desired result.
    Hope it helps.

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

  • Remove Decimal Zeros

    Hello,
    I managed to remove the default Zeros in the "Net_Price" and "Quantity" field by using the "Set_attribute_null" method.
    But, after entering the value into the field and clicking on the button to execute the BAPI, it is inserting decimal zeros again after the values. I want to remove this decimal zeros. Is there any way of doing this? I would greatly appreciate your help.
    Regards,
    Gopal.

    Hi Gopal ,
    there is a pretty print option for this . u cn  set special formatting properties using the context editor or the methods GET_ATTRIBUTE_FORMAT_PROPS and SET_ATTRIBUTE_FORMAT_PROPS of IF_WD_CONTEXT_NODE_INFO.
    the attribute formatting can be :
    1 Display leading zeros
    2 Position of the leading sign
    3 Input Compression
    4 Time output format
    u wud like to see more on the SAP online help :
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/3a/2232666aeb45f4b759848a4caf9c8b/content.htm
    regards,
    amit

  • How can I remove default alarm for events in iCal on devices ios?

    Whenever I add an event to my iCal calendar in Mounain Lion it will automatically add one default alert only on my iphone and ipad. These default alarms are not displayed on my macbook or icloud.com
    Default alarms are disabled in macbook, icloud.com, and my ios devices.
    How can I remove default alarm for events in iCal on devices ios?
    Thanks and sorry for my english.
    MacBook Pro, Mac OS X 10.8

    OK, so I have had this issue for the past several months. I think it all started when I upgraded to ML from SL and migrated my calendars and contacts to iCloud. That was a couple months ago. But now I am running 10.8.2, and about two weeks ago I upgraded my iOS devices to 6.0.1.
    I don't seem to be having any issues with events that I create now, but all those old events that were migrated to iCloud a couple months ago, many of those sound alerts on the iOS devices even though there was no alert defined when the event was originally created. I have always had alerts off by default both in iCal and on the iOS devices.
    So here's the question: is there a way to go through and disable all these spurious event alerts? I've been disabling them as the event reminders come up, but it's irritating. It would be nice if there was a way to turn them off all in one shot somehow.

  • Remove Leading Zeros

    Hi ,
    I am working on BW3.5
    One of my Info object ( Product ID ) is displaying the value aftre adding some number of zeros
    For Ex:
    When user enters PROD ID as 43013 ,its coming as 000000000043013 to datasource and and same is extracting to BW.
    Can anyone help me how can I remove these zeros in BW. My client wants to see just43013 in report.
    I have  searched forums and understand that i will have write routine. But I am not clear wt to do
    Thank you in advance
    Satya

    Hi Satya Vani
    You can check fofr the Alpha Conversion in two places. Check for the Box at Transfer Rules level. Secondly, Check the Edit Info Object screen if there is any conversion defined.
    Also do a check in R/3 what conversion routine is used by going to SE11. Give the domain name as the field name and then chk for the conversion routine.
    The conversion routine defined should be the same in R/3 and in BW.
    Hope this helps.
    Harika.

  • Getting the default zero-rated sales and purchase tax codes

    Hi,
    Does anyone know how to obtain the default zero-rated sales and purchase tax codes? ie the tax exempt sale and purchase tax codes.  The OADM holds the default sales and purchase tax codes but not the default zero-rated sales and purchase tax codes. Is this set by region?
    Lita

    Hi Lita,
    I don't know much about the zero rated tax codes or where it is set up, but what I can suggest is if you know where the system retrieves it (say on an Invoice) that you use SQL Profiler to possibly investigate where the queries are pulled from.
    Where in SBO is the zero-rated tax codes used?
    Hope it helps,
    Adele

  • Report Builder: output to Excel removes leading zeros

    I'm trying to use the Report Builder to output a numeric
    field to EXCEL , but on numbers that start with zero EXCEL removes
    the leading zero's. ex. 00123 becomes 123.
    Is there something that I can put in the expression builder
    on the field to overcome this.
    I've tried concatonating a single quote on the front of the
    field but the single quote shows up on the output. I've tried this
    on both the SQL and on the expression builder.
    I've read on some of the posts where people have tried using
    'mso-number-format:"\@'" within a TD tag but I can't seem to get
    the syntax right inside the Expression Builder.
    Has anybody got any suggestions?

    Excel will remove leading zeros in a numeric field because it is treating the column as numeric. Putting a ' in front of the number forces Excel to treat the column as text.

  • To remove leading zeroes and take directly from IDOC(Segment field) to file

    Hi SapAll.
    i have got a simple requirement in a idoc to file Interface.
    here in a sender Idoc there will be one segment with one field,the requirement is to remove leading zeroes and take directly the data from this field and map to one of the field in  reciever  file structure.
    i had used the formatnumber (under arithmatic functions)in PI 3.0 but now when iam using it in PI7.1 it was raising some jave exception error.
    it would be preferable if any body can give me the solution without user defined functions.
    regards.
    Varma.

    from your first post:
    i had used the formatnumber (under arithmatic functions)in PI 3.0 but now when iam using it in PI7.1 it was raising some jave exception error.
    use the same formatting that you used in 3.0 .... try with just a # in the FormatNum function.
    Regards,
    Abhishek.

  • Removing leading zeros in a column

    Hi,
    I would like to remove leading zeros of a column in a table. My Questions :
    1. Is it possible?
    2. Where is it better to truncate, in RFC or Web Dynpro?.
    3. If Possible, How can I do that.
    I appreciate your input.
    Thanks,
    Sunita.

    Hi Sunita,
           Please specify the datatype of the column that contains leading zeros, because if the data type of the column is integer then the leading zeros are automatically taken care.
    If your RFC return you int and you are assigning it to a String then the leading zeros will appear.
    For example, see the below simple ABAP Program. Just copy and execute it. You will see the difference.
    data: a type mara-matnr,
          str type string.
    select single matnr from mara into a.
    write a.
    str = a.
    write / str.
    Hope it helps you.
    Regards,
    Maheswaran.B
    Message was edited by: Maheswaran B

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

  • Removing Leading Zeroes in Location value

    HI Gurus,
    I am having some trouble in releasing demand plan to SNP. On the demand planning side, we are using standard characteristic 9ALOCATION for storing location values. When I release demand plan (using Location characteristic - 9ALOCATION) to SNP, I get a message saying 'Location 00000000000000003000 does not exist'. But, I have location '3000' assigned to the active model in APO system.
    I believe this issue is arising because, the system is storing leading zeroes in Location value '3000' on Demand Planning side. I know that there is customization setting (SPRO-> APO -> Master data -> Product -> specify output format) to prevent leading zeroes from being added to product number. But I don't see a similar setting for Location and moreover I am using 9ALOCATION and not 9ALOCNO.
    So, how can I remove leading zeroes in the values of 9ALOCATION.
    Any help/comments are appreciated.
    Thanks,
    Shiv.

    I found a solution to this problem. Unlike 9ALOCNO, Characteristic '9ALOCATION' has Alpha conversion routine. So this conversion routine fills up the leading zeros. I removed Alpha conversion routine from the 9ALOCATION in RSA1 and it works fine now.

  • 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 leading zeros in report

    Hi all,
    I do a clasical reoporting. Data in the internal table numeric types. But when writing in the report, is appearing as 000056 etc. I want to remove this leading zeros in the report output. Any helps?
    Regards,
    Mic.

    Hi Michael,
         u can use the function module for removing leading zeros
          CONVERSION_EXIT_ALPHA_INPUT (adding zeros)
          CONVERSION_EXIT_ALPHA_OUTPUT (removing zeros)
    Regards
    Nagesh

Maybe you are looking for

  • CDI not working in Weblogic 12c Embedded EJB Container?

    Hi, we are trying to use embedded ejb container from weblogic 12c (12.1.2.0) for our junit tests. As our application is running in weblogic 12c, we would like to run our tests  in same environment. But we encountered two problems, which brings me to

  • Can I export photo's from my MacBook Pro to My Ipad 2

    Can I export photo's from my MacBook Pro to My Ipad 2.

  • My Iphone 5 is stuck on the connect to itunes screen

    I was trying to do an update on  my iphone through itunes and it was all going through then it just  got stuck on the connect to itunes logo. It won't do anything. I've tried to hold the home and lock button and the apple logo appears then goes back

  • Can't Access Desktop & Screen Saver Preferences

    Hi everyone, Can't figure this one out!!! In the main System Preferences>Show All, the title of Desktop & Screen Saver icon has changed to "DesktopScreenEffectsPrefDock". It is all smashed together like that and partially overlays the "Appearance" ti

  • 3 cursors in Elements 9

    I am running Elements 9 on Windows 8.1 and all of a sudden I have 3 cursors joined together.  Does anyone have a clue how to resolve this?  I did see a link to another question about this and it was resolved by changing the text size but the instruct