Leading zeros and editing figures
Hello,
Just need the following on a query:
To get rid of 0unit or 0currency:
Quatity 14ST -> 14
Import 145,320US -> 145,320
To print leading zeros:
Item 10 -> 000010
Item 480 -> 000480
Item 10289 -> 010289
To print editing on figures and percentages:
145,320 -> $ 145, 320.00
6.69 -> 6.69%
Thanks in advanced.
Pejl,
You can take care of currency display as follows:
For ex: If you define a keyfigure "Discount" with Type :Amount and data type CURR-Currency field,stored
as DEC and under Currency tab select 0currency
for Unit/currency
Unit InfoObject (currency/unit)
This field describes which InfoObject has the unit key figure. For quantity key figures and amount key figures, either this field has to be filled, or there has to be a fixed currency or a quantity unit.
-Doodle
Similar Messages
-
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 and leading blank spaces from an input field
Hi All,
I have an input field which is alphanumeric and i need to remove the leading zeros and blank spaces in it , but intermediate spaces should be kept .
so i used the UDF
String output = input.replaceFirst("^0+","");
return output;
but this code does not remove the leading blank spaces . Can anybody help in modifying this code so that even the leading blank spaces along with leading zeros can be removed .
Regards ,
Loveena .lets say input is a
then
int len = a.length();
for(int i;i< length;i++)
if(a.substring(0,1).equals(" ") || a.substring(0,1).equals("0"))
a = a.substring(1,len);
return a;
hope you got the logic so that you can enhance it better -
Incoming calls get stripped of leading zeros and I don't know why...
Hi,
our UC560 setup is now running for quite some time. But there is still this one issue that is bugging for some time now.
We have two ISDN DID trunks for Incoming / Outgoing calls.
After my very basic setup I noticed that all caller IDs get their leading zero stripped. In Germany we use the "0" as first digit of the area-code and "00" as the international code.
I thought a quick fix would be to just add a Call-Back Rule within CCA to add a leading 0. This works for national calls as the transmitted caller-id always includes the area-code even for local calls.
However If I receive an international call (what happens quite often recently) I'm not getting the expected "00" in front of the number but also only a single "0".
I took a look at all translation-rules that are configured, but I couldn't find any rule that just deletes all leading zeros from the incoming number :( What's happening there?
voice translation-rule 4
rule 1 /301/ /55555529/
rule 2 /302/ /55555529/
rule 13 /^2\(..\)$/ /5555552\1/
rule 14 /^1\(..\)$/ /5555551\1/
rule 15 /^.*$/ /+49895555550/
voice translation-rule 5
rule 15 /^...$/ /123456/
voice translation-rule 7
rule 1 /555555201/ /201/
rule 2 /555555202/ /202/
rule 3 /555555203/ /203/
rule 4 /555555204/ /204/
rule 5 /555555205/ /205/
rule 6 /555555206/ /206/
rule 7 /555555207/ /207/
rule 8 /555555208/ /208/
rule 9 /555555209/ /209/
voice translation-rule 8
rule 1 /555555210/ /210/
rule 2 /555555211/ /211/
rule 3 /555555212/ /212/
rule 4 /555555213/ /213/
rule 5 /555555214/ /214/
rule 6 /555555215/ /215/
rule 7 /555555216/ /216/
rule 8 /555555217/ /217/
rule 9 /555555218/ /218/
rule 10 /555555219/ /219/
voice translation-rule 9
rule 1 /555555220/ /220/
rule 2 /555555221/ /221/
rule 3 /555555222/ /222/
rule 4 /555555223/ /223/
rule 5 /555555224/ /224/
rule 6 /555555225/ /225/
rule 7 /555555226/ /226/
rule 8 /555555227/ /227/
rule 9 /555555228/ /228/
rule 10 /555555229/ /229/
voice translation-rule 10
rule 1 /55555529/ /511/
voice translation-rule 12
rule 1 /55555504/ /112/
voice translation-rule 13
rule 1 /555555260/ /996/
voice translation-rule 14
rule 1 /55555501/ /444/
voice translation-rule 15
rule 1 /55555502/ /111/
voice translation-rule 18
rule 1 /555555200/ /444/
voice translation-rule 19
rule 1 /555555100/ /444/
voice translation-rule 20
rule 1 /55555500/ /444/
voice translation-rule 21
rule 1 /5555550/ /444/
voice translation-rule 23
rule 1 /555555110/ /110/
rule 2 /555555111/ /111/
rule 3 /555555112/ /112/
rule 4 /555555113/ /113/
rule 5 /555555114/ /114/
rule 6 /555555115/ /115/
rule 7 /555555116/ /116/
rule 8 /555555117/ /117/
rule 9 /555555118/ /118/
rule 10 /555555119/ /119/
voice translation-rule 24
rule 1 /555555120/ /120/
rule 2 /555555121/ /121/
rule 3 /555555122/ /122/
rule 4 /555555123/ /123/
rule 5 /555555124/ /124/
rule 6 /555555125/ /125/
rule 7 /555555126/ /126/
rule 8 /555555127/ /127/
rule 9 /555555128/ /128/
rule 10 /555555129/ /129/
voice translation-rule 25
rule 1 /555555130/ /130/
rule 2 /555555131/ /131/
rule 3 /555555132/ /132/
rule 4 /555555133/ /133/
rule 5 /555555134/ /134/
rule 6 /555555135/ /135/
rule 7 /555555136/ /136/
rule 8 /555555137/ /137/
rule 9 /555555138/ /138/
rule 10 /555555139/ /139/
voice translation-rule 26
rule 1 /555555140/ /140/
rule 2 /555555141/ /141/
rule 3 /555555142/ /142/
rule 4 /555555143/ /143/
rule 5 /555555144/ /144/
rule 6 /555555145/ /145/
rule 7 /555555146/ /146/
rule 8 /555555147/ /147/
rule 9 /555555148/ /148/
rule 10 /555555149/ /149/
voice translation-rule 27
rule 1 /555555150/ /150/
rule 2 /555555151/ /151/
rule 3 /555555152/ /152/
rule 4 /555555153/ /153/
rule 5 /555555154/ /154/
rule 6 /555555155/ /155/
rule 7 /555555156/ /156/
rule 8 /555555157/ /157/
rule 9 /555555158/ /158/
rule 10 /555555159/ /159/
voice translation-rule 28
rule 1 /555555160/ /160/
rule 2 /555555161/ /161/
rule 3 /555555162/ /162/
rule 4 /555555163/ /163/
rule 5 /555555164/ /164/
rule 6 /555555165/ /165/
rule 7 /555555166/ /166/
rule 8 /555555167/ /167/
rule 9 /555555168/ /168/
rule 10 /555555169/ /169/
voice translation-rule 29
rule 1 /555555170/ /170/
rule 2 /555555171/ /171/
rule 3 /555555172/ /172/
rule 4 /555555173/ /173/
rule 5 /555555174/ /174/
rule 6 /555555175/ /175/
rule 7 /555555176/ /176/
rule 8 /555555177/ /177/
rule 9 /555555178/ /178/
rule 10 /555555179/ /179/
voice translation-rule 30
rule 1 /555555180/ /180/
rule 2 /555555181/ /181/
rule 3 /555555182/ /182/
rule 4 /555555183/ /183/
rule 5 /555555184/ /184/
rule 6 /555555185/ /185/
rule 7 /555555186/ /186/
rule 8 /555555187/ /187/
rule 9 /555555188/ /188/
rule 10 /555555189/ /189/
voice translation-rule 31
rule 1 /555555190/ /190/
rule 2 /555555191/ /191/
rule 3 /555555192/ /192/
rule 4 /555555193/ /193/
rule 5 /555555194/ /194/
rule 6 /555555195/ /195/
rule 7 /555555196/ /196/
rule 8 /555555197/ /197/
rule 9 /555555198/ /198/
rule 10 /555555199/ /199/
voice translation-rule 1000
rule 1 /.*/ //
voice translation-rule 1112
rule 1 /^8/ //
voice translation-rule 2001
voice translation-rule 2002
rule 1 /^6/ //
rule 2 /^A/ //
voice translation-rule 2222
regards,
FabianI already figured it out myself - that was easy, if you know where to look...
voice translation-rule 3265
rule 1 /\(^.*$\)/ /0\1/ type national national
rule 2 /\(^.*$\)/ /00\1/ type international international -
How to remove leading zeros and leading blanks from numc
Hi experts,
i wanted to show personal number into my smartform..The field name is PERNR(8) which is of type N. But, in my smartform I get output as (000234)..if I use &pernr(Z)& leading zeros r removed but then the output is ( 234)..Now, I wanted to remove this leading space also...
please tell me the solution for this...
thanksHi Ujjwala,
You can use SHIFT.
DATA: V_CHAR(10) VALUE '00000'.
SHIFT V_CHAR LEFT DELETING LEADING '0'.
Regards,
Ramesh
*award the points if answer was helpful -
Remove leading zeros, divide by 1,000,000 and keep 2 decimals
I have a field named PLCOST which is a varchar(15) field. It has entries that look like this:
000000022410000
This entry represents $22.41
I want to convert the field to a decimal (10,2) type so it looks like this: 22.41
To do this I need to:
a) Remove the leading zeros
b) Convert the entry to a number
c) Divide the number by 1,000,000
d) Cast the result as a decimal (10,2) type
I know that this code will remove the leading zeros:
SUBSTRING(PLCOST, PATINDEX('%[^0 ]%', PLCOST + ' '), LEN(PLCOST))
But my effort to perform the other manipulations result in an error.
I tried this:
cast(convert(SUBSTRING(PLCOST, PATINDEX('%[^0 ]%', PLCOST + ' '), LEN(PLCOST))) /1000000 AS DECIMAL(10, 2))
But I get an incorrect syntax error at the first instance of 'PLCOST'. (Got this info from an error checking program).
Thanks for any help you can give with this.Actually this will work... Doing a replace on the zeros will kill any number that actually has a legit 0 in the value.
declare @col varchar(20)='000000022410000'
SELECT
CAST(CAST(@col AS INT) / 1000000.0 AS DECIMAL(10,2))
Casting to an INT handles the leading zeros and dividing by 1,000,000.0 allows the int to be divided and maintain the values after the decimal.
HTH,
Jason
Jason Long -
Export to Excel, VARCHAR2 DB Type and leading zeros issue
Oracle JHeadstart Release 11.1.1.2.29
We are using the Export to excel option, but when we have leading zeros it doesn't export it as text so the data is incorrect.
Can any one please tell how doe we configure ADF to have the leading zeros and export it as text rather than as number.
<af:commandMenuItem partialSubmit="true"
textAndAccessKey="#{nls['EXPORT']}"
icon="/jheadstart/images/excel.png"
immediate="true" id="cmi0">
<af:exportCollectionActionListener exportedId="IdLookupTab"
type="excelHTML"/>
</af:commandMenuItem>
Regards
Ramyou could add an apostrophe ' in front of all fields that you want exported as a text.
this will ensure no truncating is done.
it's excel that does the shifting, so you can't really interfere from the SAP side -
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 -
Remove leading zeros from string
I am working on a report and I am having a little issue with the output.
I have several dollar amount fields that I need to format with only the decimal place. The amount fields are coming in as strings between 10-16 characters.
I could not find a way to use the currency formatter so I used substrings to break it apart and put it back together in the format I need. However I am now running into an issue with leading zeros. I can't used ReplaceAll as there is a possibility of having a 0 in the amount field.
Here is what I have done for the substrings:
int intLength = strField.length();
intDollar = intLength - 2;
strDollar = strField.substring(1, intDollar);
strCent = strField.substring(intDollar, intLength);
System.out.println(strDollar + "." + strCent);The original string: 0000000037049469
My output now: 00000000370494.69
Desired output: 37049469
Any suggestions on how to remove the leading zeros?
Edited by: xxwhocaresxx on Jun 10, 2009 12:11 PM804350 wrote:
Just wanted to comment that I solved the issue differently by casting the string value to an integer and back. Don't know if it's bad solution performancewiseNever, ever, ever, ever, ever, ever, ever worry about performance. At least not until you're much further along the road; and even then not until you've proved that it's inadequate.
but it's quite compact and readable and did the job of eliminating leading zeros.I suspect you'll also find that it has the great advantage of providing you with a dollar (or cent) value that you can use elsewhere in your program the way it was intended.
example:
String noZeros = String.valueOf(Integer.parseInt(stringWithZeros));Or possibly even more usefully:
int cents = Integer.parseInt(stringWithZeros);
String noZeros = String.valueOf(cents);I'd also suggest looking up the NumberFormat and DecimalFormat classes, and PrintStream.printf(); all very useful for what you're trying to do.
Winston -
I am using Framemaker 8 - unstructured.
I have a requirement that the work packages/documents within a book contain an identifying number that begins with leading zeros and is four-digits long. This number also increments from one document to the next.
For example, first work package is '0001', next one is '0002', '0003', .... '0010', '0011', etc.
For the automatic incrementing, I am treating these work packages as chapters. However, I have not seen an automatic way to have the leading zeros.
I've come up with the following process:
First, I've created a text box on the master pages in which I entered 000 and then I insert the Chapter Number variable at the end. The tricky thing here is when I reach the tenth work package, the number on the master page has to change slightly to 00<$chapter number>. Note: I've tried also using the <n+> autonumbering scheme but this didn't work out as well as the chapter number variable.
I've looked briefly into using conditional text for automatically deciding when '000' or '00' is used, but have been unable to figure this out.
Any suggestions for something more automatic?You can fake this using paragraph autonumbering and create a tab leader where the "0" digit is used as the leader. Set a right-aligned tab position where you want the right-most digit of the id number to begin. You have to play around with position and font size to get it to look right.
-
HOW TO TRUNCATE LEADING ZEROS [ URGENT ]
A PROGRAM TO GET THE LENGTH OF THE SRVPOS [ SERVICE NUMBER]
BUT IN OUTPUT IT IS GIVING 12 LEADING ZEROS WHAT SHALL I DO TO REMOVE LEADING ZEROS AND TO GET THE LENGTH OF THE SRVPOS [ SERVICE NUMBER] AFTER REMOVING LEADING ZEROS
TABLES: ESLL.
DATA: BEGIN OF IT OCCURS 0,
SRVPOS LIKE ESLL-SRVPOS,
END OF IT.
DATA:LEN TYPE I VALUE 0,
IT1 TYPE I,
IT2 TYPE C VALUE 0,
N(15) VALUE'1000000000000'.
SELECT SRVPOS INTO IT FROM ESLL .
IT1 = IT MOD N.
IT2 = IT1.
LEN = STRLEN( IT2 ).
WRITE: / LEN,IT2.
ENDSELECT.Hi Shailendra
We can use SHIFT LEFT command in this case.
Eg: SHIFT LEFT <var> DELETING LEADING '0'.
or FM: CONVERSION_EXIT_ALPHA_INPUT
data: var(10) type c value '0000000123'.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
INPUT = var
IMPORTING
OUTPUT = var.
Kind Regards
Eswar
Message was edited by:
Eswar Rao Boddeti
Message was edited by:
Eswar Rao Boddeti -
Hi,
How to display leading zeroes for the numbers in the output?
can we use no edit-mask?
Thanks in advance,
Sowmya.Hi
use this FM
CONVERSION_EXIT_ALPHA_INPUT
to add the leading zeros and
use this FM
CONVERSION_EXIT_ALPHA_OUTPUT
to supress the leading zeros in display.
Regards,
kumar -
Want to hide/eliminate the leading Zeros in the Variable popup for0MATERIAL
I have a requirement where 0MATERIAL is having leading zeros and it has the MATN1 conversion routine in the production system.I want to only remove the leading zeros in the Variable popup in report for 0 MATERIAL witohut changing the definition of the object as it has too much production data to change.
Best Regards
TagoreHi,
You will have to write some code in F4 help BADI, please refer the sap note 1416952. And you can take help of following function module to remove leading zeros,
CONVERSION_EXIT_ALPHA_OUTPUT.
If above thing doesn't help then you will have to create virtual key figure.
Regards,
Durgesh. -
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/ -
Need formula to take text from one cell, add that to a serial number with leading zeros
I'm trying to create a spreasdheet cell that simplifies creating videotape Numbers from a job name in cell and appends a serial number with leading zeros, and that would survive an export to EXCEL.
The result would look like
A Column
Job Name
B ColumnTape #
Formula needed for B
ClientName-TapeType-
ClientName-TapeType-001
=
ClientName-TapeType-
ClientName-TapeType-002
=
I've tried using a custom cell format that had the text in front of the (Integer) drag and drop, with three integers and leading zeros.
That worked, but requires recreating the custom cell format for each client and tape type.
So, I've used the formula =A2& in order to play around with different things, but haven't hit on something that adjusts for increased numbers and retains the leading zeros.
I don't mind doing a starter for the first row and then adding +1 in the formulas for the rows below.
I've done that using the custom cell formats for the first B cell and then using =Bx+1 in the following cells. It works, but I'm hoping to find something simpler or that can be copied and pasted in multiple rows on one paste.
Thanks in advance.
Suggestions much appreciated!
TedTed,
This expression in B will give you the pattern I believe you are looking for:
=A&RIGHT("00"&ROW()-1, 3)
Here's a screen shot...
Jerry
Maybe you are looking for
-
Change Delivery date in Sales Order
Hi all I want to change Request Delivery Date in Sales Order. But when I changed Request Delivery Date system appear" The default date is not copied into existing schedule lines" And Delivery Date didn't change.Could you tell me how to change Deliver
-
How to dynamically populate a manager name and level for any user who login
Hi All, I need some help in doing this in my DB: Table 1 is the the manager hierarchy {which basically shows the structure of every employee's org). Table 2 is a list of all people manager ( all these usernames will also be in table 1). What i need t
-
CTR programs (Office 2013) and WSUS
I want to take issue with Microsoft on this inability to update Office 2013 using Windows Server Update Services. We purchase computers with Office 2013 pre-installed which features the click to run (CTR) version. While WSUS can download office 2013
-
Axis offsets and padding problems
I am having problems with getting my charts to draw as columns to the right of tick marks. Here is what the chart should look like: But here is what mine looks like in Flex: Below are snippets from my code to draw the chart in Actionscript. As you
-
Install, Match (X) or Copy, Merge all below and Copy all below
Hi, Can any one please tell me when can we use only "Install", combination of both "Install and Match (X) or Copy" and only "Match (X) or Copy" Indicatiors. And what is Match (x) or Copy, are they different from each other or they are one and same? i