How to set locale to accept German number format?
I'm just evaluating the BC4J framework and built a struts-based JSP page for BC4J. The application should be multilingual. How can I change the locale (especially the number input format) to german, so that a decimal comma is accepted? If that isn't possible, can someone give me a hint, in which class/method to put the code for parsing or validating the input string?
I'm just evaluating the BC4J framework and built a struts-based JSP page for BC4J. The application should be multilingual. How can I change the locale (especially the number input format) to german, so that a decimal comma is accepted? If that isn't possible, can someone give me a hint, in which class/method to put the code for parsing or validating the input string?
Similar Messages
-
How to set local currency in AR/Invoice through DI API SAP B1?
Dear Expert,
I am using DI API to add AR/Invoice document, but I can't find how to set local currency for BP with foreign currency.
This my code snip :
oSO = oCompany.GetBusinessObject(BoObjectTypes.oInvoices)
oSO.DocDate = dtpPostDate.Value
oSO.DocDueDate = dtpDueDate.Value
oSO.TaxDate = dtpDocDate.Value
oSO.Series = cSeries
oSO.DocNum = txtNumber.Text
oSO.DocCurrency = doccur
oSO.CardCode = txtBP.Text
oSO.CardName = txtName.Text
oSO.ContactPersonCode = cntctCode
oSO.JournalMemo = txtRemarks.Text
For i = 0 To dgv.RowCount - 2
oSO.Lines.SetCurrentLine(i)
oSO.Lines.ItemCode = dgv.Item(0, i).Value
oSO.Lines.ItemDescription = dgv.Item(2, i).Value
oSO.Lines.Quantity = dgv.Item(4, i).Value
oSO.Lines.Price = dgv.Item(5, i).Value
oSO.Lines.DiscountPercent = dgv.Item(6, i).Value
oSO.Lines.TaxCode = dgv.Item(7, i).Value
oSO.Lines.LineTotal = dgv.Item(9, i).Value
oSO.Lines.Currency = doccur
oSO.Lines.Add()
Next
lRetCode = oSO.Add()
If lRetCode <> 0 Then
oCompany.GetLastError(lErrCode, sErrMsg)
MsgBox(sErrMsg, 16, "Attention")
Else
MsgBox("Operation completed successfully.", 64, "Information")
End If
When trying to Add, system show error message " Enter valid currency code [OINV.DocCur][Line:1], '$' "
I am not lucky after trying for a day , wish enlightenment from the experts here, Thank you.
My machine : SAP B1 9 PL 4
Best Regards,
Muh.UlfahHi
In the other thread I suggested that you can add document using interface first because there is a possibility that B1 doesn't accept this currency code not because you set it improperly in your code but because of some other reason, for example this currency is not valid for this particular business partner. Despite the fact that this way you can eliminate other possible problems you can also use DI to save an existing document as XML and check what is the actual currency code that B1 itself placed in the document lines object.
Afterwards you can again try to add document using DI.
btw
check this thread:
How to set local currency in sales order for BP with foreign currency through DI?
Kind regards,
Radek -
How to get a BigDecimal from german number (12,34)?
How can i convert a string "12,34" to a BigDecimal object (value of 12.34)?
I tried using special locale NumberFormat, but this doesn't work:
* Convert a string to a BigDecimal object.
* @param string String to convert.
* @param pattern Pattern format to parse input string.
* @param locale Locale to use for text formatting.
* @return BigDecimal BigDecimal object with value represented by <I>string</I>
* or null if conversion failed or <I>string</I> is empty.
public static BigDecimal toBigDecimal(String string, String pattern, Locale locale) {
BigDecimal result = null;
if (string != null) {
if (pattern == null) {
pattern = "###,###,###,##0.####"; //default
if (locale == null) {
locale = Locale.getDefault(); //default is GERMANY anyway ...
DecimalFormat df = (DecimalFormat) NumberFormat.getInstance(locale);
df.applyPattern(pattern);
Number num = df.parse(string, new ParsePosition(0));
if (num != null) {
try {
string = string.replace(',', '.');
result = new BigDecimal(string);
} catch (NumberFormatException nfe) { /* ignore */ }
}//else: input unavailable
return result;
}//toBigDecimal()this code only works for string "12.34" but not for "12,34" (german style)... ?no, num.doubleValue() is not exact enough (can lead to different numbers after the decimal point). the only way i have found so far to convert exactly is to use the String constructor of BigDecimal.
the starnge thing is, that the same value as a fixed string works, but not the string value:
public static BigDecimal toBigDecimal(String string, String pattern) {
BigDecimal result = null;
if (string != null) {
java.text.DecimalFormat df = new java.text.DecimalFormat(pattern);
Number num = df.parse(string, new java.text.ParsePosition(0));
if (num != null) {
try {
string = string.replace(',', '.');
System.out.println("1: "+new BigDecimal("12.34"));
System.out.println("2: "+new BigDecimal(string)); //thorws NumberFormatException, even though string has the value "12.34" (checked with debugger)
result = new BigDecimal(string);
} catch (NumberFormatException nfe) {
System.err.println("toBigDecimal():"+ nfe);
return result;
}//toBigDecimal()output:
1: 12.34
toBigDecimal():java.lang.NumberFormatException: 1234
where is the decimal point? the debugger shows that 'string' has the value "12.34" (with decimal point)???? -
How to set local path for load library
Hi,
How do i set local path for native dll as i dont want to set the path in the environment variable.
can i do like this
System.loadLibrary("c:\abc");
ThanksI believe that System.load() does exactly the same thing, but accepts fully qualified filenames. So give that a try.
Failing that.... maybe you can add -Djava.library.path=
to your command line to explicitely override the path set ?
regards,
Owen -
How to set local help as default in ID CS5?
Just received a replacement laptop w/CS5 installed & cannot figure out how to disable/turn off community help...I want it to default to local help whether connected to the net or not.
Thanks
Update Info:
Or, if setting local help as default is not possible, what about turning off or disabling internet sensing by the program? This will be used in the field and sometimes slow connections are the only thing available. Testing it on a dial-up connection, it just set there trying to access community help without allowing access to the local help until the dial-up connection was closed.Thanks Peter...I'd already found that, but when I first found it, the last section was not in that screen and in playing around, I found that Air was not installed proprly, uninstalled & re-installed that & that last section with the 2 ticks showed up & selected local help.
Next, I get a message that there is no PDF reader installed...but a working copy of AR7 is & it works...I'm thinking that CS5 should be uninstalled & re-installed, however, that will have to wait until I can get the laptop back to the company we're working for.
The community help window indicated the local help file to be 40Meg, but a search found no PDF that large on this machine.
Is this PDF available for direct download & I'll just access it outside of the help screen if necessary.
Laptop/program owner is in Canada, I'm visiting in Georgia & have an overseas flight on Wednesday... -
How define a pattern for having a number formatted
Hello,
anybody knows how to define a pattern for having an input number formatted in this way:
150.000.000,88
I've tried to use the following pattern( pattern="#.#00,00") ...but - of course - It does not work.....
I'm using Jdeveloper 11.1.1.7
<af:inputText value="#{pageFlowScope.contractBean.localTot}"
label="#{contractBundle.BASE_TOTALE}"
columns="12"
maximumLength="#{bindings.baseTot.hints.precision}"
id="it2"
valueChangeListener="#{pageFlowScope.contractBean.baseTotChangeList}"
autoSubmit="true"
required="true">
<f:validator binding="#{bindings.baseTot.validator}"/>
<af:convertNumber type="number" minFractionDigits="2" maxFractionDigits="2" pattern="#.#00,00"/>
</af:inputText>Guessing you tried this, but have you tried:
<af:convertNumber locale="de" ...
or
<af:convertNumber locale="#{requestContext.formattingLocale} ...
Hope this helps. -
How to set local file copy buffer size?
Is there any sysctl parameter or any other mechanism to set or change file copy buffer sizes? I'm backing up a huge number of files to a local hard drive connected by firewire, and I'd like to play with file copy buffer sizes for the best performance. The machine used is a new macbook pro running OS-X 10.6.7. Any ideas?
Here is a bash script that uses the dd command to copy a file. Use the -b option to set the file size.
example:
/Users/mac/config/forumcopy.command -vb 4096 /Applications\ \(Mac\ OS\ 9\)/Civilization\ II/Civ\ II\ Map\ Editor /Applications\ \(Mac\ OS\ 9\)/Civilization\ II/Civ\ II\ Map\ Editorv8
I haven't tested this a lot.
Of course, I haven't figured out how best to post code. Trying HTML mode. Using the <pre> tag.
#!/bin/bash
# macteracopy [ -b blocksize ] [-v ] [-V ] input_file output_file
# Purpose of this script:
# Copy a file with optional block size. Default size of 4096.
# Notes:
# chmod u+x macteracopy
# You may have to restart the finder to notice a customized file icon.
# Copyright 2010 rccharles
# GNU General Public License
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# For a copy of the GNU General Public License see
# <http://www.gnu.org/licenses/>.
# debug info
export PS4='+(${BASH_SOURCE}:${LINENO}):'
## not in the tiger version of bash ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
declare -x verbose="No" \
veryVerbose="No"
blockSize=4096
# Check for command-line options used when calling the script
if [ $# -gt 0 ] ; then
while getopts "b:vV" Option ; do
case "${Option}" in
b ) blockSize=$OPTARG
v ) verbose="Yes"
V ) veryVerbose="Yes"
\? ) echo 'usage macteracopy -b blocksize -V input_file output_file'
* ) echo "Unknown argument among arguments $* on command line."
exit 6
esac
done
fi
# We're done with switches / options from the command line
shift $(($OPTIND - 1))
[ "${veryVerbose}" = "Yes" ] \
&& set -x
inputFile="${1}"
outputFile="${2}"
[ "${verbose}" = "Yes" ] \
&& echo \
&& echo "$0 script revised $(GetFileInfo -m $0)" \
&& echo
[ ! -f "${inputFile}" ] && echo "File not found. ${inputFile}" && exit 4
[ -d "${inputFile}" ] \
&& echo "Directories are not supported, yet. ${inputFile}" \
&& exit 4
[ "${veryVerbose}" = "Yes" ] \
&& ulimit -a \
&& df \
&& echo
if [ "${verbose}" = "Yes" ] ; then
dd bs=${blockSize} if="${inputFile}" of="${outputFile}"
dd bs=${blockSize} if="${inputFile}/rsrc" of="${outputFile}/rsrc"
else
dd bs=${blockSize} if="${inputFile}" of="${outputFile}"
dd bs=${blockSize} if="${inputFile}/rsrc" of="${outputFile}/rsrc"
} 2>/dev/null
fi
[ "${verbose}" = "Yes" ] \
&& echo \
&& ls -l "${inputFile}" \
&& ls -l "${inputFile}"/rsrc \
&& GetFileInfo "${inputFile}" \
&& ls -l "${outputFile}" \
&& ls -l "${outputFile}"/rsrc \
&& GetFileInfo "${outputFile}" \
&& echo
SetFile -a $(GetFileInfo -a "${inputFile}" ) \
-c $(GetFileInfo -c "${inputFile}" | sed 's/"// g' ) \
-t $(GetFileInfo -t "${inputFile}" | sed 's/"// g' ) \
"${outputFile}"
[ "${verbose}" = "Yes" ] \
&& echo "after SetFile" \
&& GetFileInfo "${outputFile}" -
How to set default 'location' in Serial number setup
Hi Expert,
We are using SAP B 8.81 PL-10. we want to set by default location like "Bangalore" In Serial Number setup.How can we do this.Please suggest me.
Thanks & Regards
Alok KumarHi Ambesh,
Thanks For your response. Here we are using 10 warehouse and all warehouse having same location like' Bangalore'.No currently we are not using any FMS.
Regards
Alok Kmar -
How to set busy trigger and max number of calls for a sip phone in SRST
How is it possible to set the maximum number of calls and busy trigger for a line on a sip phone in SRST .There is no commands like dual-line or octo-line for the max-dn like under call-manager-fallback .
Sent from Cisco Technical Support iPad AppSo is the answer then that there is no way for a SIP phone in SRST mode to handle multiple calls? I have a site currently failed over in SRST mode, and I have noticed that the reception phone can only handle one call at a time. If I place a second call to it I get a busy signal.
-
How to set locale to the browser locale
How i can set the locale of the view to the
locale setting of the browser ???not sure if this is up-to-date info, but:
http://www.devx.com/tips/Tip/13522 -
How to set local radius with AP 1240AG series
Hi,
I have been trying to set up a AP with AIR-AP1242AG-Ak9 as a local authenticator radius but with no success. I have followed the steps from a lot of posts but no go, even with the most simple and understanable post like this one:
https://supportforums.cisco.com/document/101121/configuring-autonomous-ap-local-radius-authentication
The guy at the end of the post says:
Configuring AP
1. Go to Security>Encryption Manager
2. Specify Encryption (can be WEP or WPA)
3. Specify that WEP is Mandatory
4. Specify the key accordingly
5. Click Apply
6. Go to Security>SSID Manage
7. Select the desired SSID
But when I go via GUI fist of all:
I dont understand why it says it can be WEP o WPA because if I select WEP and follow the rest of the steps, I got an error message: WPA mandatory is supported only with Cipher TKIP or AES CCMP or AES CCMP +TKIP <see encryption managerpage>
Besides WEP, as far as I kknow it only works with a password only and I want the PC clients to aunthenticate with the AP itself as a Radius local server so it should ask for a username and password defined in the AP.
Second of all, the steps from the guy states on item 4, specfy the key acordinly? what this means? I only see keys filed in hexa.
third of all, if I do the steps in the error above, it allows me to set WPA with key management Mandatory but only by selecting the Cipher drop down menu, so which item should I pick ?there are a lot like AES CCMP, AES CCMP+TKIP, etc
But whenever another PC tries to login, it asks for the username and password, but it never get passed just saying error on the network.
I include the debug for the local radius below
I also included the config of the AP
All I want is the AP ask for a username and password, login successfully and thats it.
anybody else or someone that has a function config to share with me? I would appreciate it, cause I have been more than 12 hours in a row trying to set it up but no goHere is a one of my post related to this topic,see if that helps,
http://mrncciew.com/2013/03/03/autonomous-ap-as-local-radius-server/
If supported use WPA2 with AES as that is most secure. Do not use WEP. If WPA2/AES is not supported then try to use WAP with TKIP.
Here is other useful configuration example on the same topic
https://rscciew.wordpress.com/2014/07/24/autonomous-ap-with-local-radius-server-eap-fast/
HTH
Rasika
**** Pls rate all useful responses *** -
How to set a report culture for number and date
Hi,
Is there a way to change the report locale for the number and date?
I've tried using both CrystalDecisions.Share.SharedUtils.RequestLCID and CrystalReportViewer.SetProductLocale and neither work
The only one that work is to use the Thread.Culture. But that also change the application culture, not just the report.
Anyone have a solution?
ThankHi Michel,
I don't believe you can do this within just the report itself but I haven't played with this very much. Because the App hosts the Viewer it's based on it's culture.
You should be able to mix if you create a separate thread for each report job that way they are in their own space.
Search the Object browser on celocale and you'll find more info. Also the SDK help file should have examples.
No API's to use the Engine, had to use RAS.
Need to know what version you are using also and WEB or Windows app?
Here are some samples using RAS:
rpt1.ReportClientDocument.LocaleID = CrystalDecisions.ReportAppServer.DataDefModel.CeLocale.ceLocaleGerman;
CrystalDecisions.ReportAppServer.DataDefModel.CrFieldDisplayNameTypeEnum.crFieldDisplayNameFormula, CrystalDecisions.ReportAppServer.DataDefModel.CeLocale.ceLocaleUserDefault);
And using this way you may have to alter every object in the report.
Thanks
Don -
How to set a limit on the number of processes a session can start?
I have an Oracle db version 10.2.0.4 running on Solaris 10. My parallel_max_servers parameter is set to 650 and the processes parameter is set to 700. But I don see one session that is spawning 129 processes and another one that is spwaning 65 processes. Is there a way to limit the number of processes that a session can spawn?
check processes
$ ps -ef | grep $ORACLE_SID|wc -l
SQL> select * from v$resource_limit where resource_name ='processes';
My parallel_max_servers parameter is set to 650 and the processes parameter is set to 700.
PARALLEL_MAX_SERVERS
specifies the maximum number of parallel execution processes and parallel recovery processes for an instance. As demand increases, Oracle increases the number of processes from the number created at instance startup up to this value.
Do you use query with parallel?
example:
-> create table xxx PARALLEL (degree 5)
-> select /*+ PARALLEL
if you don't use parallel on execution processes... so, your processes not increase ;)
By the way your db have limited proceses= 700 (Dedicated Server Processes) -
How to set MTA to accept mails from hosts on INTERNAL_IP only?
Hello,
I would like to config a messaging server with:
- this mail server will accept incoming mails from hosts on INTERNAL_IP list only without authentication.
- this mail server will accept to send mail for clients with SASL and TLS only, which means, any incoming SMTP connection will be restricted to use SASL and TLS except hosts on INTERNAL_IP list.
/opt/SUNWmsgsr/@msg# imsimta version
Sun Java(tm) System Messaging Server 6.2-7.05 (built Sep 5 2006)
libimta.so 6.2-7.05 (built 12:08:11, Sep 5 2006)
I appreciate if you can help me on this, thanks in advance.
Best regards,
RobertHello Shane,
Thanks for your reply.
From the log below, it seems incoming mails will go
to the tcp_local channel first then switch to
tcp_intranet later for sending hosts on INTERNAL_IP
list.
INTERNAL_IP
$(10.1.255.222/32) $Y
$(10.1.255.202/32) $Y <-- sending host
127.0.0.1 $Y
* $N
25-Jun-2007 11:29:18.25 46f1.39c.2830 tcp_local +
O TCP|10.1.255.222|25|10.1.255.202|6442
SMTP
5-Jun-2007 11:29:18.27 46f1.39c.2831 tcp_intranet
ims-ms E 3 [email protected]
rfc822;[email protected] 0694037@ims-ms-daemon
/opt/SUNWmsgsr/data/queue/ims-ms/007/ZZf0B4WiQpxLd.00
<A0D8A3EC90EE42E799706627282BF74C@ibm336> mailsrv
msmail.abc.com ([10.1.255.202])
25-Jun-2007 11:29:18.27 4c9c.0e48.3788 ims-ms
D 3 [email protected]
rfc822;[email protected] 0694037@ims-ms-daemon
/opt/SUNWmsgsr/data/queue/ims-ms/007/ZZf0B4WiQpxLd.00
<A0D8A3EC90EE42E799706627282BF74C@ibm336> mailsrv
My question is, if I modify the tcp_local channel
definition to "mustsaslserver" and "musttlsserver",
will sending hosts listed on INTERNAL_IP also be
blocked?
Thanks for your response. ^^No. All emails to port 25 'hit' the tcp_local channel - there is a rewrite rule to switch messages from a certain IP range (INTERNAL_IP) across to the tcp_intranet channel, at which point the tcp_intranet restrictions apply.
Regards,
Shane. -
How to set local working plane?
When I'm working in 3D & using cameras, sometimes I'll drag an image (or whatever) onto a 3D project and when I look at all my elements in perspective view, the image's actual position in space is nowhere near any of the other objects.
Is there a way to specify the the plane where new objects are to be created?Where ever the camera is when you create it, that's pretty much where stuff will end up. You'll have to simple go to the Properties in the Inspector and drag the X, Y, Z parameters to position it properly. There's no magic "go where I want" function. You can drag and drop it directly in to the Canvas window if you want.
Maybe you are looking for
-
.
-
Trackpad Bug in 10.9 (click is delayed, results in strange behavior)
Hi everybody, Since updating my Macbook (5,1 late 2008, SSD, 8GB-RAM) to 10.9 Mavericks my trackpad behaves buggy in the following way: When I press down the trackpad with one finger the corresponding "reaction" seems to be delayed (not every but mos
-
Error handling for distributed cache synchronization
Hello, Can somebody explain to me how the error handling works for the distributed cache synchronization ? Say I have four nodes of a weblogic cluster and 4 different sessions on each one of those nodes. On Node A an update happens on object B. This
-
I'm a web designer and I still use Photoshop to mockup, to a certain extent the design of my websites. I find it frustrating however that when I make the mockup, it appears half-size in Photoshop. I have to double the size of everything to make it "a
-
How to install a phonegap plugin in Dreamweaver
Hi all, I'm new to mobile developement and I'm trying to create a application wich open local PDF files. I've found a plugin that do just that, but I haven't found a way to install the plugin within Dreamweaver. Plugins already wrapped in Phonegap wo