Position or Index Function?
Hi,
Is anyone aware of string manipulation to extract data based on finding the position of a particular value.
Example1 : Hello.World.to.work
Example2: Place.Name.Animal.Thing
I want to be able to extract "World" from example1 or "Name" from example2 using the same function either in expression builder or using the calculated field expression of the Architect interface within Oracle BAM.
Substring(string,pos,length)...here I cannot get to the position of the first occurence of "."(dot) within the expression.
Thankyou,
Hi,
Is anyone aware of string manipulation to extract data based on finding the position of a particular value.
Example1 : Hello.World.to.work
Example2: Place.Name.Animal.Thing
I want to be able to extract "World" from example1 or "Name" from example2 using the same function either in expression builder or using the calculated field expression of the Architect interface within Oracle BAM.
Substring(string,pos,length)...here I cannot get to the position of the first occurence of "."(dot) within the expression.
Thankyou,
Similar Messages
-
Using Acrobat's Catalog (Index) function in a Browser environment
Operating in a browser-based Microsoft Sharepoint Server environment, our shop accesses a number of large aircraft-related manuals that consist of multiple documents in Acrobat PDF format. We were stymied whenever we attempted to perform a full-search of the documents (cataloged via an index.pdx file)—the function simply did not work. Strangely, even though we linked the search function to the correct index file on the network server, Acrobat searched for a file on one's local drive.
The documentation for Acrobat 7.0/9.0 offers the following explanation:
"To search an Adobe PDF index, you must open Acrobat as a standalone application,not within your web browser." But this information was hardly encouraging since we had no intention of giving up the browser-based environment.
Our IT staff has discovered there is a way to work around this restriction. The trick is to access the index file using Windows file protocol. This step in effect launches Acrobat as a standalone app within a browser environment. For example,
1. Add a bookmark labeled "(FULL TEXT) SEARCH" to the document's main navigation window
2. Edit the properties of the bookmark
a. Set the Action to "Open a web link"
b. Edit the URL to the fully-qualified address of the index file using the file protocol: file://..../index.pdx
NOTE: You have to use file protocol in order for the catalog function to work
3. Save the main document to enable the modifed link
4. Click the bookmark to launch the Search PDF window. The default Look In target now becomes the catalog file (index.pdx) of item 2b.How do you access the generic PDF, directly or through an HTML page? It shouldn't make a difference. More importantly, does a user accessing this file have access to all the folders/files associated with the bookmark, that is, are they on the same server?
Each of the slash pairs is meaningful. The notation with four slashes file://// ... implies that the host computer and a portion of the path is already known or defined, which I suspect is probably not the case for you. For details of the file URL, see http://www.cs.tut.fi/~jkorpela/fileurl.html. Attempting to access the index.pdx via http://... protocol does not work, as you point out, as it tries to locate the file in the temporary Interner folder on your local computer (as defined in the Internet Options dialog).
The following notation works in my environment:
file://z:\deptfolder\subfolder\subfolder\main_subfolder\pdf_subfolder\index.pdx (z: is a network drive)
file://hostname/deptfolder/subfolder/subfolder/main_subfolder/pdf_subfolder/index.pdx (hostname is our INTRANET server)
Added note: based on my reading of Acrobat 7.0/9.0 Help, the "Cannot find ..." error message indicates that the link relationship between the master file and the index has been broken. An index assumes a relative path exists between the index definition file (PDX) and the folder containing the indexed documents. If this relative path remains unchanged, you don't have to do anything after moving the indexed document collection. However, if the relative path changes or the index resides on a drive or server distinct from any part of the collection, you will need to create and build the index in the same location as the collection.
Using Relative Addressing
The fact that the Catalog index function relies on relative addressing can simplify the task of maintaining links if the relationship between files remains unchanged in moving from one environment to another. For example, given the following relationship
main_subfolder (menu file)
pdf subfolder (PDF files)
index subfolder (index definition file)
recreated in a browser environment, you can create the bookmark links in a menu file as:
Action: Open a web link ----> ./pdf subfolder/filename.pdf (open PDF document)
Action: Open a web link ----> ./pdf subfolder/index subfolder/index.pdx (open INDEX file)
in which the dot notation identifies (i.e., serves as a placeholder for) the path to the main_subfolder, The Open a web link function permits you to modify the contents of the URL. (Acrobat attempts to open each link using the file:// protocol.) For some reason, Acrobat may change the bookmark Action to "Execute a menu item" after you create and save it, but this step does not change the funtionality of the bookmark.
Message was edited by: tarusbulba 3/18/2010 -
Question regarding index function in fortran
Hi guys,
we are currently migrating to F90 from F77 fortran.
When I link the code, I get link error on index function with f90 compiler, but it works fine with F77.
Symbol not found error
__f_index_a dbg/driver.o
Can you please tell where can I find the symbol definition.
-PrabhuAs I mentioned before, the value of a constant that does not fit in the space allocated for it is undefined. Different compilers will handle it differently.
Sun's f77 compiler was derived from the BSD UNIX f77 compiler, which in turn was derived from AT&T's f77 compiler. AT&T's f77 compiler was written by Stuart Feldman while he was at Bell Labs. Perhaps influenced by the C programming language, he chose to increase the space allocated for an integer constant if its value did not fit in the space that would normally be allocated for it, up to the size of the largest supported integer type.
Sun's f90 and f95 compilers were derived from the CraySoft f90 compiler. The CraySoft compiler chopped off the high-order bits of integer values that did not fit in the available space.
Sun's Fortran team recognized that the behavior of Sun f90 and f95 in this regard would be a problem for some users. We devised a scheme that would resolve the problem in most cases. The scheme has been partially implemented, but there is still a lot of work left to be done.
Robert Corbett -
Using pattern in Index function
Hi, We have a requirement where we want to get first alphabet wherever it appears in the string. For e.g. if we have 12XOF then we want to take out first occurance of Alphabet which is X. If string is 1234y then we want y to be in out output field. It can be anywhere in the alphanumeric string.
I was thinking of using pattern matching in Index function but realized I can not do that. So now I am not sure what I can use to get the first occurance of alphabet in the input string of alphanumeric. Match can say it matches or not but can not give me the value of that alphabet.
Thanks,You can create a custom function to strip out the numbers, and give you the first occurence of the alphabet.
$Letter = '';
$Out_String = '';
while(length($P_Input_String) <> 0 and length($Out_String) < 1)
begin
$Letter = substr($P_Input_String,1,1);
if (match_pattern($Letter,'9') = 0)
begin
$Out_String = $Out_String||$Letter;
end
$P_Input_String = substr($P_Input_String,2,length($P_Input_String)-1);
end
Return $Out_String;
$P_Input_String should be an input parameter,
$Letter and $Out_String should be variables created for the function.
Use this custom function in the mapping tab and pass the input string to get the output values.
Regards,
Suneer. -
Search and index functions don't work with merged projects
Until this morning, the search and index functions in my RoboHelp project worked okay; I have one Main project into which I have merged more than three dozen sub-projects. About an hour ago, I created a new sub-project and merged it into the Main project; now, it's as if the topics in my merged projects don't exist.
Any suggestions?
thanks,
LonSo when you open the merge you see all the content, it is just the search and index not working. This must be merged CHMs as you are talking about a Favourites tab so maybe your other comment is relevant. My understanding of merged CHMs is that you do not want spaces in file names, that could be the problem.
See www.grainge.org for RoboHelp and Authoring tips
@petergrainge -
Indexing function in Adobe Acrobat Pro
I am currently using the 30 day trial version of the above software, and am new to the Adobe product. I am able to import a file created in MS Publisher, but am now attempting to create an index file. I searched on the web and found this reference (presumably for a diferent version of the product, since I cannot see this menu item) :
"Add an index to a PDF
With the document open in Acrobat, choose Advanced > Document Processing > Manage Embedded Index.
In the Manage Embedded Index dialog box, click Embed Index.
Read the messages that appear, and click OK. "
There is no such menu path in the application that I am evaluating (Adobe Acrobat X), nor can I see it in the "Tools" pane. I am attempting to take a series if .pub files, import them into .pdf format, then create an index on all of these files (for use both in a soft copy search function, and a printable index for a hard copy format).
Subject to being able to perform this and some other functions, we are intending to purchase the product for our annual publications.
http://forums.adobe.com/message/3355370#3355370
Thanks for any help. My specialty is economics and numbers, so I'm very much a newby at publications.
Bruce."Index" in context of PDFs/Acrobat means PDF page content indexed to support advanced search.
Not at all the traditional "index" found at the end of hard copy text.
Unlike MS Word, MS Publisher does not provide the traditional "Index" feature.
You might need to investigate if MS Word (or some third-party Index application) could interface with the Publisher files such that the traditional Index you desire could be built. An index, in a Word file, can be part of the created PDF(s) page content.
However, an MS Word generated index does not use Word's "Hyperlink" feature - so, no links within the Word file and thus no link(s) in the PDF.
To get to Acrobat X's "Index" feature:
(Also described in Acrobat X on line Help)
Open Acrobat X's Tools pane. If a sub-pane titled "Document Processing" is present then expand it.
If not present then, on the right side of the gray ribbon just under Tools | Comment | Share click on the icon.
Select "Document Processing" from the associated menu.
In the expanded Document Processing sub-pane the bottom two entries are associated with the Index feature.
In context of having several PDFs from the PUB files a cataloged index might be more useful.
Be well... -
Position change of function buttons in Layout sheet
Hi Experts,
In my planning layout, the planning function buttons like copy and delete push buttons are close to each other.So if i want to arrange them logically related close to each other, how i can do that ?
Thanks.Hi,
This is in BI WAD template I assume? If you are looking for rearraging multiple buttons you have created using Button Group Item, you can do that in the properties of the button group item (arrows to move button up and down). The buttons in one button group item always appear close by to each other so if you are looking at more space or arranging them on the page, use multiple button group items and arrange them using container layout item(s). -
How Indexing function in Oracle UCM 11g
Hello All,
I am using Oracle UCM 11g on Windows platform.
I wanted to know as how the indexing in Oracle UCM Funtions? Here are few more questions related to this.
1. If multiple language characters are added in document and if document is indexed, then
how the data (tokens) will be stored in Database?
2. How the search will functionHi
1. If multiple language characters are added in document and if document is indexed, then
a. how the data (tokens) will be stored in Database?
This is stored in the DB tables IdcColl1 or IdcColl2 ( if DB FullText is search indexer engine) and table would be IdcText1 or IdcText2(if OracleTextSearch indexer is used) . It is these tables that store the entire data from the contents and they are referred to / queried when a FT search is invoked from UCM .
b. how indexing will be done?
Indexer would extract all the data from the contents in case of FT indexer mechanism and would store them in the DB tables mentioned above . It is stored in BLOB columns where in the extraction process would do an insert for every content item that is being processed when Collection Rebuild Cycle / Automatic Update cycle is started .
2. What is settings to be done in Oracle and search engine for this?
For DB the relevant UCM scripts need to be executed so that the correct role are created and the packages are created.
3. What will be extra settings need to be done in case if the OS changes for example Linux.
The relevant libraries need to be checked to make sure that indexer can access them since there are lots of dependent libraries for the indexer process which is invoked by the TextExport process and these libraries vary for different OS . As part of the indexer process to be running fine all that needs to be done is to install/enable the OS specific versions of ContentAccess component on UCM .
Hope this gives an understanding on the Indexing part of UCM .
Thanks
Srinath -
Q: Find Peak position of a function
I have a function from a curve fit and I want to find the x locations of
where the peaks (maxima) occur in this function. Is there a LabVIEW vi
that will do this for me?
The way I was thinking of doing it, which sounds like a lot of wasted
computational time, is to basically calculate a certain number of y
values for this function (say 100, 1000, 1000... the higher the number,
the greater the precision of my answer), and find the maximum in that
series of y values. I could maybe do a rough pass with only 100 points
precision, then zoom in on a certain region and do a much higher
precision check (if this will help my function run faster)...
Is this a decent way, or have I missed a VI that will find these peaks for me?
Any help is greatly appreciated!
Brent Kirkwood
[email protected]Brent
In earlier LV versions, these functions were part of the g-math tool kit,
but they are now "incorporated".
Invert your function, then use "find all minima 1D.vi" (IN:
mathematics...optimization).
Look at the example: "Integration, Differentiation, Roots, Maxima, and
Minima for an Equation"
(found in: help...search examples...mathematic...general math..)
HTH
Chrisitan
Brent Kirkwood wrote in message
news:bPBW3.4546$[email protected]..
> I have a function from a curve fit and I want to find the x locations of
> where the peaks (maxima) occur in this function. Is there a LabVIEW vi
> that will do this for me?
> -
Chapter Index function fails to create last three chapters
Hello:
I am using the citylights submenu template to automatically create a set of submenu pages in CS5 on a Mac. I have 21 chapters, so there are three links to fill in per submenu page. Everything works fine except it refuses to create the last submenu page with the last three chapters on it. Can't figure it out!chapter markers
If you used transitions during your slideshow, chapter markers might be your problem. You can't have chapter markers that fall within transitions; the general rule has been 'no chapter markers within two seconds of a transition'.
F Shippey -
FUNCTION-BASED INDEX ( ORACLE 8I NEW FEATURE )
제품 : ORACLE SERVER
작성날짜 : 2004-08-16
FUNCTION-BASED INDEX ( ORACLE 8I NEW FEATURE )
==============================================
SCOPE
10g Standard Edition(10.1.0) 이상 부터 Function-based Index 기능이 지원된다.
Explanation
1. 개요
Function-based index는, 함수(function)이나 수식(expression)으로 계산
된 결과에 대해 인덱스를 생성하여 사용할 수 있는 기능을 제공한다.
질의 수행 시 해당 함수나 수식을 처리하여 결과를 가져 오는 것이 아니라,
인덱스 형태로 존재하는 미리 계산되어 있는 결과를 가지고 처리하므로
성능 향상을 기할 수 있다.
2. 제약사항
1) aggregate function 에 대한 function-based index 생성 불가.
(예 : sum(...) )
2) LOB, REF, nested table 컬럼에 대한 function-based index 생성 불가.
3. 주요 특징
1) cost-based optimizer에 의해 사용됨.
2) B*Tree / bitmap index로 생성 가능.
3) 산술식 (arithmetic expression), PLSQL function, SQL built-in
function 등에 적용 가능.
4) 함수나 수식으로 처리된 결과에 대한 range scan 가능
5) NLS SORT 지원
6) SELECT/DELETE를 할 때마다 함수나 수식의 결과를 계산하는 것이 아니라
INSERT/UPDATE 시 계산된 값을 인덱스에 저장.
7) 질의 속도 향상
8) object column이나 REF column에 대해서는 해당 object에 정의된
method에 대해 function-based index 생성 가능.
4. 생성 방법
CREATE [UNIQUE | BITMAP ] INDEX <index_name>
ON <tablename> (<index-expression-list>)
<index-expression-list> -> { <column_name> | <column_expression> }
예) CREATE INDEX EMP_NAME_INDEX ON EMP (UPPER(ENAME));
CREATE INDEX EMP_SAL_INDEX ON EMP( SAL + COMM, empno);
* Function-based index를 생성하기 위해서는 QUERY REWRITE 권한이
부여 되어 있어야만 한다.
예) GRANT QUERY REWRITE TO SCOTT;
5. Function-Based Index 사용을 위한 사전 작업
1) Function-based index는 cost based optimizer에서만 사용 가능하므로,
테이블에 대해 미리 analyze 해 주는 것이 바람직하다.
그리고 init 파일에서 OPTIMIZER_MODE 를 FIRST_ROWS 나 ALL_ROWS 등으
로 지정하거나 HINT 등을 사용하여 cost based optimizer가 사용되도록
한다.
2) init 파일에서 COMPATIBLE 파라미터 값을 8.1 이상으로 설정되어 있어야
한다.
( 예 : COMPATIBLE = 8.1.6 )
3) session/instance level 에서 QUERY_REWRITE_ENABLED 값이 TRUE 지정
되어 있어야 한다.
( 예 : ALTER SESSION SET QUERY_REWRITE_ENABLED = TRUE; )
6. 예제
1) init 파라미터에서 다음과 같이 지정
compatible = 8.1.6 (반드시 8.1이상이어야 한다)
query_rewrite_enabled = true
query_rewrite_integrity = trusted
2) SCOTT 유저에서 function_based_index 생성
create index idx_emp_lower_ename
on emp
( lower(ename) ) ;
3) EMP table analyze
analyze table emp compute statistics ;
4) PLAN_TABLE 생성
@ ?/rdbms/admin/utlxplan.sql
5) Cost based optimizer 선택
alter session set optimizer_mode = FIRST_ROWS ;
6) Query 실행
explain plan set statement_id='qry1' FOR
select empno, ename
from emp
where lower(ename) = 'ford' ;
7) PLAN 분석
SELECT LPAD(' ',2*level-2)||operation||' '||options||' '||object_name query_plan
FROM plan_table
WHERE statement_id='qry1'
CONNECT BY prior id = parent_id
START WITH id = 0 order by id ;
-> 결과
QUERY_PLAN
SELECT STATEMENT
TABLE ACCESS BY INDEX ROWID EMP
INDEX RANGE SCAN IDX_EMP_LOWER_ENAME
7. 결론
Function-based index는 적절하게 사용될 경우 성능상의 많은 이점을 가져
온다. Oracle8i Designing and Tuning for Performance에서도 가능한 한
Function-based index를 사용하는 것을 권장하고 있으며, LOWER(), UPPER()
등의 함수를 사용하여 불가피하게 FULL TABLE SCAN을 하는 경우에 대해서도
효과적으로 처리해 줄 수 있는 방안이라 할 수 있다.
Reference Documents
-------------------Partha:
From the Oracle8i Administrators Guide:
"Table owners should have EXECUTE privileges on the functions used in function-based indexes.
For the creation of a function-based index in your own schema, you must be
granted the CREATE INDEX and QUERY REWRITE system privileges. To create
the index in another schema or on another schemas tables, you must have the
CREATE ANY INDEX and GLOBAL QUERY REWRITE privileges."
Hope this helps.
Peter -
What function is used to read Angular Position form a Task?
I have created a DAQmx task in MAX. This task configures a counter on a PCI-6259 to take the A and B counts from an encoder and give the Angular Position. What function do I use to read the value since I am no longer reading counts I am reading the position?
Thank you in advance for any advice!
John O'C
Staff Test Systems Engineer
Woodward, Inc.
Skokie, Illinois, USA
"Life is not a journey to the grave with the intention of arriving safely
in a pretty and well preserved body, but rather to skid in broadside,
thoroughly used up, totally worn out, and loudly proclaiming...
Wow...What a Ride!"
Solved!
Go to Solution.Hi Izzy,
I have Created the task in MAX. The task takes input into the counter from an encoder and converts it to angular position. Do I still use the DAQmxReadCounterF64 function to read the counter? I am guessing that I do and that the function returns the angular position rather than the raw counts. Not sure though.
Thanks for taking the time to respond.
Regards-
John O'C
John O'C
Staff Test Systems Engineer
Woodward, Inc.
Skokie, Illinois, USA
"Life is not a journey to the grave with the intention of arriving safely
in a pretty and well preserved body, but rather to skid in broadside,
thoroughly used up, totally worn out, and loudly proclaiming...
Wow...What a Ride!" -
Impdp not importing function based index correctly.
We noticed that a process running in our develop database was running much faster than in the production database. After investigating we found that on the development database the process was using an index on the main large table and on the production database the index was ignored and full table scans of the large table were being used.
The data in the tables was the same, statistics were up-to-date, etc. Looking closer we saw that the index on the production database was function based because it had the DESC keyword on one column in the index. On the development database all columns of the index were ASC and thus it was a "normal" index. This was very confusing since we had just refreshed the development database from production using expdp/impdp. I ran impdp with the sqlfiles option to capture the DDL from the export file for the index in question from the production database:
CREATE UNIQUE INDEX "SYSADM"."PS_SF_1098_ITEM" ON "SYSADM"."PS_SF_1098_ITEM" ("EMPLID", "SF_TIN", "CALENDAR_YEAR", "SEQ_NO" DESC, "DTL_SEQ_NBR")
PCTFREE 10 INITRANS 2 MAXTRANS 255
STORAGE(INITIAL 40960 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "PSINDEX" ;
I then dropped the table/index in the development database and reimported just this one table. Sure enough, the index wasn't created as a function based index (no DESC keyword on SEQ_NO column):
CREATE UNIQUE INDEX "SYSADM"."PS_SF_1098_ITEM" ON "SYSADM"."PS_SF_1098_ITEM" ("EMPLID", "SF_TIN", "CALENDAR_YEAR", "SEQ_NO", "DTL_SEQ_NBR")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 40960 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "PSINDEX" ;
I've researched this extensively and can't find any information on why this is happening. Any ideas before I open a SR?
BTW.... version is 11.1.0.7 patchset 31 on Windows Server 2003. Both dev and prod environments are identical.
Thanks,
DanWorking on something else I noticed the following two "hidden" init.ora parameters in both my dev and production databases:
*._disable_function_based_index=TRUE
*._ignore_desc_in_index=TRUE
The first parameter explains why the index (function based) was being ignored in my production database. The second explains why the index is created without the DESC keyword in my dev database from an export from my prod database. I guess you do learn something new every day :)
These databases are used by Peoplesoft applications and I found several posts saying that function based indexes created by Peoplesoft were causing performance and/or data validity problems and users were instructed to set the above parameters so the FIB's weren't used. So, everything is working as expected/designed. I will contact Peoplesoft Tech Support to see if users are still encouraged to set the above parameters.
Dan -
I have a UDF that converts float data into output, howevere, it add .01 in isolated cases.
The Input is as follows
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_AMT xmlns:ns0="http://test.bob.com">
<SSN>123456789</SSN>
<DATA>PH80.00 170915.76 AAE</DATA>
</ns0:MT_AMT>
The out is as follows
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_AMT1 xmlns:ns0="http://test.bob.com"><SSN>123456789</SSN><DATA>PH 80.00 170915.77AAE </DATA></ns0:MT_AMT1>
The code is as follows
MappingTrace mTrace = container.getTrace();
GlobalContainer globalContainer = container.getGlobalContainer();
globalContainer.setParameter("Value"," ");
//1.Map directly the source data to target data and make changes to below lengths.
StringBuffer sBuf = new StringBuffer(a);
// Correction : Make the length of sBuf equal to 21 in order to reduce the risk of runtime exception
if (sBuf.length() < 21) {
while (sBuf.length() != 21) {
sBuf.append(' ');
//2. Schedule Hours : Format the data into "ZZ9.99" at position 3-8
String substring = sBuf.substring(2, 8);
substring = formatNumber(substring, 4, 6, 2);
sBuf.replace(2, 8, substring);
//3. Base Rate : Format the data into "ZZZZZZ9.99" at position 9-29. The target position will be 9-18
substring = null;
substring = sBuf.substring(8, 29);
substring = formatNumber(substring, 8, 10, 2);
sBuf.replace(8, 18, substring.substring(0, 10));
sBuf.delete(18, 29);
//4. Performance Rating : For now no mapping is defined
//At last append 434 spaces to the record
sBuf = appendSpaces(sBuf, 434);
return sBuf.toString();
/*MappingTrace mTrace = container.getTrace();
/* mTrace.addInfo("Exception thrown = " + ex.getMessage() + ", Legacy Invoice Number: " + globalContainer.getParameter("INVOICENUMBER").toString() + ", " + interfaceName + ", " + lookUp + ", " + lookUpTable + ", " + keyString);
The below Function is for handling Trailer Records
private String trailerRecord(String a, int count) {
//1.Map directly the source data to target data and make changes to below lengths.
StringBuffer sBuf = new StringBuffer(a);
//2.Get the number of records from Global container and fill it at position 1-6
//Subtract 1 to exclude the trailer record
count = count - 1;
Integer counter = new Integer(count);
String substring = counter.toString();
//3.Format the number to ZZZZZ9 format
substring = formatNumber(substring, 7, 6, 0);
sBuf.replace(0, 6, substring.substring(0, 6));
//At last append 449 spaces to the record
sBuf = appendSpaces(sBuf, 449);
return sBuf.toString();
The below Function is for appending trailing spaces to the output record
private StringBuffer appendSpaces(StringBuffer sub, int num) {
for (int i = 0; i < num; i++) {
sub.append(' ');
return sub;
The below Function is for formatting numbers Records
private String formatNumber(
String input,
int position,
int length,
int decPlaces)
throws NumberFormatException {
//17.08.2007 : If empty string has come, send back the same
int int1 = input.lastIndexOf(' ');
int int2 = input.length();
if (int1 == int2) {
return input;
// position = actual position of dec place (e.g.4 for ZZ9.99)
//length = actual length (e.g. 6 for ZZ9.99)
//decPlaces = (e.g. 2 for ZZ9.99)
//First get the input converted into float and back so as to add a decimal sign if it does not exist
float f;
try {
f = Float.parseFloat(input);
} catch (NumberFormatException ex) {
throw new NumberFormatException(
"Exception Occurred:" + ex.getMessage());
StringBuffer sb = new StringBuffer(length);
sb.insert(0, f);
//Identify the position of decimal sign and then shift it gradually
int index = sb.indexOf(".");
if (index < position && index != -1) {
while (index < (position - 1)) {
sb.insert(0, " ");
index = sb.indexOf(".");
/*If there is no decimal sign, put one at the desired position
if(index == -1){
int int1 = Integer.parseInt(input);
sb.ins;
sb.insert(position,".");
//Fill blank spaces after decimal sign with zero
while (sb.length() < length) {
sb.append("0");
return sb.toString();
Any suggestions as to why this occurs? The additional .01.Hi !
Check this:
/people/thorsten.nordholmsbirk/blog/2006/04/03/never-ever-use-xis-built-in-arithmetic-functions
how to Convert the STRING TO FLOAT.
Regards,
Matias
ps: please award points if helpful -
Position button at the end of ALV grid
Hi,
I have a requirement to place position button (like in OB52 or any table/view maintenance ) to search and position the record on the top of list. I have placed the position pushbutton with function code and have called TABLE_GET_KEY_TO_SET_CUR_ROW for the input . My alv grid doesn't show the toolbar till the records cross one page. can you please suggest 1- how to make the scrollbar visible always ? 2- How to make the position button work as in tables for ALV grid?
Regards,
GarimaI have created the pushbutton in the same screen as container and assigned a function code. I have put this logic in user-command for this button and refreshed display. But it doesn't work, moreover the scrollbar is not visible if the records are less than one page.
MODULE USER_COMMAND_0100 INPUT.
CASE SY-UCOMM.
WHEN '&BACK&'.
LEAVE TO SCREEN 0.
WHEN '&EXIT&'.
LEAVE PROGRAM.
WHEN '&POSI&'.
DATA: LV_EBELN(15) TYPE C,
IT_EXCL TYPE VIMEXCLFLD OCCURS 0,
WA_EXCL TYPE VIMEXCLFLD,
LV_PO TYPE EKKO-EBELN.
DATA: LT_CELL1 TYPE TABLE OF LVC_S_ROID,
LS_ROW_ID TYPE LVC_S_ROID,
LS_COL_ID TYPE LVC_S_COL.
DATA: LWA_CELL1 LIKE LINE OF LT_CELL1.
WA_EXCL-FIELDNAME = 'MANDT'.
APPEND WA_EXCL TO IT_EXCL.
CALL FUNCTION 'TABLE_GET_KEY_TO_SET_CUR_ROW'
EXPORTING
TABLE = 'EKKO'
IMPORTING
TABLE_KEY = LV_EBELN
TABLES
EXCLUDE_FIELDS = IT_EXCL
EXCEPTIONS
CANCELLED_BY_USER = 1
TABLE_NOT_FOUND = 2
OTHERS = 3.
IF SY-SUBRC EQ 0.
SHIFT LV_EBELN LEFT DELETING LEADING SPACE.
MOVE LV_EBELN+0(10) TO LV_PO.
READ TABLE GT_FINAL INTO WA_FINAL WITH KEY EBELN = LV_PO.
CALL METHOD R_GRID->GET_SCROLL_INFO_VIA_ID
iMPORTING
ES_ROW_NO = LS_ROW_ID
ES_COL_INFO = LS_COL_ID.
LS_ROW_ID-ROW_ID = sy-tabix.
LS_COL_ID-FIELDNAME = 'EKGRP'.
data: ls_row type LVC_S_ROW,
ls_col type LVC_S_COL.
ls_row-index = 2.
CALL METHOD r_grid->set_scroll_info_via_id
EXPORTING
IS_ROW_INFO = ls_row
is_col_info = ls_col.
ENDIF.
**Row and column of the alv are refreshed after changing values
STABLE-ROW = 'X'.
STABLE-COL = 'X'.
*REfreshed ALV display with the changed values
*This ALV is non editable and contains new values
CALL METHOD R_GRID->REFRESH_TABLE_DISPLAY
EXPORTING
IS_STABLE = STABLE
EXCEPTIONS
FINISHED = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Please help!!
Maybe you are looking for
-
Transfer app from one Microsoft account to another?
Hello there! I'm looking for a way to transfer an app from one Microsoft account to another, and couldn't find any documentation about it. Is this possible, and if so, can you point me into the right direction? Thanks!
-
How it it I have 550 songs on my nano but only 269 show up in itunes without playlists? How do I get all 550 songs and playlists back into itunes? Also when i click on "computer" the nano icon is up for about 5s then goes away and I can't find it...
-
How to get filename from mail attachment
Hi all, I have a XI scenario Mail->XI->RFC. I have created my own adapter module which handle all attachments from incoming mail. Everything work fine, but in my module I try to get information about filename of mail attachment. I use getContentType(
-
Can't print to edge of #10 envelope
I'm using Adobe ReaderX 10.1.9. When I print a #10 evelope to my MFC 6710DW Brother Injet there is a 13/16" margin which cuts off about 25% my return address on the left edge of the envelope. How do I get it to print to the edge of the envelope or
-
Having trouble playing burned cds on other than pc?
I have finally figured out how to download tunes that I have downloaded from Itunes onto a cd... However, when I go to play them I can play them on my manual cd player ( hand held ) and the PC but when I go to play them in my cd player in the car - t