Removing Zeros from a quantity field in ALV

HI ,
i have req of removing the zeros after decimal point in while displaying in ALV.
e.g 3.000 --> '3' .
I do not need the decimal values.
Is there any FM or field catalogue parameter to control this.
I am using CL_GUI_ALV_GRID for ALV display.
Thaks.

Hi,
  Whay you can do is...
Copy the Quantity with out zeros into Char field and display.
Thanks & Regards,
Vamsi.

Similar Messages

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

  • Removing zeros from data stream

    Hi
    I have incoming data (plz see attached diagram which shows the 2 states of the for loop '0' and default) which is a 1-D array of 64 bit real data .....it goes through the loop which removes zeros from the array.
    As I have 3 elements in the 1-D array (call them x,y,z ), the loop works very well for all values of 'y' and 'z' .
    However when x gets towards 1 and below say 10e-3 (it never is a negative number), the loop is rounding everything to 1 and then when the value gets between 1 and 0 (10e-3 for example) the loop leaves it out altogether and I just get y,z  values saved.
    Plz help me sort this out .
    Cheers
    Baz
    Attachments:
    zeros.PNG ‏25 KB
    zeros.PNG ‏25 KB

    If you want a tolerance comparison, try the attached VI.  I rewrote it from one in vi.lib after an earlier post.
    This account is no longer active. Contact ShadesOfGray for current posts and information.
    Attachments:
    CheckForEquality(DBL).vi ‏23 KB

  • How to eliminate or remove zeros from 1D array

    How to eliminate or remove zeros from 1D array. Let say I have 1D array having foolowing elements
    "0 0 0 0 0 4 0 0 9 0 0 1 4 0 0 0 0 0 0 0 0 10 9 0 0"
    So after removing or eliminating zeros it will become as follow
    "4 9 1 4 10 9"
    So can any body guide me how can I do that? See attached Image for details.
    Thanks 
    JK

    altenbach a écrit :
    hchiam wrote:
    Here are 2 example .vi's I made based on altenbach's removeZeroes.png in this discussion thread: 
    It seems pretty pointless to post those because no new useful information is given.
    Currently, only the input is defined in the connector pane, making them useless as subVIs.
    unlike my example using integers, an "=0", like any "equal" comparison, is potentially dangerous with DBLs.
    Reshaping a 2D array to 1D before removing zeroes is pretty pointless because a 2D output cannot be recovered. A more interesting scenario would be to remove some columns or rows (e.g. that are all zeroes) from a 2D array.
    You should also clean up the front panel, e.g. properly zero the upper left corner, make the controls/indicators nicely labeled, sized and arranged, and maybe even add scrollbars to the arrays.
    Thank you for those comments.
    Now the input and output are defined (in the updated attachments) for use as example subVI's.  I also cleaned up a few visual details, but I leave the rest for others to cater to their specific uses if they don't want to use this as a subVI (or at least as-is), such as changing the icons or changing to integers instead of doubles.
    I'm not sure about what you mean exactly with "=0" being "potentially dangerous with DBLs".  I'm guessing you had a certain case scenario in mind.  Although the subVI's seem to work fine within my larger program and situation, my situation may not generalize with regards to this point.
    I reshaped from 2D to 1D, with a 1D output, because it could be helpful for things like when later processing just needs a 1D array.  For example, in my situation I had to remove a huge spike of unnecessary "0"'s from a previous subVI that were affecting the output display of a certain histogram.  So it turned out a 1D array output was helpful, and you never know what problems come up, so I included the 2nd example.
    Hopefully if someone is looking for this, they can just use or play with an example subVI (granted that they know how to plug things in for their context).  I was hoping to post a subVI people could put to direct use.

  • Remove zeros from right side

    Hi all,
    I want to remove zeros from right side.
    like : if value is '0.055500000000E+04'.
    then the output should be '0.0555'.
    How can i get such output.
    Plz help me....

    Hi,
    the problem here is u are dealing with a datatype of format F (i.e floating point ) and the output u desire is in packed format .
    You cannot delete the zeros of such data typesas type F instead u can move them to the packed datatype and get the result.
    do one thing declare a variable of type p and move the value of type f which u have right now to the variable u have declared as type p.
    data : v_val type p decimals 4.
    v_val  =  "               <------ assign the type f to type p over here .
    hope this helps .
    regards,
    vijay.

  • SQL*Loader sqlldr removes zeros from character field

    Hello,
    I am using SQL*Loader to load an Oracle table, and am having a problem. One of the fields is defined as VARCHAR2 and contains comments entered by a user. There may be numbers or dollar amounts included in this text. When I execute the sqlldr script below, the result is that all of the zeros on the text field disappear. There is a translate function invoked for this field (bolded statement) in an attempt to remove imbedded newlines from the text. Wherever there was a zero in the original text, it ends up being removed after I run this script. Can anyone suggest why this is occurring, and how to prevent it? Can it be related to the translate function?
    Thanks for your help!
    OPTIONS (READSIZE=20971520, BINDSIZE=20971520, ROWS=20000)
    LOAD DATA
    INFILE 'R24.REGION.ERL.N1E104' "str X'5E5E220A'"
    BADFILE 'LOGS/N1E104_BUT_RS_ASSGN_TXT_BADDATA.TXT'
    DISCARDFILE 'LOGS/N1E104_BUT_RS_ASSGN_TXT_DISCARDDATA.TXT'
    REPLACE
    INTO TABLE TESTM8.CONV_BUT_RS_ASSGN_TXT
    FIELDS TERMINATED BY '~' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    RST_RS_EXT_TXT_OID DECIMAL EXTERNAL,
    RST_RS_ASSGN_OID DECIMAL EXTERNAL NULLIF RST_RS_ASSGN_OID = 'NULL',
    RST_TXT_SEQ_NBR INTEGER EXTERNAL,
    RST_RS_COMM_OID DECIMAL EXTERNAL,
    RST_DIF_ASSGN_OID DECIMAL EXTERNAL NULLIF RST_DIF_ASSGN_OID = 'NULL',
    RST_EXTENDED_TXT "SUBSTR(TRANSLATE(:RST_EXTENDED_TXT, '#0x0A', '#'), 1, 248)"
    --------------------------------------------

    Never mind, found my mistake. In the TRANSLATE function, I had assumed that the 0x0A would be interpreted as a single hex value. Instead, it is interpreted literally as the character '0', the character 'x', the character 'A', etc. The result is that the transformed text had no '0', 'x', or 'A' characters, which is exactly what I inadvertently told it to do. I changed it to the following, which works better ;-)
    RST_EXTENDED_TXT "SUBSTR(TRANSLATE(:RST_EXTENDED_TXT, '#'||CHR(10), '#'), 1, 250)"

  • Removing leading zeros for the quantity field

    Hi all,
    In my script form there is a quantity field, of 13 and 3 decimals , on the out put its taking that much space un neccesarily,and messing up.
    how to make this adjustable in the provided space.
    It always 3 digits and 2 decimal points in our case.
    Please help me out,
    Thanks,
    Praveen

    Hi,
    For removing leading zeros
    &V_VARIABLE(Z)&
    Thanks,
    Naren

  • Quantity field in ALV

    Hello All,
          I am using OO - ALV in which I am displaying a quantity field.This field is an editable field and if user tries to change the value and SAVE , it is taking some wrong values.
    Say suppose I am having 1.000 as the initial value and if user changes it to 2.000 and saves it is converted to .002.
    I tried with qfieldname , ref_fieldname of fieldcat but of no use. Anything apart from this will be highly appreciated.
    Regards,
    Dhwani

    User might be changing the value to only 2 and you might have declared the fieldcat with 2-3 decimal places. If you enter value with decimals say 2.001 it will take.
    Otherwise you need to replace it with char value as Nanda has suggested.
    Hope it helps.
    Thanks,
    Jayant

  • Quantity field in ALV Grid

    I am using KWMENG data element in my ALV grid which is a quantity field. In normal dialog programming this field does not allows entering characters in editable cells. But in ALV grid I am not able to restrict it from entering characters.
    Eg: In VA01 if we try to enter any character "ABC...Z" then it wouldn't be typed in the screen. But when using the same data element in ALV grid iot allows to enter alphanumeric values. Since it's a quantity field so character value gives a short dump. I know I can restrict the dump by using "NA" in comparing string but I want to knw is there a way by which I restrict character field entry in alv grid, the same way this field works in VA01. I checked with a simple dialog prog and in that also it doesn not allows character typing in editable fields.

    simple solution
    mention the ref_fieldname and ref_tablename in the fieldcatalog for that column.
    ex:
    fieldcat-ref_fieldname = 'KWMENG'.
    fieldcat-ref_tablename = 'VBAP'.

  • Quantity field in alv display

    Hi all.
    we are phasing a  problem.
    I am using alv to display in output.
    I am using a Quantiti field (BDMNG),.
    in this field if nodata is there then it is showing 0.000(that is the default value).
    I don't want those zeros.I want only space(blank only).
    Can any body help me to solve this issue.
    Thanks in advance
    Eswar.

    Hai,
         While building field catalog For quantity field Set the NO-ZERO attribute to 'X'.
         Or you can change the quantity filed to character in the alv display.
    Mark points if helpful.
    Regards,
    Umasankar

  • Regarding Editable Quantity field in ALV Grid

    Hi Experts,
    I need your advice in this 2 scenarios.
    1.I have a scenario where quantity field in output is editable and the user wants the quantity field printed without thousand separator. If i take a char field and display the field is editable then user may mistakenly type a,bcd...z/ special characters which it should not capture. Is there any char data type data element which accepts only integers. Because after that i need to save that value in z database table quantity field.
    2. when there i raised an error message after validation of that editable field in alv output(by events), the user wants all other rows in that grid as uneditable except the row which has got error till this error is solved. Is this possible. If yes how.
    Please share your valuable suggestions.

    Hi abilash n      
    as in dictionary, all quantity fields should have a reference to the unit field which then defines the number of decimals.
    The rest is done automatically as long as you do it standard way. In field catalog you have to set the fcat-qfieldname to the name of the field that has the unit.
    If you do so, also totals will be grouped by unit.
    SAP has really done a great thing by inventing  units for quantities (and currency keys for currency amounts). Only developers do not understand and thus refuse to use it.
    Regards,
    Clemens

  • Group Quantity field in ALV GRID

    hi all,
        how to group the Quantity fileds in ALV grid output here fldcat-group = 'X' is not useful.
    ex : in my for a order qty column values are 10.00,10.00,10.00,10.00 for a given sales order then i have to display only one 10.00 instead of 4 times.
    any idea..?
    Regards
    Ashok P

    Hi Ashok,
          If can you check this using Onchange of in a loop statement.
    Regards,
    Prashanth

  • To Remove Zeros from a field

    Hi All,
    I have Material Number in my screen which is displayed as tree node in the tree control.In the display Material number comes with zeros i.e. if material number 1111 is there it is displayed with 000000000000001111 .It is displayed with 14 zeros and then material number.I want to nullify the 0s and just need the number to be  displayed .What should i do?
    Vijay

    There is a number of ways to do this.
    report zrich_0001.
    data: matnr type mara-matnr value '000000000000001111'.
    *  This is one way
    shift matnr left deleting leading '0'.
    * Here is another
    matnr = '000000000000001111'.
    call function 'CONVERSION_EXIT_MATN1_OUTPUT'
         exporting
              input  = matnr
         importing
              output = matnr.
    check sy-subrc = 0.
    Regards,
    Rich Heilman

  • How to removed leading zeros from a date field.

    CONVERT(NVARCHAR, CONVERT(DATETIME, CONVERT(CHAR(8), STM.CreationDate)), 101)
    This is what i currently have, but prints 02/03/2014 i would like to print the date without the zeros when applicable.
    Thanks in advance.

    >>REPLACE(LTRIM(REPLACE(CONVERT(NVARCHAR, CONVERT(DATETIME, CONVERT(CHAR(8), STM.CreationDate)), 101),'0', ' ')), ' ', '0')
    Does this query really works? I doubt
    Satheesh
    My Blog |
    How to ask questions in technical forum

  • Remove "zero" from word reports in nav 2015

    Hello Friends,
    I have a problem with reports made in Word nav 2015.
    When a texts is added to the salesline with no items or prices attached, the report generated in Word shows a "zero" at the end of the line for each field in the report.
    In the RDLC report builder there is a function BlankZero, how do you get this functionality in Word ?
    Hope you have some tricks to solve this issue :) 

    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

Maybe you are looking for