How to call a query from filter.
can anyone please guide me how i will call a query of query resource in filter. Or i need to access a query resource query in filter java code. I know how to right a query in java code and execute it, but i have some query in query.htm and need to call it in filter, please help me out.
<tr>
<td>name</td><td>queryStr</td><td>parameters</td>
</tr>
<tr>
<td>sampleQuery</td>
<td>Select * from revisions where dDocName = ? and dInDate =?</td>
<td>dDocName varchar
dInDate date</td>
</tr>
DataBinder params = new DataBinder();
params.putLocal("dDocName", "123456789");
params.putLocal("dInDate", "9/5/13 12:58 PM");
m_workspace.createResultSet("sampleQuery", params);
You may need to play with what date format you send into the query.
Jonathan
http://jonathanhult.com
Similar Messages
-
How to call a Query from widget which has mandatory variables/filter values
Dear Gurus,
I want to show data from BI query (BEX) in Wedget, which has variable/ Filter as input parameter. Please tell me how add these parameters while calling query throgh web service.
Regards,
Aslam KhanHi Aslam,
Kindly refer to Page Number 49 u2013 23rd Point and Page 50 and 51 in the SAPEnterpriseWidgetDevelopmentGuide.pdf u2013 Which explains how to pass the Import / input Parameters.
You can also refer these links u2013 [How to pass more than one value in RfcRequest ?;
[how to bind an input field with an rfc input;
Hope it helpsu2026
Regards,
Shilpa B.V -
How to call a query from the backing bean ?
Hi all,
Another question for you guys :
I made a jspx page with an input form and a submit button.
When I click the submit button, the action my_action in my backing bean is executed.
This is the code :
public BindingContainer getBindings() {
return BindingContext.getCurrent().getCurrentBindingsEntry();
public String my_action() {
BindingContainer bindings = getBindings();
OperationBinding operationBinding = bindings.getOperationBinding("EmployeesView");
Object result = operationBinding.execute();
if (!operationBinding.getErrors().isEmpty()) {
return null;
I hoped that the query 'EmployeesView' was executed in this way, but I get the following exception :
java.lang.ClassCastException: oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding cannot be cast to oracle.binding.OperationBinding
So how should I execute the query EmployeesView ?
Second part of the question : What if I typed the name an employee in my form, and I want to
execute a query that selects all the Employees with that name ?
How do I make a query with a variable as input in the WHERE clause ?
Thanks in advance.
Edited by: Facehugger on 7-apr-2010 11:15I'm still trying all the stuff you guys says, but still no result.
This is my backing bean :
+// the button action+
+public String my_action() {+
+// get the selected rows from the multiselect table and store the objectid's in an String array+
RowKeySet rks = graph_table.getSelectedRowKeys();
Iterator itr = rks.iterator();
Object key;
int nbr_objects = 0 , i = 0;
if (rks.size()>0) nbr_objects = rks.size();
+String[] objectid = new String[nbr_objects];+
while(itr.hasNext())
+{+
key = itr.next();
graph_table.setRowKey(key);
Object o = graph_table.getRowData();
JUCtrlHierNodeBinding rowData = (JUCtrlHierNodeBinding) o;
Row row = rowData.getRow();
+objectid[i] = row.getAttribute("Objectid").toString();+
i+;+
+}+
+// now get all the x and y values for these objectid's from the database out of the table history.+
BindingContainer bc = BindingContext.getCurrent().getCurrentBindingsEntry();
for (int j=0 ; j<nbr_objects; j+){+
+// get X and Y values for object number j+
DataPoints history = new DataPoints();
OperationBinding operationBinding = bc.getOperationBinding("retrieveHistory"); ===> operationBinding stays NULL ???+
+operationBinding.getParamsMap().put("OBJECTID", objectid[j]);+
Object retVal = operationBinding.execute();
+// ==> retVal should contain a List of all X and Y values for the provided objectid.+
+// while (retVal has values)+
+// {+
+// List_of_x_values.add(retVal.valueX);+
+// List_of_y_values.add(retVal.valueY);+
+// }+
history.add(List_of_x_values);
history.add(List_of_y_values):
+// call the soap method to do some calculations+
methodname.forecast(history);
+}+
+}+
In my application module :
public void retrieveHistory(String objectid) {
getHistory().setWhereClause("OBJECTID = '" + objectid + "'");
System.out.println("current query : "+getHistory().getQuery());
getHistory().executeQuery();
public ViewObjectImpl getHistory() {+
return (ViewObjectImpl)findViewObject("History");+
The query for the VO History : SELECT * FROM HISTORY
Please anyone ?
Edited by: Facehugger on 9-apr-2010 14:19 -
Call BEX-Query from VBA with BEX-automatic login?
Hi,
I'm trying to call a query from VBA. I have two problems/questions:
1. Automatic login?
I want to do an automatic login. I found this peace of code here, but I get an error:
Public Function LogonToYourBW()
' create Logon & RFC-Handle
logonToBW = False clear connect Flag the flag can be used to find out if connected or not
'load SAP functionality by opening BEX file ( use your installation path)
Workbooks.Open (c:\sappc\bw\sapbex.xla)
With Run("sapbex.xla!sapbexGetConnection") call the connection
' Set the params for Auto logon
.client = YOUR CLIENT NO
.user = YOUR BW USER
.Password = YOUR BW PWD I recommend to create a dummy reporting user for this task
.Language = YOUR LANGUAGE YOU LIKE TO USE FOR QUERY DISPLAY ( i.E. EN)
.SystemNumber = YOUR SYSTEM NO
.ApplicationServer = YOUR SERVER Name OR IP-ADDRESS
.UseSAPLOgonIni = FALSE 'important for automatic connection
.logon 0, True This will provide a dialog to appear
If .IsConnected <> 1 Then
.logon 0, False
If .IsConnected <> 1 Then Exit Function
Else
Set g_oFunction = CreateObject("SAP.Functions")
Set g_oFunction.Connection = g_oConnection
End If
End With
Run "sapbex.xla!sapbexinitConnection" this will enable the connection you just created
logonToBW = True
End Function
The error is by this row:
Set g_oFunction.Connection = g_oConnection
Object is needed! How is the g_oConnection-object defined?
2. How can I pass values for the parameters from VBA?
If I open the query usually from SAP-BEX-Toolbar, after selecting the query, I get a parameter mask, where I must put in a value. How can I this automatize from VBA? Has anybody a short samplecode for that?
Thank you for your help
Stefan
[email protected]Peter and others:
What I really want to do is write a stand-alone application that I can run from windows scheduler that queries our BW for sales data for certain items (in a tabular form) and pulls that data into a VB recordset, or a .NET dataset so that I can insert the rows into another database (SQL Server, or Access) I already know how to do all the data movement to/from datasets and databases I just cannot figure out how to programmatically grab this sales data from BW our company has workbooks already set up that aggregate WW sales information by region (IE, there is a separate workbook for each region of the world) I can manually go into the Excel interface, tell it which items to pull the sales info for, and it dumps the data into the worksheet (organized by customer, and then by cat #)
So, what Id like to do is write an app that will pull data every week or so from the BW (from each regions sales invoice detail workbook), and insert it into another database that we use for reporting other, non-sales, data.
Thoughts on this ? Is there another, non-BEx method that is better ?
thanks !! -
How to call oracle function from ejb3
i'm trying to call an oracle query-function from ejb3.
The oracle function:
create or replace FUNCTION getSecThreadCount(secId in NUMBER,avai in NUMBER)
RETURN SYS_REFCURSOR is cur SYS_REFCURSOR;
m_sql VARCHAR2(250);
BEGIN
m_sql:='select count(thrId) from thread where secId='|| secid||'
and thrAvai='|| avai;
open cur for m_sql;
return cur;
END;
I'v tried several ways to call it,but all failed:
1. the calling code:
public Object getSectionThreadCount(int secId,int avai){
Query query=manager.createNativeQuery("{call getSecThreadCount(?,?) }");
query.setParameter(1, secId);
query.setParameter(2, avai);
return query.getSingleResult();
but i got the exception:
Exception in thread "main" javax.ejb.EJBException: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query; nested exception is: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query
javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query
Caused by: java.sql.SQLException: ORA-06550: row 1, col 7:
PLS-00221: 'GETSECTHREADCOUNT' not procedure or not defined
ORA-06550: row 1, col 7:
PL/SQL: Statement ignored
2. the calling code:
@SqlResultSetMapping(name = "getSecThreadCount_Mapping")
@NamedNativeQuery(name = "getSecThreadCount",
query = "{?=call getSecThreadCount(:secId,:avai)}",
resultSetMapping = "getSecThreadCount_Mapping",
hints = {@QueryHint(name = "org.hibernate.callable", value = "true"),
@QueryHint(name = "org.hibernate.readOnly", value = "true")})
public Object getSectionThreadCount(int secId,int avai){
Query query=manager.createNamedQuery("getSecThreadCount");
query.setParameter("secId", secId);
query.setParameter("avai", avai);
return query.getSingleResult();
but i run into the exception:
Exception in thread "main" javax.ejb.EJBException: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query; nested exception is: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query
javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query
Caused by: java.sql.SQLException: lost in index IN or OUT parameter:: 3
By the way, i have successfully called the function from hibernate. And i use oracle 11g, JBoss5 RC1.
Could anyone tell me how to call the function from EJB3?
Thanks.Here's a working model:
package.procedure: (created in example schema scott)
CREATE OR REPLACE package body data_pkg as
type c_refcursor is ref cursor;
-- function that return all emps of a certain dept
function getEmployees ( p_deptId in number
return c_refcursor
is
l_refcursor c_refcursor;
begin
open l_refcursor
for
select e.empno as emp_id
, e.ename as emp_name
, e.job as emp_job
, e.hiredate as emp_hiredate
from emp e
where e.DEPTNO = p_deptId;
return l_refcursor;
end getEmployees;
end data_pkg;
/entity class:
package net.app.entity;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedNativeQuery;
import javax.persistence.QueryHint;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
@SuppressWarnings("serial")
@Entity
@Table (name="emp")
@SequenceGenerator(name = "EmployeeSequence", sequenceName = "emp_seq")
@NamedNativeQuery( name = "getEmpsByDeptId"
, query = "{ ? = call data_pkg.getEmployees(?)}"
, resultClass = Employee.class
, hints = { @QueryHint(name = "org.hibernate.callable", value = "true")
, @QueryHint(name = "org.hibernate.readOnly", value = "true")
public class Employee implements Serializable
@Id
@Column(name="emp_id")
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "EmployeeSequence")
private int id;
@Column(name="emp_name")
private String name;
@Column(name="emp_job")
private String job;
@Column(name="emp_hiredate")
private Date hiredate;
// constructor
public Employee (){}
// getters and setters
public int getId()
return id;
etc...session bean:
package net.app.entity;
import java.util.ArrayList;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import net.app.entity.Employee;
import net.app.iface.ScottAdmin;
@Stateless
public class ScottAdminImpl implements ScottAdmin
@PersistenceContext
private EntityManager entityManager;
@SuppressWarnings("unchecked")
public List<Employee> getEmployeesByDeptId(int deptId)
ArrayList<Employee> empList;
try
Query query = entityManager.createNamedQuery("getEmpsByDeptId");
query.setParameter(1, deptId);
empList = (ArrayList<Employee>) query.getResultList();
return empList;
catch (Exception e)
e.printStackTrace(System.out);
return null;
}client:
package net.app.client;
import java.util.List;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import net.app.entity.Employee;
import net.app.iface.ScottAdmin;
public class ScottClient
public static void main(String[] args)
try
// create local interface
InitialContext ctx = new InitialContext();
ScottAdmin adminInterface = (ScottAdmin) ctx.lookup("ScottAdminImpl/remote");
// select employees by deptno
int deptno = 20;
List<Employee> empList = adminInterface.getEmployeesByDeptId(deptno);
// output
System.out.println("Listing employees:");
for (Employee emp : empList)
System.out.println(emp.getId() + ": " + emp.getName() + ", " + emp.getJob() + ", " + emp.getHiredate());
catch (NamingException e)
e.printStackTrace(System.out);
}Basically you just ignore the refcursor outbound parameter.
This is a stored function, have yet to try outbound refcursor parameters in stored procedures...
Edited by: _Locutus on Apr 2, 2009 2:37 PM -
How to call a form from report? in 6i
How to call a Form from Report? In Developer 6i of oracle. Plz tell me tex.
try this
declare
AppID PLS_INTEGER;
begin
AppID := DDE.App_Begin('ifrun60 module=myform.fmx userid=scott/tiger@mydb maximize=no', DDE.App_Mode_Maximized);
exception when others then
srw.message(1,'Errror');
end;Baig
[My Oracle Blog|http://baigsorcl.blogspot.com/] -
How to call a package from the Report in Oracle Application Express
How to call a package from the Report in Oracle Application Express
Hello,
What do you mean? Something like SELECT mypackage.function( par1, par2) from dual?
Or do you want to execute a procedure when something happens on the page, like clicking a button?
Greetings,
Roel
http://roelhartman.blogspot.com/
You can reward this reply by marking it as either Helpful or Correct ;-) -
How to call business service from xquery transformation in OSB ??
Hi All,
How to call business service from xquery transformation in OSB ??
I need to assign the response variable of Business Service to a target element in XQuery Transformation Mapper file.
It's urgent.
Regards,
Jyoti NayakTransformation is to mapping the source and target of 2 different schemas.
In your case you should have a XQuery transformation between, your Business Service output schema and the target schema.
Thanks,
Vijay -
How to call java program from ABAP
Hi Experts,
My requirement is to call java programs from ABAP. For that i have set up SAP JCO connection by using this link http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/739. [original link is broken] [original link is broken] [original link is broken] Connection gets sucessfully. After this how to call java program from ABAP as per our requirement. Please help me out.
Also i tried this way also.. but while executing the DOS Command line appear & disappear in few seconds. So couldnt see the JAVA output. Please help me out to call java programs in ABAP..
DATA:command TYPE string VALUE 'D:Javajdk1.6.0_20 injavac',
parameter TYPE string VALUE 'D:java MyFirstProgram'.
CALL METHOD cl_gui_frontend_services=>execute
EXPORTING
application = command
parameter = parameter
OPERATION = 'OPEN'
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
bad_parameter = 3
file_not_found = 4
path_not_found = 5
file_extension_unknown = 6
error_execute_failed = 7
OTHERS = 8.
Thanks.This depends on the version of your Netweaver Java AS. If you are running 7.0, you will have to use the Jco framework. The Jco framework is deprecated since 7.1 though. If you want to build a RFC server in 7.1 or higher, it is adviced that you set it up through JRA.
Implement an RFC server in 7.0:
http://help.sap.com/saphelp_nw04/helpdata/en/6a/82343ecc7f892ee10000000a114084/frameset.htm
Implement an RFC server in 7.1 or higher:
http://help.sap.com/saphelp_nwce72/helpdata/en/43/fd063b1f497063e10000000a1553f6/frameset.htm -
How to call the RFC from R/3 to SRM, when we use webdynpro abap? (Urgent)
Hello
We use SRM Server 5.5 with classic scenario.
We want to call RFC in R/3 from webdynpro ABAP.
How can we do that?
We are developing the web report using webdynpro abap.
So we need some of R/3 data such like PR(EBAN)and PO(EKKO,EKPO).
When user choose the search parameter, report diplay the Shopping cart, PR and PO data on webdynpro. So we call the R/3 RFC to display the PR, PO data.
But I tired to call the RFC in R/3, We could not call it.
How to call the RFC from R/3 to SRM, when we use webdynpro abap?
Thank you,
Best Regards,
SH.Hi
<b>Please look at the following threads as well -></b>
WebDynpro in SRM
BAPI's /RFC's in SRM
BAPI to Change Shopping Cart by RFC
SRM60 and webdynpro
Webdynpro Services Exception
WebDynpro using BAPI has an error
SRM60 and webdynpro...
<b>SAP uses META Function modules in SRM to get data from R/3 back-end.</b>
<u>For getting Purchase requistion data, use the function modules -></u>
META_REQUISITION_CHANGE Change purchase requisition
META_REQUISITION_CREATE Create Requisition
META_REQUISITION_DELETE Delete/close purchase requisition
META_REQUISITION_GETDETAIL Display requisition details
META_REQUISITION_GETITEMS Display requisition items
META_REQUISITION_GETRELINFO Get Releasease Info for requisitions
<u>For getting Purchase order data, use the function modules -></u>
META_PO_CREATE Create purchase order
META_PO_DELETE Delete reservation
META_PO_GETDETAIL Display purchase order details
META_PO_GETITEMS Display purchase order items
META_PO_GETRELINFO Display purchase order release information
Hope this will definitely help. Do let me know.
Regards
- Atul -
How to call javascript function from PL/SQL procedure
Can anybody advice me how to call javascript function from PL/SQL procedure in APEX?
Hi,
I have a requirement to call Javascript function inside a After Submit Process.
clear requirement below:
1. User selects set of check boxes [ say user want to save 10 files and ticks 10 checkboxes]
2. user clicks on "save files" button
3. Inside a After submit process, in a loop, i want to call a javascript function for each of the file user want to save with the filename as a parameter.
Hope this clarify U.
Krishna. -
How to call WEB Service From SAP
Hi Friends,
How to call WEB Service From SAP.
Thanks in advance,
Murali Krishna KHi,
if you mean calling a web service in Web Dynpro ABAP, see the <a href="http://help.sap.com/saphelp_nw70/helpdata/en/d7/951b42f828df2ce10000000a1550b0/frameset.htm">documentation</a>, if you mean calling a web service in general, this is not the correct forum. This here is the Web Dynpro ABAP forum, for general questions on ABAP, use the ABAP forum.
Regards, Heidi -
How TO CALL c++ EXECUTABLE FROM XI(VERY iMPORTANT)
hI ALL
pLEASE DO GIVE SUGGESTIONS AND DOCCUMENTATION LINKS THAT <b>HOW TO CALL c++ EXECUTABLE FROM XI</b> .THIS IS VERY IMPORTANT AND YOUR HELP WILL BE REWARDED.
WITH REGARDS
SUBRATO KUNDUHi Subrato,
AFAIK you can call C / C++ methods in Java using Java Native Interface (JNI).
Please refer the following links for how to do the same.
<a href="http://www.nag.com/IndustryArticles/CallingCLibraryRoutinesfromJava.pdf">For C:</a>
<a href="http://www.javaworld.com/javaworld/javatips/jw-javatip17.html">For C++:</a>
Regards,
Ananth -
How to call stored procedure from Pro*C
How to call stored procedure from Pro*C ?
my system spec is SuSE Linux 9.1, gcc version : 3.3.3, oracle : 10g
my Pro*C code is the following..
EXEC SQL EXECUTE
begin
test_procedure();
end;
END-EXEC;
the test_procedure() has a simple update statement. and it works well in SQL Plus consol. but in Pro*C, there is a precompile error.
will anybody help me what is the problem ??I'm in the process of moving C files (with embedded SQL, .PC files) from Unix to Linux. One program I was trying to compile had this piece of code that called an Oracle function (a standalone), which compiled on Unix, but gives errors on Linux:
EXEC SQL EXECUTE
BEGIN
:r_stat := TESTSPEC.WEATHER_CHECK();
END;
END-EXEC;
A call similar to this is in another .PC file which compiled on Linux with no problem. Here is what the ".lis" file had:
Pro*C/C++: Release 10.2.0.1.0 - Production on Mon Jun 12 09:26:08 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Error at line 193, column 5 in file weather_check.pc
193 BEGIN
193 ....1
193 PCC-S-02346, PL/SQL found semantic errors
Error at line 194, column 8 in file weather_check.pc
194 :r_stat := TESTSPEC.WEATHER_CHECK();
194 .......1
194 PLS-S-00000, Statement ignored
Error at line 194, column 18 in file weather_check.pc
194 :r_stat := TESTSPEC.WEATHER_CHECK();
194 .................1
194 PLS-S-00201, identifier 'TESTSPEC.WEATHER_CHECK' must be declared
Pro*C/C++: Release 10.2.0.1.0 - Production on Mon Jun 12 09:26:08 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
System default option values taken from: /oracle_client/product/v10r2/precomp/ad
min/pcscfg.cfg
Error at line 194, column 18 in file weather_check.pc
:r_stat := TESTSPEC.WEATHER_CHECK();
.................1
PLS-S-00201, identifier 'TESTSPEC.WEATHER_CHECK' must be declared
Error at line 194, column 8 in file weather_check.pc
:r_stat := TESTSPEC.WEATHER_CHECK();
.......1
PLS-S-00000, Statement ignored
Semantic error at line 193, column 5, file weather_check.pc:
BEGIN
....1
PCC-S-02346, PL/SQL found semantic errors -
How to call BI report from web dynpro
Hi ,
How to call BI report from webdynpro application and what are the prerequisites for that .
Please provide an example to work with BI application frame UI element
ThanksHi Rajpal,
Please go through this..
calling BI report
Cheers,
Kris.
Maybe you are looking for
-
Safari won't open, just quits before loading. I'm on Yosimite and up to date.
Safari won't open, just quits before loading. I'm on Yosimite and up to date.
-
After downloading iOS 7 on my 4S it shows 8,976 on the email icon. How can I move them all to trash without doing it one at a time?
-
Canon ScanLide 20 does not work under Snowleopard
I have a Canon ScanLide 20 USB and on the official Canon web site, the driver are not available for Mac OS X 10.6. I finished the complete passage to mac last month with an iMac 21,5" following a Macbook 13,1 unibody, now I am a fully Apple, but now
-
Port forwarding 3389 not working!! help!! needed urgently
i am trying to forward the RDP port to a terminal server inside my LAN. but things are not working for me. Router is 801 ISDN my config is.. version 12.1 no service pad service timestamps debug uptime service timestamps log uptime no service password
-
What is the best laptop for a family- value, price,etc?