Leading sign in integer values
hi ,
query is
data: a1 type i value 56 ,
a2 type i value 60,
res type i.
res = a1 - a2.
write:/ res.
when i do this o/p is 4-.
i want the sign at the begining like -4.
now i dont want to do any shift circular or like that cause that dosent solve my query as again i need to convert all the content to characters and so on ..
im looking for a function module or some logic which solves this purpose .
my version is 4.6 c .
thanks and regards,
vikky.
hi to all ,
data: a1 type i value 56 ,
a2 type i value 60,
res type i.
res = a1 - a2.
write:/ res .
CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'
CHANGING
value = res.
write:/ res.
i have used that function module but it supports only character format .
i want directly to pass the integer number ..
anyway thanks guys for the effort ..
let me repeat there is no option for me to go for a character type declaration as im restircted for that ..
regards,
vikky.
Message was edited by: Vikky
Similar Messages
-
How to create field with LEADING sign?
I have a request to create an output file that has any negative signs in a leading position. Example, value is 100.00- but we want it stored/displayed as -100.00. Anyone know if there is a FM (could not find one), etc. that does this? Thanks!
I don't know of any FMs that will do what you want.
There are, however, several ways of doing this using the WRITE command to transfer a number to a character field. This is all you really need, since you say you are filling a field of a structure you will be downloading to an external file.
1) You can try the <b>USING EDIT MASK <mask></b> additions to <b>WRITE</b>.
2) You can use <b>SHIFT <field> CIRCULAR RIGHT</b> to move any sign that exists to the beginning of a character field. This is all the formatting you need to give Excel a negative number it can parse. Other end user programs may require more work to remove the gap between the "-" and the digits of the number.
I've found (2) to be a better approach. Good luck! -
Run Allocation for integer values
Hi experts,
I am runnig an allocation for a HeadCount Account (all integer values) and I would like that the result of the allocation were also integer values, using a round instruction for example.
Could I define in Account Dimension that Signed data must be integer? or using rounding logic?
RegardsCorrect me if i am wrong:
E.g.1
*REC(EXPRESSION=int(%value%))
E.g.2
*RUNALLOCATION
*FACTOR=USING
*DIM ACCOUNTB WHAT=BR030; WHERE=<<<; USING=PR01;
*DIM TIMEB WHAT=%YEAR%.TOTAL_D; WHERE=[PARENTH1]= '%YEAR%.TOTAL'; USING=<<<;
*ENDALLOCATION
*COMMIT
How could apply Int statement in a RUNALLOCATION? -
Delete leading space in integer
Hello,
i have a requirement where I need to pass integer value only and do not need leading spaces. Can someone please help me to get this issue resolved?
I have tried using "shift"/condense and many more options. None of them works as they are for type C,N,D,T.
Plese help.Hi
your issue is not very clear, I can't understand where u have the integer and where u have to put the integer, anyway try to see if this sample is helpfull for you:
DATA: V_CHAR(10) TYPE C,
I TYPE I VALUE 8,
LEN TYPE I.
WRITE I TO V_CHAR.
CONDENSE V_CHAR NO-GAPS.
LEN = STRLEN( V_CHAR ).
WRITE V_CHAR(LEN).
Max -
Send and recieve 2 byte integer values.
hi,
basically i'm trying to allow my applet and servlet communicate using 2 byte signed integer values. but i haven't figured out how to store an integer value into a byte array of size 2, or unpack it once it gets there.
here's some code/psuedocode that i've done so far.
SERVLET:
ByteArrayOutputStream bst = new ByteArrayOutputStream(streamsize);
ServletOutputStream bout;
byte[] strm = new byte[streamsize];
byte[] dbyte = new byte[2];
int[] testarr = new int[10];
/* fill my testarr with values... */
bout = response.getOutputStream();
int l = 0;
for (int i = 0;i<arraysize;i++){
getDoubleByteFromInteger(dbyte,testarr)
strm[l++] = dbyte[0];
strm[l++] = dbyte[1];
bst.write(strm,0,streamsize);
bst.writeTo(bout);
APPLET:
/* connect to servlet and get binary stream */
bytecount = in.read(streamb);
byte[] db = new byte[2];
counter = 0;
while (cursor < bytecount){
db[0] = streamb[cursor++];
db[1] = streamb[cursor++];
array[counter++] = getIntFromByte(db);
the functions getIntFromByte and getDoubleByteFromInteger haven't been written, can anyone give me a little push? or tell me if this is something possible? thanks for any help
MattThe primitive type short is a two-byte signed integer, so you really don't need to bother with byte arrays - just use DataOutputStream to write it (it has a method called writeShort) and DataInputStream to read it (with readShort()).
But anyway, getting an int from two bytes and getting two bytes from an int is easy with the bitwise operators:
int -> byte array
int i = yourInt;
byte[] b = new byte[2];
b[1] = (byte) (i >> 8);
b[0] = (byte) (i);
byte array -> int (unsigned)
int i = ((b[1] & 0xFF) <<8) + (b[0] & 0xFF);
byte array -> short -> int (signed)
short s = (short) ((b[1] & 0xFF) <<8) + (b[0] & 0xFF);
int i = s; -
Getting integer values from a JTable
Hello
The table's cells contain integer values. I would like to save each one of theme them in an array of integers.
The problem is, I don't know how to do so. I tried to use the getValueAt method, but I always get error messages.
I tried something like:
Object o = table.getModel().getValueAt(i, j);
a[x]=Integer.parseInt(o.toString());Please help.
Thank you. :)WalterLaan wrote:
The next line in the exception stacktrace contains a class name and a line number. So go to that class source file and that line number and fix the problem there.Yes, guenouni, we're not mind readers. You need to be clearer and give precise details. The single best way to get the most useful possible help is to take a few minutes and write and post a SSCCE . If you do that, it will show your serious. -
Problem with % signs in key value url parameter pairs
Hi,
Tomcat 5.5.9
Java Version 1.5
I'm having a little difficulty passing a certain key value pair via a URL to the processing component of my web application.
If I submit a value for lets say parameter 'product_name' and that value starts with a % sign then the value is passed to my processing component as 'null' if I remove the % sign the value is correctly received.
Anyone come accross this on a Tomcat server?
The data has to be tagged onto the URL rather than as a form 'Post', as it is used to create and populate a popup window.
Thanks in advance.So the % is used in URLs to mark certain escape sequences, so when you put it in you value, it thinks that the value is actually an escape sequence, and probably translates poorly on the opposite side.
You will actually need to use the escape sequence for the % sign to get it work correctly. I don't recall the actual escape value, but:
If you use JSTL to put together the URL for you, you shouldn't have a problem, the values will be escapes:
<c:url var="popupAddress" url="http://www.mydomain.com/myapp/mupage.jsp">
<c:param name="product_name" value="%Whatever"/>
</c:url>
<script type="text/javascript">
document.open("<c:out value="${popupAddress}"/>","Popup");
</script> -
Passing multiple integer values as parameter in SSRS
Hello,
I am trying to pass a comma separated multiple integer value parameter in SSRS report and it errors out complaining that it is not able to convert the nvarchar value to datatype int. But it works fine when I pass a single value. Here is the code I am using
for the report and I am stuck at passing multiple values.
SELECT
id,count(*) as cnt
from table
and ID in (@id) group by id
eg: if I pass 10,20,30 then I would get error however if I pass 10 then it works fine
Is there a different method to pass multiple integer values?
Thanks for your help.A comma is, of course, a textual character and not an integer, thus the error you are getting. Multi-value parameters can be used for this.
Select "Allow multiple values"and set data type to Integer. Multi-value parameters deliver the values as an array. The query interface is smart enough to convert them to the proper syntax (comma-delimited) automatically so a statement like:
WHERE Field IN (@id)
where the parameter has an array of values {1, 2, and 3} is interpreted as:
WHERE Field IN (1,2,3)
You do not need to manually convert it in a transact SQL query. That is not the case for displaying the value array in your report. If you wish to display the array (described above) in your report as "1, 2, 3", you will need to use a join expression:
=Join(@id, ", ")
As DJ described, the other part to a multivalue parameter is the Available values. These can be set explicitly but given your example, I think it would be best to create a new dataset that retrieves a distinct list of the IDs that can be retrieved, perhaps
something like:
SELECT DISTINCT GroupName, GroupID
FROM table
WHERE [criteria]
Set the available values to use this query with GroupName (or whatever user-friendly field you choose for your dataset) as the label and the id as the value. The label field should be something the the target report user can easily identify the correct group
using.
If you don't want to or can't use a multivalue parameter for some reason then you will need to manipulate your parameter value prior to consuming it in your query. When you add the parameter to the TSql query and save the dataset, SSRS adds it to the Parameters
property of the dataset. Open the dataset properties and select the parameters tab. You should see your parameter in the list. click the expression builder (fx) button next to the value and enter this expression:
=Split(@id,",")
Note that the second element of the expression is the delimiter. If your text input has comma-space as a delimiter (1, 2, 3 vs 1,2,3) then that element must include ", ". My example just has comma so if you use that with a string "1, 2, 3"then
the resulting array will still have 3 elements but the 2nd and 3rd elements of the array will have a preceding space which will cause your dataset to error with the same error. As long as there are no non-numeric characters in any of the elements, the split6
will create the text array, SSRS will dynamically generate the correct "IN"syntax (comma separated) and SQL will convert the elements from VARCHAR to INT on the fly.
"You will find a fortune, though it will not be the one you seek." -
Blind Seer, O Brother Where Art Thou
Please Mark posts as answers or helpful so that others may find the fortune they seek. -
Help with passing integer value in A.S.S
I get an NSinternal script error while trying to pass this value can anyone help?
Also I wonder if it is possible to pass the value to a matrix
on clicked theObject
tell button "checkbox" of window 1
if integer value = 1 then
set button "checkbox2" of window 1 to integer value = 1
else
set integer value to 0
end if
end tell
end clicked
I also tried:
if state of button "checkbox" of window1 is 1 then
set the state of button "checkbox2" of window1 to 1
end if
Message was edited by: Doug BassettI've been following this thread and trying to figure out how to make this work. I was getting inconsistent results or errors with most of the code that has been posted. But I finally got it working... at least on a Leopard machine (not sure if this could have changed between Tiger and Leopard so your mileage may vary).
What I found was that a checkbox button that's located directly in a window seems to have a state that's equal to 0 when it's unchecked and 1 when it's checked. But a checkbox cell that's contained within a matrix seems to have a state that's set to either _off state_ or _on state_. Trying to set a cell's state to 0 or 1 simply wasn't working right for me. So I get the state of the "selectall" checkbox button (which is a 0/1) and transform it to either "off state" or "on state" before setting the states of the checkbox cells in the matrix.
Here's my code:
on clicked theObject
set n to name of theObject
if n = "selectall" then
set s to state of theObject
log "state: " & s
if s = 0 then
set newState to off state
else
set newState to on state
end if
repeat with i from 1 to count of cells of matrix "directories" of window "main"
tell cell i of matrix "directories" of window "main"
set state to newState
end tell
end repeat
return
end if
if n = "logStatesBtn" then
logStates()
return
end if
end clicked
on logStates()
log "Logging states:"
set s to state of button "selectall" of window "main"
log "selectall checkbox: " & s
repeat with i from 1 to count of cells of matrix "directories" of window "main"
tell cell i of matrix "directories" of window "main"
set s to state
end tell
log "Cell " & i & ": " & s
end repeat
end logStates
Note the "logStates" handler is just something I connected up to a "logStatesBtn" button in my window that lets me spit out the states of all the checkboxes into the console log. This is how I actually discovered that the cells were set to "off state" or "on state".
Steve -
How to set a default integer value in a form
I have a form defined as follows:
=================================================
public static class ProjectForm extends FormData
private int idx;
private String name;
private String projectNumber;
private String description;
public void setIdx(int index)
this.idx = idx;
public int getIdx(){
return this.idx;
public void setName(String name)
this.name = name;
public String getName()
return this.name;
public void setDescription(String description)
this.description = description;
public String getDescription()
return this.description;
public void setProjectNumber(String projectNumber)
this.projectNumber = projectNumber;
public String getProjectNumber()
return this.projectNumber;
======================================================
When I add a new entry into the database, I have no issues. However, when I want to modify an entry I run into some issues with the idx entry. For some reason, I cannot set a default value into the netui:label tag. My jsp code is as follows:
===================================================
<tr valign="top">
<td>
Index:
</td>
<td>
<netui:label value="{actionForm.idx}"
defaultValue="{pageFlow.project.idx}"/>
</td>
</tr>
<tr valign="top">
<td>
Name:
</td>
<td>
<netui:textBox dataSource="{actionForm.name}"
defaultValue="{pageFlow.project.name}"/>
</td>
</tr>
<tr valign="top">
<td>
ProjectNumber:
</td>
<td>
<netui:textBox dataSource="{actionForm.projectNumber}"
defaultValue="{pageFlow.project.projNum}"/>
</td>
<tr valign="top">
<td>
Description:
</td>
<td>
<netui:textBox dataSource="{actionForm.description}"
defaultValue="{pageFlow.project.description}"/>
</td>
</tr>
======================================================
The the project class is passes into the page and has the appropriate values. The name, project number and description fields work as I would expect. However, the idx value is alway '0'. If I print out pageFlow.project.idx it has the correct value.
How do I fix this? My feeling is that it is related to the form field being an int and not a string. The default parameter indicates that is only works with null values, and ints default to zero. Do I need to use an Integer value instead in the form, or just stay away from non-string form fields.
Thank for the help!!
--JohnIn the action which displays the edit page just set the form idx value before displaying the jsp.
-
Hi,
I want to add leading zeros to negative values.
<b>Present Value :</b> -567
<b>Expected Value :</b> -0000000567
I know to adding leading zeros with the help of CONVERSION_EXIT FM.
Thanks in advance.
Regards,
Kumar.Hi
Use below FM.
CONVERSION_EXIT_ALPHA_INPUT
Try out below FM with the above one.
<b>CLOI_PUT_SIGN_IN_FRONT</b>
<b>ISJP_GET_SIGN</b>
or you can use
<b>WRITE variable USING EDIT MASK '-___________'.</b>
or
<b>CONCATENATE syntax</b>
Hope it will solve your problem
<b>Reward Points if it is helpful.</b>
Message was edited by:
ilesh 24x7
Message was edited by:
ilesh 24x7 -
Read integer values from spreadsheet and display the values in a table
Hi all,
I have integer values to read from a spreadsheet and display them in a table. I am using 'Read from spreadsheet file' in 'integer' mode. I would like to display these values in a table. The problem is that the table takes only 2d-array of string as input but not integer.
It works fine if I change the mode of 'Read from spreadsheet file' from 'integer' to 'string' but I want to read integers and have to use the integer values for further calculations. Please give any suggestions on displaying integers to a table.
Thank you.
Solved!
Go to Solution.No don't take element by element just convert as a whole. See the attached example
Good luck
The best solution is the one you find it by yourself -
Manual Data Entry and Leading Sign in BCS
Hi,
can somebody help me,i need informations about the Leading Sign in the Manual Data Entry. Where can i make a field in the ucwb, to enter a Leading Sign at the Manual Data Entry in the ucmon?
Thanks in advance,
with regards,
Thomas RettenmaierHi Thomas,
What exactly you mean under 'Leading sign'?
Best regards,
Eugene -
How to show $ sign alongwith the value in message styled text field.
Hi,
How to show $ sign alongwith the value in message styled text field.
The value is coming from the table column in VO.
I am working on OAF R12.Hi,
Resolved.
I used the below code in CO for the solution.
Formatter currencyFormatter = new OADecimalValidater("$#,##0.00;($#,##0.00)",
"$#,##0.00;($#,##0.00)");
OAMessageStyledTextBean msrpField = (OAMessageStyledTextBean)webBean.findChildRecursive("MSRP11");
msrpField.setAttributeValue(ON_SUBMIT_VALIDATER_ATTR, currencyFormatter); -
Hi
My company just started a new project that implies migrating every hour operational data from a mysql database located at another company to our main DB (oracle10gR2). Between these two DB, we have an oracle XE DB which contains the database links to both DB and a procedure to get (from mysql) and insert (oracle10g) the values. What happens is that in the mysql DB, the values have decimals and, when i select the table in oracle, i only see integer values (no decimals). Here is an example of the select i use:
SELECT "v_hour", "v_date", "v_type", "v_tabstamp","v_value"
FROM "tab1"@mysql;
How can i work around this problem?
Many thanks!Maybe just a HS_LANGUAGE setting issue.
You could try that:
1a) in the gateway init file, please set HS_LANGUAGE=GERMAN_GERMANY.WE8ISO8859P1
2a) now open a new SQL*Plus session ans select from your table using the gateway based database link
=> if the values are now including the decimal part then your foreign database is set up to use a comma as the decimal separator and you have to make sure that the HS_LANGUAGE contains a territory that uses as decimal separator a comma.
If you still do not get the decimal values, then change it to:
1b) HS_LANGUAGE=american_america.we8iso8859P1
2b) Make sure you start again a new SQL*Plus session (the gateway init file is only read when you use the database link in your session for the first time (or explicit closed it before). Select again from your table.
=> is the decimal part now visible?
More details can be found in the gateway note: Gateway and Decimal Digits(Doc ID 1453148.1) available from My Oracle Support portal.
- Klaus
Maybe you are looking for
-
How can you convert multiple PDF files at once to PDF/A-1b files
I support individuals who on occasion have to submit a mass of files to a court and the requirement is that the files be in PDF/A format. Most are scanned files lacking the requisite structure to become PDF/A-1a files. So as I convert or resave files
-
Can anyone tell me where I would go to find a replacement cd that has Airport utilities version 5 with bonjour
-
Itunes Library is not at specified location--Can't find
Greetings All, First of all I would like to say that I am an advanced user but my current issue has me absolutely stumped. Any help is greatly appreciated. I recently changed computers and I won't bore you with the details, I run Itunes from an Ex. H
-
In WYSIHAT HTML Control, the font colour can not be changed when using Firefox 14+, this issue is not existing firefox 13-
-
ADF BC / Why bind variables are mandatory in the sql query
I got this error during view object excecution in the component browser : (oracle.jbo.SQLStmtException) JBO-27122: Erreur SQL lors de la préparation d'une instruction. Instruction : SELECT * FROM (Select distinct(socialgroup.socialgroup_i) from socia