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
Similar Messages
-
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)" -
How can we remove the following zeros from quantity field ?
Hi All.
how can we remove the following zeros from quantity field while populating ALV by using FM REUSE_ALV_GRID_DISPLAY ?
eg:getting output zqty = 2.000
but i need zqty = 2.
help me to reslove this issue.
Regards.
jayHi,
While populating the field catlog do the following thing to avoid zeros.
wa_fieldcat-tabname = 'I_OUTPUT'. " Curr
wa_fieldcat-fieldname = 'FWAER'.
wa_fieldcat-seltext_l = text-023.
wa_fieldcat-no_zero = 'X'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
Thanks,
Khushbu. -
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 KBIf 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
JKaltenbach 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. -
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. -
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. -
Import script to remove zeros in Account field
Dear FDM Experts,
The problem is our source system always extracts 10 characters but we use 7 characters in HFM.
Example, Account 0001201010 (10 characters) must be 1201010 (7 characters).
I want to write an Import Script to remove, if any, all zeros from the left side of the account value at the import stage. We have no Accounts beginning with 0.
Thanks in advance for your help,
CarstenThanks! But I got an error message:
** Begin FDM Runtime Error Log Entry [2012-04-17-13:24:10] **
ERROR:
Code............................................. 13
Description...................................... Type mismatch: 'FormatNumber'
At line: 14
Procedure........................................ clsImpProcessMgr.fLoadAndProcessFile
Component........................................ upsWObjectsDM
Version.......................................... 1111
Thread........................................... 2164
Could you provide me with the full script? -
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 -
Hi Diadem experts!
I am trying to concote a script that basically does exactly what the ChnNovHandle function does. ChnNovHandle removes NoValue numbers from a channel, optionally with multiple channels. I want to use this function, except that I have zeros instead of NaNs. Any suggestions? Much appreciated!
Aart-Jan
Message Edited by aartjan on 01-15-2008 05:41 PMHello Art-Jan!
The solution is to convert your zeros to NOVALUEs. Therefore you can use the DIAdem behavior that the result of an undefined mathematical operation NOVALUE is. If you use this line of code the zeors will be converted to NOVALUE:
Call FormulaCalc("Ch('Output') := 1 / (1 / Ch('Input'))")
Matthias
Matthias Alleweldt
Project Engineer / Projektingenieur
Twigeater? -
Removing Zeros from Packed with decimals value
Declaration is as follows: var1(3) type p decimals 1
i am passing value from database var1 value is 10.0
In the above case i want to remove decimal value 0 in 10.0 if var1 value is 10.50 then my required value is 10.5 only.
var1 is not used in clasical reports.
I would like to export the variable var1 into smartforms and print.try this code and adopt it according to your needs:
DATA:
gv_p_init TYPE p DECIMALS 2 VALUE '10.1',
gv_dec_separator TYPE char1,
gv_tmp1 TYPE char1024,
gv_len_dec TYPE i,
gv_tmp2 TYPE char1024,
gr_dref TYPE REF TO data,
gr_datadescr TYPE REF TO cl_abap_datadescr.
FIELD-SYMBOLS:
<gv_new_p> TYPE p.
* determine user specific decimal separator
PERFORM get_dec_separator
CHANGING gv_dec_separator.
WRITE gv_p_init TO gv_tmp1.
SEARCH gv_tmp1 FOR gv_dec_separator.
* create new anonymous data object -> GR_DREF of type P with same length
* as GV_P_INIT and decimals depending on relevant decimals of GV_P_INIT
IF sy-subrc EQ 0.
MOVE gv_tmp1+sy-fdpos TO gv_tmp2.
SHIFT gv_tmp2 LEFT DELETING LEADING gv_dec_separator.
SHIFT gv_tmp2 RIGHT DELETING TRAILING space.
SHIFT gv_tmp2 RIGHT DELETING TRAILING '0'.
SHIFT gv_tmp2 LEFT DELETING LEADING space.
gv_len_dec = STRLEN( gv_tmp2 ).
gr_datadescr ?= cl_abap_datadescr=>describe_by_data( gv_p_init ).
gr_datadescr ?= cl_abap_elemdescr=>get_p(
p_decimals = gv_len_dec
p_length = gr_datadescr->length ).
CREATE DATA gr_dref TYPE HANDLE gr_datadescr.
ASSIGN gr_dref->* TO <gv_new_p>.
MOVE gv_p_init TO <gv_new_p>.
WRITE: / gv_p_init,
/ <gv_new_p>.
ENDIF.
FORM get_dec_separator
CHANGING cv_sep TYPE char1.
DATA:
lv_one_thousand TYPE i VALUE 1000,
lv_tmp TYPE char20.
WRITE lv_one_thousand TO lv_tmp.
IF lv_tmp CA '.'.
MOVE ',' TO cv_sep.
ELSE. "IF lv_tmp CA '.'
MOVE '.' TO cv_sep.
ENDIF. "IF lv_tmp CA '.'
ENDFORM. "FORM get_dec_separator
reward points if helpful -
GroupWise8 crashes when removing sender from "TO" field
Hi guys,
A user is having GroupWise crash when they go to remove a contact from the "To:" field while composing an email.
The Event viewer ID:1000 states: Faulting application name: grpwise.exe, version: 8.0.3.21995, time stamp: 0x4fda7d4c
Faulting module name: gwabu1.dll, version: 8.0.3.21995, time stamp: 0x4fda7938
Exception code: 0xc0000005
Fault offset: 0x0005eecb
Faulting process id: 0xa14
Faulting application start time: 0x01ce4fec1ff44bec
Faulting application path: C:\Program Files (x86)\Novell\GroupWise\grpwise.exe
Faulting module path: C:\Program Files (x86)\Novell\GroupWise\gwabu1.dll
Report Id: 01b72261-bbed-11e2-a47b-180373dcb5bf
Thanks!Hi
DEP and GroupWise do not play nicely together. I would recommend that you turn it off.
Cheers, -
Permanently removing Yahoo from search field
Since the last upgrade I believe, I cannot remove the Yahoo search from my search field. Yes, I can temporarily remove it by selecting the manage search engines, but everytime I restart FF it reappears. Can you please tell me how to get rid of this forever! there is no Yahoo tool bar as many have suggested, just the search field. thank you kindly for any assistance. Someonezmom
See http://kb.mozillazine.org/Search_Bar#Removing_search_engines
-
Best Practice for Removing Zeroes from Database
Does anyone have some clever bits of code or best practices for evaluating a database and instances of zeroes? I'm working on cleaning up our rules file and am thinking the best way to start would be to write some code to look for zeroes and write them to a log file. This would at least indicate if there was even a problem with zeroes (which there may or may not be).
Any suggestions out there / utilities / code samples?
Thanks.We accomplished this using data extracts from a subset of scenarios/years/entities/accounts to ensure that all of our potential rules could be checked to ensure they were not writting zero's. This worked pretty well for our purposes, a text editor called EmEditor allows for VB macros in it pretty easily and we could write a quick macro to check for strings ending in "; 0." You may also want to review your check box of calculated in your extract and see if the zeros are a result of calculations. A rule output could work pretty well, although it would take some defining as you would have to write it out in a sub and make sure that you capture the data of all subroutines if your zero's are rule driven or actual inputs. May want to review some if you have very small insignificant values getting written, seen items that have one value 13 places to the right of the decimal that were not really signficant.
JTF -
i have a field in a table that stores the email address; this field is manually populated, so almost anything can be put into it; the field is 100 characters long;
one one particular record, someone entered:
"[email protected] [email protected]" into the email address; yes, that is the email address, some spaces and then the email address again;
i have a select statement that gets the first 50 characters of the email address -- "select substr(email_addr,1,50) from employee;"
so what i'm getting is "[email protected] johnathan.washingto", when all i want is "[email protected]";
So what function or trick can i use to get all characters in the email address up to but not including the first space? I thought translate or decode could do it, but i haven't figured it out yet.This forum is for using the "SQL Developer" tool rather than general SQL questions (which is what the "SQL and PL/SQL" forum is for). However, to get what you want, try:
select decode(instr(email_addr, ' '), 0, email_addr, substr(email_addr, 1, instr(email_addr, ' ') - 1)) from employee;
This should work for both where there is a space and where there isn't a space.
theFurryOne
Maybe you are looking for
-
How to find the short url of an iview
Hi, Please help me in <b>finding the short url of an iview</b> i went to system administration-navigation-short url but unable to find the short url of the iview which i created. please help me in solving this issue. thanks bala
-
Reader on Mac OS 10.6.2 search fails sometimes
Hi there, sometimes when I use Adobe Reader (latest) on my Mac (OSX 10.6.2) the PDF search fails. I.e., a search for "statt dessen" shows up things like "dieser" or "was". The results have nothing to deo with my search term. Is it a common failure on
-
Java issue in 10.5?
I can't figure out for the life of me why Java is not rendering an applet correctly for me. I'm trying to run FOREX.com's java trading platform. It renders ok on an older imac 17" running 10.4.1, but when i try to run it on my MBP 15" (same screen re
-
Hi, While I am trying to create a production order for a material (Header), I am encountering the following error: 'A Valid bill of material could not be found for the material XXXXX' I am getting this error for 4 materials (Item), out of which 3 mat
-
I was having trouble with audio ads. So I deleted the svchost.ext file. but I then suspended the Dcom file associated to it. Because of all of this, my computer will not boot up into windows. I can get into safe mode but that won't start up into wind