How to pad zeros at the left?
Hi All,
I have requirement where
Input is 1234
and Output should be :-0000001234(6 Zeros at left).
Please let me knw how to do it.
Thanks,
Suraj
hi Suraj,
If you are sure its should be always prefixed with 6 zeros then u can use above mentioned method.
But if you are not sure about the input string lenghth than below udf will help.
s = "000000".substring(s.length()) + s;
where s= input value which is 1234 in ur example given.
hope this solves your problem.
thanks and regards,
Praveen T
Similar Messages
-
A query on removing additionally padded zeroes from the pernr.
Hi ,
How can i remove the padded zeroes from the pernr, Ex pernr is 8 chars and if pernr has 6 chars it has to remove appended 2 zeroes from the left and should only print the 6 chars with no appended zeroes
ThanksHi Khaleel,
Use FM <b>CONVERSION_EXIT_ALPHA_OUTPUT</b>
Reward if useful.
Thanks
Aneesh. -
How do I pull up the left control panel that allows you to move from text to moving objects on page?
Do you mean this one:
If so, go to the Window menu and make sure that Tools is checked. -
Add zeros on the left in a string of characters
Hi,
I'd like to add zeros on the left in a string of characters. Example:
Char10: 8572 ---> Char10: 0000008572
I'd like to know if there's a standard instruction for this, or a quick way to do it.
Thanks in advance,
GerardTry this
*& Report YCHATEST *
REPORT YCHATEST .
data : l_char(10) value '8275'.
write : / l_char.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = l_char
IMPORTING
OUTPUT = l_char
write : / l_char.
Message was edited by: Sekhar -
How to display zero in the screen's input field using numc type
Hi,
I want to display the zero value in the input field , when I using the NUMC input field on the screen .
The zero will be changed to blank ,when I click the Enter key.
What I should do for it?
Any help is appreciated.
Regards,
TrevorHi ,
Thanks for your quickly answer!
I use the numc input field in the dialog's screen.
I am not sure how to do the realize the function like 'UNPACK'?
In fact, I can't changed my input field's data type.
When the status of my input field is display, I can display the zero on the screen. But when the input field is input status , there is blank!
Regards
Trevor -
How to hide zeroes in the output
I need to suppress zeroes in the output. I have a Data template which selects the data from a view. The original view fields are showing 0's if the underlying value is null.( eg. create view v1 as select nvl(field1,0),nvl(field2,0)... from table1
I tried the following ways to fix the issue. But no success.
1. Changed the view and removed the NVL function on the view
create view v1 as select field1,field2,... from table1
After this the xml output is generated and shows nulls for these fields. But OPP is failing with 'Cannot convert to number' Here is the snapshot of the error.
Caused by: oracle.xdo.parser.v2.XPathException: Cannot convert to number.
at oracle.xdo.parser.v2.XSLStylesheet.flushErrors(XSLStylesheet.java:1526)
at oracle.xdo.parser.v2.XSLStylesheet.execute(XSLStylesheet.java:517)
at oracle.xdo.parser.v2.XSLStylesheet.execute(XSLStylesheet.java:485)
at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:264)
at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:150)
at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:187)
... 17 more
2. Using the xpath expression
<?format-number(field1[.!=0],"####", "")?>
This way I am seeing a square symbol for the fields having zeroes
I am sure there will be simpler way of hiding zeroes in the output. But I am not getting any clues. Any ideas.
ThanksHi,
I may have misunderstood something. In the option 1 you mention that by removing the nvl you were getting nulls?
If you are getting zeros then you should be able to use <?if:field1!=0?>...<?end if?>. It's possible you might need to put '0' around the value if it thinks it is text.
Also I'm not sure your format-number syntax is correct. It looks like you are mixing the Oracle formatting and the Microsoft formatting (ie when you set the form field type to number) together. I've used the following successfully:
<?format-number:FIELD1;'PT9G990D00'?>
Hope this helps.
Paul -
How to make reverting to the left tab (instead of right tab) after closing a tab?
Presently, after you close a tab, Firefox goes to the tab to the right.
I need it to go to the tab to the left.
Can this be done?You asked this same question in the Mozillazine forums: http://forums.mozillazine.org/viewtopic.php?f=38&t=1974161&p=9788351#p9788351
-
How to declare a 2 digit number that must have a padded 0 to the left?
It is on a custom subscreen.
For instance:
01 02 03 04......10 11 12
What is declaration syntax? Thank-YouUse Type N, length 2.
Like:
data: l_num(2) type n .
L_NUM = 1.
WRITE: L_NUM.
Regards,
Naimesh Patel -
How can I zero out the memory on my macbook air?
I have an 11 inch mid 2011 macbook air and cannot figure out how to erase the memory so that none of the data is recoverable. I booted from the recovery HD but when I went to the erase section of the menu, the security options button and the zero out empty space option were both greyed out. How can I clean off my Mac?
You can't, and don't need to, zero an SSD in Disk Utility. Once you've erased it the data is unrecoverable.
-
How to add zero at the end of a character string
Hello Experts,
I've a requirement where I need to do sum/total of various numbers and display it with $ sign as shown below.
I'm using a variable CHAR20 to display total with $ sign. The problem is if there is a 0 at the end of the total then variable doesn't display it as highlighted above in red. Can anybody please make suggestion ( a code sample will be great help ) how resolve this issue?
Many thanks in advance.Hi,
please check this code:
REPORT ztestcurr.
DATA: xv_prval TYPE char20.
DATA: xv_val1 TYPE dmbtr VALUE '12.67'.
DATA: xv_val2 TYPE dmbtr VALUE '8.21'.
DATA: xv_val3 TYPE dmbtr VALUE '13.72'.
DATA: xv_sum TYPE dmbtr.
START-OF-SELECTION.
xv_sum = xv_val1 + xv_val2 + xv_val3.
PERFORM print_val USING xv_val1.
PERFORM print_val USING xv_val2.
PERFORM print_val USING xv_val3.
PERFORM print_val USING xv_sum.
*& Form PRINT_VAL
* Print value
* --> XF_VALUE Value to print
FORM print_val USING xf_value TYPE dmbtr.
WRITE xf_value TO xv_prval CURRENCY 'USD'.
CONCATENATE '$' xv_prval INTO xv_prval.
CONDENSE xv_prval NO-GAPS.
write /1 xv_prval using edit mask 'RR____________________'.
ENDFORM. " PRINT_VAL
Regards,
Klaus -
How to pad spaces at the end of a string
Hi All,
I am new to ABAP and need help to achieve this functionality
I have to build a string with fixed lenth . my input string
is always lesser than equal to X . I need to calculate and
add that many spaces at the end of the input string .
I tried to do this and getting the following error
please help on this :
if strlen( t_resultc ) < 525.
RFILL(t_resultc,' ',525)
endif.
Error : Comma without preceding colon(after RFILL(T_RESULTC ?)
Q: Can I use RFILL with out Select statement in a ABAP program
Thanks & Regards
KLKHi,
Try the following code but kindly make a note..
Note:-USE quote like this ` `, Instead of normal single quotes ‘ ’
WHILE strlen( T_RESULTC ) < 525. “Check the length
CONCATENATE T_RESULTC ` ` INTO T_RESULTC. ”Add spaces at the end
ENDWHILE.
Hope this helps,
Andrew -
How do I zero out the centre then?
I am always getting really dumb results when trying to paste in place from one thing to another.. Yeh does that make sense? I think it is in the middle of something and then when I try to past it out side that movie clip it ends up somewhere even off the stage? So obviously I am doing something not good workflow here. Can I reset centre information? Cheers
subYou can manually move objects to set their position, that includes using the align tool to get accurate placement
-
Removing zeros at the begining
hi,
How to remove zeros at the begining of a variable value irrespective of the length of that number
for example,
data:var type int4.
var = '0000012434'.
var= '0003423365'
var= '0436509843'.
I want to remove all zeros at the beginning.
the purpose is I am passing this to a function module which can not allow intial zeros.
Please help me with codeHi,
CONVERSION_EXIT_ALPHA_OUTPUT
converts any number with zeroes right into a simple integer.
Ex:
'00001234'-->1234
CONVERSION_EXIT_ALPHA_INPUT
converts any number into a string fill with zeroes, with the number at the extreme right
ALPHA conversion is used especially with account numbers. During conversion from the external to the internal format, the system checks to see if input in the INPUT field is purely numeric, that is, if this input consists only of numbers, possibly with spaces before and after them. If this is the case, then the number string is inserted right- justified in the display field OUTPUT and all spaces to the left of the value are filled with zeroes ('0'). If the input is not purely numeric, it is inserted in the display field from left to right and all extra spaces are filled with blanks.
Example:
(Input field and output field are both eight characters in length)
'1234 ' --> '00001234'
Regards,
Omkaram. -
Page Alignment to the left of the page?
Hi,
Would anyone know how to align pages to the left (not centered). There must be an easier way without resolving to HTML!
Thank you
MacBook 2.0 Mac OS X (10.4.8)No I'm talking about the whole site. When the site is published iweb automatically centers it. I would like to have my page as far left as possible.
Here is an example:
This site is Centered
http://vintagehomelighting.com/Vintage%20Home%20Lighting/Welcome.html
This is what I want:
http://www.rcmp-grc.gc.ca/index_e.htm
As you can see the difference.
Thank you -
How to padding the zeroes and space befoer sending from XI to R3 system.
Hi Experts,
How to padding the zeroes and space befoer sending any data from XI to R3 during mapping, how to write a java code to implement this logic, please help me with the coding or any other alternative.
thanks
dhanushto pad spaces you need to write a simple UDF
for right padding use the following
while( inputField.length() < Integer.parseInt(totalLength))
inputField = inputField + " ";
return inputField;
for left padding use the following
while( inputField.length() < Integer.parseInt(totalLength))
inputField = " " + inputField ;
return inputField;
Note:in the above examples <i>inputField</i> will be the input to UDF i.e. the sender field which you need to pad and send to receiver , and <i>totalLength</i> will be a constant i.e length of the field you want on receiver side after padding.
also i m not a Java expert so please check for syntax and semantics for code:) to me it looks correct
Thanx
Aamir
Message was edited by:
Aamir Suhail
Maybe you are looking for
-
I tried syncing my Iphone4 apps on a "new" computer. I was told that the computer was not registered with iTunes and could not back up all the bought apps. When I went to check on the iPhone after this I noticed (have been blind not to) that almos
-
As above, I foolishly updated to iTunes 11.0.1 after a software update prompt on my iMac 10.6.8, thinking I was doing a good thing getting my machine ready for my daughter's new iPad mini tomorrow. As it stands, the iPad is going to be such a let dow
-
Urgent: Gif animation shows only the last frame when reloaded
I use ImageIcon to show gif animations on screen. I want to use only non-looping gif animation files. Always when I show a gif animation for the first time it runs correctly through all the frames. However when reloading later the same gif animation
-
af:tree do not show up default tree image like folder or plus icon
Hi all, I am new to ADF and stuck with the problem where af:tree component do not show up default icons to expand and collapse.I am using websphere. Please help me to know where i am getting wrong to get the icons. Thanks in advance Irfan.
-
Contact shows up in messages without a text?
A contact will show up in my messages but there is no actual text message that comes with it. It looks like a blank conversation. There are no text bubbles or anything. Can someone explain to me why this happens please? Thanks!