Help Needed on Read/Modify Line Statement
Hi,
I am writing a report which is having a check box as first column, followed by sales data. I am giving F4 Key to user to Select ALL the check box. I have used Modify Line to do this, but it is not working for me.
Here is the pseudo code which i am using.
Report <report name>.
data cb1 value SPACE.
Write :/ cb1 as CHECKBOX, 'X'.
Write :/ cb1 as CHECKBOX, 'Y'.
Write :/ cb1 as CHECKBOX, 'Z'.
AT PF04.
DO 3 times.
MODIFY LINE sy-index field value cb1 from 'X'.
ENDDO.
This is not working and giving weird results.
I tried the following things too.
Trial a:
cb1 = 'X'.
modify line sy-index field value cb1.
Trial b:
modify line sy-index of current page value cb1 from 'X'.
Trial c:
read line sy-index....
modify line sy-index..
But none of them were working.
Please let me know if my approach to select all check box is correct. Is there any alternate way to select all the checkbox in the list?..What is wrong with my modify line statement.
Regards
Mitesh
Hi Anand,
Thanks for throwing a light on the "Read Statement". This cleared up my concept of modify line too.
When I dont use Read Line, the output will be:
Checked X
Checked X
Checked X
Let me try to answer the question as "Why it is happening".Correct me if i am wrong as i am only 15 days Old for ABAP ;-((.
Here is how I will now defining modify line statement. Modify Line Statement modify the current line or line number n with the value of sy-lisel. With Field Addition in Modify line, you change the content of sy-lisel.
So in our case, the sy-lisel value is (Checked,'X').
So if we dont use read line, only first column will get updated , whereas second field will remain in the sy-lisel.
So to get the value of other lines, we use read line. This will fill up the sy-lisel with the the line content of sy-index and so modify will work.
So, if we are using AT LINE-SELECTION event to select line, in that case, there is no need to do a read line as sy-lisel is already in the buffer.
Please correct me if i am wrong.
Regards
Mitesh
Similar Messages
-
Search help - Need to read dynpro of the calling program
Hello all,
We have a requirement where we need to read the dynpro of the calling program of a search help.
Say I have a screen (selection screen, module pool or ALV grid etc) where I have a field PARTNER with whom a custom search help is attached. But on this same screen there is another field RLTYP. What we want is that when an F4 is taken on PARTNER, the value of RLTYP should also be passed as value to the Search help exit.
In short, we need to read the screen fields of the calling screen of a search help.
Any ideas are appreciated.
Regards
PriyankaCheck the sample code:
FUNCTION F4IF_SHLP_EXIT_OFFRCONT.
""Local interface:
*" TABLES
*" SHLP_TAB TYPE SHLP_DESCT
*" RECORD_TAB STRUCTURE SEAHLPRES
*" CHANGING
*" VALUE(SHLP) TYPE SHLP_DESCR
*" VALUE(CALLCONTROL) LIKE DDSHF4CTRL STRUCTURE DDSHF4CTRL
DATA : ws_flag(1) TYPE c,
ws_rec(1) TYPE c.
DATA : i_dynpfields TYPE dynpread OCCURS 0 WITH HEADER LINE.
DATA : ws_data TYPE ddshiface,
i_data TYPE ddshifaces.
ws_flag = 'X'.
ws_rec = 'X'.
IF ws_flag = 'X'.
i_dynpfields-fieldname = 'P_CUST'.
APPEND i_dynpfields.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-cprog
dynumb = '1000'
TABLES
dynpfields = i_dynpfields
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
invalid_parameter = 7
undefind_error = 8
double_conversion = 9
stepl_not_found = 10
OTHERS = 11.
READ TABLE i_dynpfields WITH KEY fieldname = 'P_CUST'.
ws_data-shlpfield = 'ZCUSTOMER'.
ws_data-valfield = 'G_SIMFIELDS-FIELDNAME'.
ws_data-value = i_dynpfields-fieldvalue.
APPEND ws_data TO i_data.
ws_data-shlpfield = 'ZOFFRCONT'.
ws_data-valfield = 'P_CONT'.
ws_data-f4field = 'X'.
APPEND ws_data TO i_data.
LOOP AT shlp_tab.
IF ws_rec = 'X'.
shlp_tab-interface[] = i_data[].
APPEND shlp_tab.
ws_rec = ' '.
ENDIF.
ENDLOOP.
DELETE shlp_tab INDEX 1.
ws_flag = ' '.
ENDIF.
ENDFUNCTION.
Regards,
Prakash. -
Help needed with Reader Integrated Key
Hi,
I have develop a plug-in and apply for Reader Integrated Key License. This plug-in have been tested with acrobat and reader professional and it is working.
I follow the advice from the above website and use RIKLATools.zip to created the pair.
i have just receive the Reader Integrated Key from Adobe,I tried all method but the key does not work with the plug-in. What is the fool proof way to integrate my Reader Integrated Key with the plug-in to get a digtally signed plug-in?
Urgent help needed as we are submitting the plug-in to client.
many Thanks in advance
Regards
Jia haoThank you lrosenth, i will email them
-
Need help- need to read a customer table from the payroll schema
Hi gurus,
I need to read an amonunt from a customer table in the payroll schema. Is it possible to input TABLE XXXX in the schema, or is impossible to read from a customer table?Do I need to create a report to upload the amount in an infotype?
Thanks in advanced for for support!You should create your own custom operation (based on operation TABLE) to read your custom table from a Payroll PCR.
If your custom table's name is longer than 5 characters, you may be required to use operations VAOFF and/or VALEN prior to your custom operation in the PCR. -
Help needed writing simple PL/SQL statement
Hi,
I need to run the following delete statement in a PL/SQL procedure but for it to commit every 1000 rows or so. Can anyone help?
DELETE
FROM IDIS.YPROCRULES A
WHERE 1 = 1
AND NOT EXISTS (SELECT 'X' FROM IDIS.YPROCCTRL B WHERE A.SEQ_0 = B.SEQ_0)
Thanks
MarkThe fastest most efficient way of doing the delete is to write it in one sql statement as you have done.
Commiting every 1000 rows means you have to use row by row processing. A lot of us call this slow by slow processing.
Every time you commit in a loop , you increase the risk of snapshot too old error, plus you actually slow down the processing, as well as give you issues with regards to what happens if your process fails after x iterations. (some of your data is commited, other data is not, how do you restart the process)
The correct approach is to have appropriately sized rollback/undo segments. -
Urgent help needed with reading data from Cube
Hi Gurus,
Can anyone tell me how to read a value from a record in the CUBE with a key (combination of fields).
Please provide if you have any custome Function Module or piece of code.
Any ideas are highly appreciated.
Thanks,
Regards,
aarthiDue to the nature of the cube design, that would be difficult, that's why there are API's, FMs, and MDX capabilities - to eliminate the need to navigate the physical structure. Otherwise you would have to concern yourself with:
- that there are two fact tables E and F that would need to be read. The Factview could take of this one.
- you would want to be able to read aggregates if they were available.
- the fact table only as DIM IDs or SIDs (for line item dims) to identify the data, not characteristic values. A Dim ID represents a specific combination of characteristic values. -
Hi all,
I am designing a web system that takes paragraph from a user and store it into database so that we can use those later to create a document using different paras from the database so that the user don't have to type anything.
Now i want to approach this as the following:
1. I am taking user input using HTML TEXTAREA because we don't know how long is the para is gonna be.
2. How can receive that TEXTAREA in the next page when the user submit that to the database. Can i use
String para=request.getParameter("astring"); the problem is para size could be anything i don't know what size of data can a string take. So can anyone suggest me what should i use
3. Next. When i receive the para i want to create a TEXT file and store the para AND i will save the name and location of the para in the database rather than the whole para in database.
4. Next when the query made system can show those para by taking the address from the database and then opening the file and copying those data in HTML TEXT area again to show to the user.
Can anyone please help me how can do that.
I really need your help.
ThanksHi,
Sounds like its really big inputs you are expecting. String are objects and have no such restrictions as seen at simple types. To my knowledge Strings have no limits in length.
So use the request.getParameter("string");
Make sure though that your form method id POST.
I think you should make a field in your database to where you can post your text directly. They can be made to contain quite big amount of data. Reading and writing to files are expensive. I'm using Postre and mssql having fields containing up to 15 MB data. Should be suficient in many cases.
Good luck to you -
Help needed regarding reading in a text file and tokenizing strings.
Hello, I require help with a task I've been set, which asks me to read in a text file, and check the contents for errors. The text file contains lines as follows.
surname:forename:1234:01-02-06
I can read in the file, but dont know how to split the strings so each token can be tested (ie numbers in the name tokens)
However, I am not allowed to use regex functions, only those found in java.io.*
I think i should be putting the tokens into an array, but have had no luck so far in doing so. Any help would be appreciated.public class Validator {
public static void main(String args[]) {
String string = "Suname:Forename:1234:01_02-06";
String stringArray[] = string.split(":");
System.out.println (validateLetters(stringArray[0]));//returns true
System.out.println (validateNumbers(stringArray[3]));//returns false
static boolean validateLetters(String s) {
for(int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
if ((c < 'A' || c > 'Z') && (c < 'a' || c > 'z')) {
return false; //return false if one of characters is other than a-z A-Z
}//end if
}//end for
return true;
}//end validateLetters
static boolean validateNumbers(String s) {
for(int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
if ((c < '0' || c > '9') && (c != '-')) {
return false; //return false if one of characters is other than 0-9 or -
}//end if
}//end for
return true;
}//end validateNumbers
} -
Help Needed, problem reading a configuration file in XML form
Hello,
I am using NetBeans 6.5.1 with Apache Tomcat 6.0.18.
I am trying to develop a web application and in my source files I have a thread that loops every second and reads the contents of a configuration file which is in XML form using java.util.Properties.
As soon as I call props.loadFromXML(new FileInputStream(file)); I get several exceptions that I don't know what they mean nor I know how to resolve them.
I would apreciate any help you guys can provide.
Here is what I get in NetBeans:_
Apr 30, 2009 8:56:53 PM com.sun.xml.ws.transport.http.servlet.WSServletDelegate destroy
INFO: WSSERVLET15: JAX-WS servlet destroyed
Apr 30, 2009 8:56:53 PM com.sun.xml.ws.transport.http.servlet.WSServletContextListener contextDestroyed
INFO: WSSERVLET13: JAX-WS context listener destroyed
Apr 30, 2009 8:56:53 PM org.apache.catalina.loader.WebappClassLoader findResourceInternal
INFO: Illegal access: this web application instance has been stopped already. Could not load META-INF/services/javax.xml.parsers.DocumentBuilderFactory. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
Apr 30, 2009 8:56:53 PM org.apache.catalina.loader.WebappClassLoader loadClass
INFO: Illegal access: this web application instance has been stopped already. Could not load com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1273)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
at javax.xml.parsers.FactoryFinder.getProviderClass(FactoryFinder.java:111)
at javax.xml.parsers.FactoryFinder.newInstance(FactoryFinder.java:146)
at javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:233)
at javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderFactory.java:123)
at java.util.XMLUtils.getLoadingDoc(XMLUtils.java:75)
at java.util.XMLUtils.load(XMLUtils.java:57)
at java.util.Properties.loadFromXML(Properties.java:852)
And following the above I get:_
Apr 30, 2009 8:56:53 PM org.apache.catalina.loader.WebappClassLoader loadClass
INFO: Illegal access: this web application instance has been stopped already. Could not load com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1273)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
at javax.xml.parsers.FactoryFinder.getProviderClass(FactoryFinder.java:111)
at javax.xml.parsers.FactoryFinder.newInstance(FactoryFinder.java:146)
at javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:233)
at javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderFactory.java:123)
at java.util.XMLUtils.getLoadingDoc(XMLUtils.java:75)
at java.util.XMLUtils.load(XMLUtils.java:57)
at java.util.Properties.loadFromXML(Properties.java:852)
Thanks in advanced.kimskams wrote:
Very Sorry Problem Remains... I checked Scanner on a Smaller file (to give u fast feedback) but I think the spaces in Small file were normal.. that is why it worked..
In fact I can feel some word on the blank line (hidden words).. its cursor who evidence their presence so Its not working..
Its a big program which is accessing a lexical resource so I think what I copied was Ok..
If u still have some solutions then please tell me otherwise I have to remove these blank lines manually for the time being but its not solution.
I m trying alsoI don't think anyone can give you an answer: people here don't know how your file looks like. Obviously those lines (when the Scanner instance stops reading) are not just empty lines. -
Help needed in reading data from a Crystal Report
I am trying to read data values from a saved crystal report. (groovy code snippet below)
I open a new ReportClientDocument and set the RAS using the inprocConnectionString property.
Then I get the rowsetController and set defaultNumOfBrowsingRecords, rowsetBatchSize and maxNumOfRecords all to 1000000
Using the browseFieldValues method after that returns only 100 records. I want to get all.
ReportClientDocument clientDocSaved;
def pathout=rc.pathToSavedReports+rr.path;
//****** BEGIN OPEN SAVED SNAPSHOT ************
clientDocSaved = new ReportClientDocument();
clientDocSaved.setReportAppServer(ReportClientDocument.inprocConnectionString);
// Open report
println("Reading file in.")
clientDocSaved.open(pathout, OpenReportOptions._openAsReadOnly);
def rowsetController = clientDocSaved.getRowsetController()
rowsetController.setDefaultNumOfBrowsingRecords(1000000)
rowsetController.setRowsetBatchSize(1000000)
rowsetController.setMaxNumOfRecords(1000000)
//setup metadata
IRowsetMetaData rowsetMetaData = new RowsetMetaData()
Fields fields = clientDocSaved.getDataDefController().getDataDefinition().getResultFields()
rowsetMetaData.setDataFields(fields)
def values = rowsetController.browseFieldValues(fields.get(0), 1000000)
values.each{value->
println(value.displayText(new Locale("ENGLISH")))
Before using the browseFieldValues method I was trying to use a rowsetCursor
//get the rowset cursor to navigate through the results
RowsetCursor rowsetCursor = clientDoc.getRowsetController().createCursor(null, rowsetMetaData)
//navigate through the rowset and log the name and value
rowsetCursor.moveTo(0)
while(!rowsetCursor.isEOF()){
Record currentRecord = rowsetCursor.getCurrentRecord()
//println("current record number: " + rowsetCursor.getCurrentRecordNumber())
for(int i=0;i<fields.size();i++){
//println("Column - "+fields.get(i).getName())
if (currentRecord.size()>0){
println(currentRecord.getValue(i))
rowsetCursor.moveNext()
the currentRecord was always an empty list and I did not get any data values at all.
Am I missing something in using these approaches?
I'm fairly new to using the Java SDK for CR. Any help will be greatly appreciated.
Thankshi, I am trying this second method to read the values from report. but all the records comming as null. Kindly help me to resolve this issue.
-
Help needed in forming dynamic insert statement
HI,
I am trying to construct a insert statement as given below.
Please help me as to how to form this and where am i going wrong?
i want the columns names to be auto populated when a table name is given.
output should be like:
==============
insert into tablename
col1,col2,col3..coln)
values
(col1, col2, col3..coln);
declare
v_sql varchar2(5000);
cnt number :=0;
col_count number;
name varchar2(5000);
TYPE string_assarrtype IS TABLE OF VARCHAR2 ( 25 ) INDEX BY VARCHAR2 ( 20 );
arr string_assarrtype;
BEGIN
select count(column_name) into col_count from user_tab_columns
where
table_name = 'PS_D_RE_BCSREGIONMAPPING';
v_sql:='insert into tablename (' ;
for i in 1..arr(col_count)
loop
v_sql:='v_sql' ||' '||arr(i);
DBMS_OUTPUT.PUT_lINE(v_sql);
END LOOP;
END;Below is the actual code which i am trying to write:
Since the below trigger logic is same for around 25/30 tables i wanted to construct a generic procedure which will take input parameter as tablename and auit_table and form the insert statement which will populate the column names which are different for different tables.
Please guide...
CREATE OR REPLACE PROCEDURE make_trigger( tablename in VARCHAR2,
auditable in VARCHAR2
AS
v_sql varchar(10000);
begin
v_sql := 'DROP TRIGGER TRD_D_AUDIT_D'||tablename;
dbms_output.put_line (v_sql );
v_sql:='CREATE OR REPLACE TRIGGER TRG_D_AUDIT_D_'||tablename||' '||
'BEFORE INSERT OR UPDATE OR DELETE ON 'tablename||' '||' REFERENCING OLD AS OLD NEW AS NEW
FOR EACH ROW';
dbms_output.put_line (v_sql );
v_sql:= 'DISABLE
DECLARE
v_Operator psoprdefn.oprid%type;
v_Sysdate Date;
v_Actn varchar2(1);
V_AUDIT_RECNAME PSRECDEFN.RECNAME%type;
BEGIN';
dbms_output.put_line (v_sql );
v_sql:= 'If (Inserting) Then
v_Actn :='||'''||'A'||'''||';'||
'Insert into '||auditable||'
('||
AUDIT_RECNAME,
AUDIT_ACTN,
AUDIT_OPRID,
AUDIT_STAMP,
D_USER_GROUP,
D_GROUP_DESC,
D_BCS_ID,
D_UBR_ID,
D_FILTER_ID,
D_NAME_ACCESS_TYPE,
D_GLOBAL_EMP_LIST
Values
V_AUDIT_RECNAME,
v_Actn,
v_Operator,
v_Sysdate,
:NEW.D_USER_GROUP,
:NEW.D_GROUP_DESC,
:NEW.D_BCS_ID,
:NEW.D_UBR_ID,
:NEW.D_FILTER_ID,
:NEW.D_NAME_ACCESS_TYPE,
:NEW.D_GLOBAL_EMP_LIST
end if;
end;Edited by: user11942774 on Oct 5, 2012 11:46 AM
Edited by: user11942774 on Oct 5, 2012 8:09 PM
Edited by: user11942774 on Oct 5, 2012 8:10 PM -
Urgent Help Needed regd reading a file in apex
Hi all,
I need to know how can we store content of a file in a variable or any item(like text box).
i have a os user name in the file.
when i use apex_util.get_file it is opening in new page.
instead i want it to stored in a text box or any variable.
cany any one help me on this.
Thanks in advance,
Srini
Message was edited by:
user650963Hi Srini,
You can use the normal file upload functionality to do this.
1 - Create a page region and add in a File Browse item - I'll call it P1_FILE_NAME
2 - Create a button in that region, I'll call it P1_UPLOAD_BUTTON, and set it to branch back to the same page
3 - Create a TextArea item - I'll call it P1_FILE_CONTENTS
4 - Create a page process, called P1_UPLOAD_FILE, and triggered by the P1_UPLOAD_BUTTON
5 - Use the follownig code for the process:
declare
v_clob clob;
v_blob blob;
v_varchar2 varchar2(30000);
BEGIN
SELECT blob_content into v_blob FROM APEX_APPLICATION_FILES where name = :P1_FILE_NAME;
v_clob := wwv_flow_utilities.blob_to_clob(v_blob,'utf-8');
:P1_FILE_CONTENTS := wwv_flow_utilities.clob_to_varchar2(v_clob);
:P1_FILE_NAME := '';
delete from APEX_APPLICATION_FILES WHERE NAME = :P1_FILE_NAME;
END;When you select the file and click the Upload button, the file is uploaded into the APEX_APPLICATION_FILES table. The contents of the file is put into a BLOB field. The above code, converts that BLOB into a CLOB and then into a VARCHAR2 value - you can then change P1_FILE_CONTENTS to that value. Finally, the code removes the file from the table and resets the File Browse field.
Note that this assumes that the file contains nothing but text and is no more than 30,000 characters in length.
Andy -
Urgent help needed - writing/ reading to/from file
hi all..
can anyone help me with this problem:
The problem dioscussed in www.javaworld.com forum
any clues what the problem is??hi all...
i managed to get the gui set up, and the JList is finally loading the data,
yet, i am having problems with displaying relevant data of each item in the list...
could you please help??
// required imports
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.event.*;
import java.io.*;
import java.util.*;
// ViewPanel class: the panel for the view pane. handles its own events.
public class ViewPanel extends JPanel implements ListSelectionListener
private JList list;
private DefaultListModel listModel;
private JButton deleteButton;
private TicketStorage data;
// add pane items
private JLabel seat, seatData;
private JLabel name, nameData;
private JLabel duration, durationData;
private JLabel price, priceData;
private JCheckBox waiterService;
// creating panels
JPanel p1 = new JPanel();
JPanel p2 = new JPanel();
public ViewPanel(TicketStorage data)
// store data structure reference
this.data = data;
TrainTicket[] summary = data.summary();
listModel = new DefaultListModel();
for (int i = 0; i < summary.length; i++)
listModel.addElement(summary.getSeat());
list = new JList(listModel);
list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
list.setSelectedIndex(0);
list.setVisibleRowCount(5);
JScrollPane listScroller = new JScrollPane(list);
listScroller.setPreferredSize(new Dimension(100, 150));
seat = new JLabel("Seat No:");
seatData = new JLabel();
name = new JLabel("Name:");
nameData = new JLabel();
duration = new JLabel("Duration:");
durationData = new JLabel();
price = new JLabel("Price:");
priceData = new JLabel();
// create add pane items
waiterService = new JCheckBox("Waiter Srevice");
waiterService.setEnabled(false);
// waiterService.addActionListener(boxListener);
JButton deleteButton = new JButton("Delete");
// deleteButton.addActionListener(buttonListener);
// adding listeners to the components
//deleteButton.addActionListener(this);
//waiterService.addActionListener(this);
list.addListSelectionListener(this);
// adding the components to their coreesponding panels
p1.setLayout(new GridLayout(5,1));
p1.add(seat);
p1.add(name);
p1.add(duration);
p1.add(price);
p1.add(waiterService);
p2.setLayout(new GridLayout(5,1));
p2.add(seatData);
p2.add(nameData);
p2.add(durationData);
p2.add(priceData);
p2.add(deleteButton);
this.setLayout(new GridLayout(1,3,3,0));
this.add(listScroller);
this.add(p1);
this.add(p2);
public void valueChanged(ListSelectionEvent e)
if (e.getValueIsAdjusting() == true)
// enable the delete button when an item is selected
deleteButton.setEnabled(true);
// retrieve the sellected seat number value
String itemSellected = listModel.getElementAt(list.getSelectedIndex()).toString();
// retrieve the ticket with the sellected seat number
TrainTicket tk = data.retrieve(itemSellected);
// load the relevant data of a sellected ticket
seatData.setText(tk.getSeat());
nameData.setText(tk.getName());
durationData.setText(Integer.toString(tk.getDuration()));
priceData.setText(Double.toString(tk.getPrice()));
/*/ if the selected ticket of type first class
if(tk instanceof FirstClassTicket)
if(((FirstClassTicket)tk).getWaiter()==true)
waiterService.setSelected(true);
waiterService.setEnabled(true);
else
waiterService.setSelected(false);
waiterService.setEnabled(true);
else
waiterService.setSelected(false);
waiterService.setEnabled(false);
the application runs, it loads the data available in the linked list,
yet, on switching from an item to another in the list, it keeps generating errors!!!
in addition to the fact that it does not display the data!!
for more info refer to the url in my first post!
any clues?? -
Plesae help- needing to read a blob from db into bytes[]
Hi all,
I am having a requirement to read a blob stored in the oracle table and convert it into bytes. I am loading this table (wwv_flow_files) with APEX.
The code under page 1 is as follows:
DECLARE
z number;
y varchar2(4000);
x varchar2(400);
b blob;
BEGIN
select filename,blob_content into x ,b from APEX_APPLICATION_files where name =:P1_FILE_NAME;
select length(convertBlobToBytes(b)) into z from dual;
:P1_RESULT := z;
end;
Java code is as follows:
import java.io.*;
import java.sql.Blob;
public class convertBlob {
* @param blob
* @return
public static byte[] convertBlobToBytes(Blob blob) {
if (blob==null) return null;
try {
InputStream in = blob.getBinaryStream();
int len = (int) blob.length(); //read as long
long pos = 1; //indexing starts from 1
byte[] bytes = blob.getBytes(pos, len);
in.close();
return bytes;
catch (Exception e) {
System.out.println(e.getMessage());
return null;
PL/SQL wrapper is as follows:
CREATE OR REPLACE FUNCTION convertBlobToBytes(p1 IN BLOB) RETURN LONG RAW AUTHID CURRENT_USER AS LANGUAGE JAVA NAME 'convertBlob.convertBlobToBytes(java.sql.Blob) return byte[]';
I loaded this java class and pl/sql wrapper into the database using JDEVELOPER.
But I am getting the length of the file, as twice the size.
For example, When I run the program which reads the file returns the length of the file as a byte array, the length is 819.
When I pass the same file as a blob from apex, to the java program that converts blob to bytes, the length of the file is 1638.
And hence I am getting wrong results, further in the process.
Can you please help me? Any help is appreciated.
rgds,
Suma.Hi all,
Can any of you please help me out?
rgds,
Suma. -
Hello,
I am having problems reading an exception stack and help would be appreciated.
Following is the exception I get:
Apr 15, 2004 5:18:36 PM com.sun.faces.lifecycle.InvokeApplicationPhase execute
SEVERE: #{OPCAdvancedQueryManagedBean.beanAction}: javax.faces.el.EvaluationException: java.lang.NullPointerException
javax.faces.FacesException: #{OPCAdvancedQueryManagedBean.beanAction}: javax.faces.el.EvaluationException: java.lang.NullPointerException
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:78)
at javax.faces.component.UICommand.broadcast(UICommand.java:312)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:266)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:380)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:75)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:257)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:509)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:184)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:206)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:833)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:732)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:619)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:688)
at java.lang.Thread.run(Thread.java:536)
Caused by: javax.faces.el.EvaluationException: java.lang.NullPointerException
at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:130)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:72)
... 33 more
Caused by: java.lang.NullPointerException
at com.sun.faces.context.SessionMap.put(ExternalContextImpl.java:555)
at com.softwareag.estela.opc.util.OPCSessionUtil.putTResponseIntoSession(OPCSessionUtil.java:35)
at com.softwareag.estela.opc.engine.OPCSearch.execute(OPCSearch.java:47)
at com.softwareag.estela.opc.jsf.OPCAbstractQueryManagedBean.beanAction(OPCAbstractQueryManagedBean.java:71)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:126)
... 34 more
Apr 15, 2004 5:19:25 PM org.apache.catalina.core.StandardContext reload
Julien.Hello all,
I am definitely stuck with this annoying NullPointerException.
I know for a fact that my response object is not null as I can print it out and a !=null test returns true. However I still get this npe exception. Some member variable of the response object must be null.
What's more, from the exception stack, can't we say the problem comes from the managed bean?
Can anyone help?
Here is my code:
public boolean execute() {
OPCServiceLocator service_locator = OPCServiceLocator.getInstance();
//TODO: externalize those two strings
TXMLObjectAccessor xmlObjectAccessor = service_locator.getTXMLObjectAccessor("http://localhost/tamino/prueba_2", "ibermarcreferencec");
TXQuery xquery = TXQuery.newInstance(opcquery.getXQuery() + footer);
try {
TResponse response = xmlObjectAccessor.xquery(xquery);
List list = OPCConvertUtil.convertResponseIntoDisplayableList(response);
if (response.hasQueryContent() && response != null) {
System.out.println("<--within block B-->");
OPCSessionUtil.putTResponseIntoSession(response);//error occurs here
OPCSessionUtil.putSearchResultsIntoSession(list);
System.out.println("<--within block E-->");
return response.hasQueryContent();
} catch (TXQueryException e) {
e.printStackTrace();
return false;
}Julien.
Maybe you are looking for
-
How to PRINT a CD booklet in Indesign CS 5?
I think it's alittle funny that our professor at my 4yr college is teaching us how to make a CD booklet in Indesign using Masterpages and yet he doesn't know how to print it out. Well I'm having trouble printing mine out. I'm making a CD booklet for
-
Photos in Library not showing on Apple TV
Have recently found that new photos I have saved to iphoto that can be viewed on my Mac do not appear in my library on Apple TV. 'Recent Imports', 'events' etc. do not show them. I have tried restarting my Apple TV, switching off and switching back
-
Hi, I have loaded a delta load from the ODS to cube. After the load i found 3 entries for the same purchase orders(available in delta) in the cube instead of a single entry. Can anyone tell why is this hapenning?
-
Hello, i have iphone 4s Outbreak. When I go into iTunes and try to do a backup it gives me an error: this error shows when i tried to backup my iphone and when i tried to restore how can i fix it ? i want to upgrade my ios 6.1.2 to 7
-
Help me..