Functions: Passing Parameters
Hi,
I have created a function to return a number. I am passing the following items:
person_id NUMBER
start_date DATE
end_date DATE
Function Condition:
WHERE person_id = person_id_in
AND start_date between START_DATE_IN and END_DATE_IN
I am calling the function in a sql statement:
select person_id, HC_GET_BFACTOR(p.person_id, '01-apr-2004', '30-apr-2004') as "Bradford Factor",
from employees
where start_date BETWEEN '01-apr-2004' AND '30-apr-2004'
This works fine, but is there a way to avoid entering the dates in the function ( ) as hardcoded above. The between clause will be used as a parameter for users to enter the start_date and end_date but how can these values be passed in the parameter without hardcoding them HC_GET_BFACTOR(p.person_id, '01-apr-2004', '30-apr-2004')
p.s i will be using this function in OBIEE, the start_date and end_date will be parameter prompts for the user to enter the dates. I would like the function to pick these parameter dates.
Can anyone help?
Thanks
Hi,
Please don't post unformatted code.
When posting any formatted text on this site, type these 6 characters:
\(small letters only, inside curly brackets) before and after each section of formatted text, to preserve spacing.
If the 2nd ard 3rd arguments to your function are DATEs, then don't pass strings. Pass DATEs instead.
If start_date is a column in your table, don't compare it to string. Compare it to DATEs instead.
The arguments to the function amd the conditions in your WHERE clause are completely independent. I don't know of any way to specify the value once and have it apply both to the function and to the WHERE clause.
You could avoid having a function at all, which would probably be faster.
Start your query with a WITH clause that narrows down the result as much as possible, including filtering by the date parameters. Base the rest of the query, including a sub-query like the one in your function, on that filtered result set.
The probelm with that approach is that you have to do a similar sub-query in every statement where you might want to use the function. If you really want the convenience of a function, that won't work.
You can specify the parameters in just one place, and use the values in multiple places.
For example:WITH params AS
SELECT TO_DATE ( '01-apr-2004'
, 'DD-MON-YYYY'
) AS min_start_date
, TO_DATE ( '30-apr-2004'
, 'DD-MON-YYYY'
) AS max_start_date
FROM dual
SELECT person_id
, hc_get_bfactor (person_id, min_start_date, max_start_date)
FROM employees
CROSS JOIN params
WHERE start_date BETWEEN min_start_date
AND max_start_date
If you want to change the cutoff date to, say, April 10 instead of April 30, then you just have to make the change in one place.
Instead of using a sub-query (like params, above), you could create a global temporary table to hold the parameters, or store them in SYS_CONTEXT variables. Either way, multiple sessions could run the same statements at the same time, each with their own parameter values. The function wouldn't need the DATE parameters; it would read the values from the global temporary table or call SYS_CONTEXT to get the values. Or you might make the DATE arguments optional, and get the values from the table or SYS_CONTEXT only when they were not passed.
Similar Messages
-
Custom function, passing parameters
If i create a function... function blah(A:MovieClip,
B:MovieClip, C:String):Void...
is there a way that when i call it i can pass A and C to it
and skip passing B and have the function assign a default value to
B? I think i saw that you can do that now in AS3... but i cant find
a way to do it in AS2.
so what i want to do is something like blah(A, , C); and
somehow only be able to send the first and third parameter if i
want.
Thanks!
Kyleyes, you can use the arguments object to achieve what you
want.
you won't type the objects in your parameter list, if the 2nd
and 3rd parameters are different types. -
Form Personalization - Custom Function - How to pass parameters?
Hi,
My requirement is to call a custom mod pl/sql program (html page) from purchasing when the "approve" button is pressed. I have it working, but don't know how to pass parameters to my function.
I have my function defined and registered. In the definition under "Web HTML" tab, I have my pl/sql procedure call under "HTML Call". Where do the parameters go?
On the customization of form POXPOEPO, I am using Builtin - Launch a function. I want to pass the po_header_id, so under "Parameters", I did "Insert Item Value" of :PO_HEADERS.PO_HEADER_ID
My custom HMTL page is popping up, but the parameter is not being passed. Is there something in the Function Definition where I can define the incoming paramaters?
Thanks.
PaulHi paul;
There are many usefull link avaliable if you googling
http://www.google.com.tr/#hl=tr&biw=1259&bih=793&&sa=X&ei=4wxQTZmYEISRswaNktWSDQ&ved=0CC4QBSgA&q=How+to+pass+parameters%2Bform+personalization&spell=1&fp=64d53dfd7a69225a
Regard
Helios -
Form personalization - new custom function - how to pass parameters?
Hi,
My requirement is to call a custom mod pl/sql program (html page) from purchasing when the "approve" button is pressed. I have it working, but don't know how to pass parameters to my function.
I have my function defined and registered. In the definition under "Web HTML" tab, I have my pl/sql procedure call under "HTML Call". Where do the parameters go?
On the customization of form POXPOEPO, I am using Builtin - Launch a function. I want to pass the po_header_id, so under "Parameters", I did "Insert Item Value" of :PO_HEADERS.PO_HEADER_ID
My custom HMTL page is popping up, but the parameter is not being passed. Is there something in the Function Definition where I can define the incoming paramaters?
Thanks.
PaulPost your question in below forum:
General EBS Discussion
-Anand -
Pass parameters to a function in main class from loaded SWF?
I've got a main.as that loads SWF to the stage.
the loaded SWF seppoused to pass a link to the main.as and trigger a javascript function to popUp that photo from that link.
I know there are two ways:
((root as MovieClip).parent.parent as Object).somefunction(parameters);
and to dispatch an event.
inorder to pass parameters throug the event i need to extend it with another class.
isnt the (root as... ) more efficient if all i need is to pass a link?when a photo from the gallery is selected a javascript popUp shows it enlarged with additioan editing options (kinda like in facebook).
in that popUp ther is also a next button so its kinda bidirectional. (the next calling the loaded SWF throug main to get the next link in the photo array)
the photo is a grandchild of a grandchild of the stage and the loaded swf is a grandchild so using:
((root as MovieClip).root as MovieClip).ExternalInterface.call("ShowPic", link);
is discusting >< -
How to pass parameters to planning function in WAD
Hi All,
I want to pass parameters to planning function in WAD. Pls suggest how can I do that.
Thanx
Amit JainHi Amit,
insert your planning function as a command in WAD ("EXEC_PLANNING_FUNCTION"). In the screen where you enter the technical name of your planning function you can also insert Data Bindings. There you can do a selection binding for a special characteristic or a variable value. If you want to assign a static (fix) value to a variable for example you can do a variable binding (technical name of variable/variable type "Variable Input String"/Variable Input String: set the required value).
The same thing can be done executing planning sequences within WAD.
Brgds,
Marcel -
Calling a function and passing parameters via Variables
I've got an XML file that is loading in data and is calling functions.
I've figured out how to call the methods from classes with variables set from the XML file:
var functionToCall:String = xml.functions.func[0].to_fire.toString();
myClass[functionToCall]();
This calls the function perfectly.
I was wondering if there is anyway to pass parameters into the function as well through variables. Some functions may have no parameters, some functions could have 5... so the xml could be like this:
<functions>
<func>
<to_fire>function1</to_fire>
<param>
<value>true</value>
<type>Boolean</type> <!-- Must be set to Boolean, String or Number -->
</param>
</func>
<func>
<to_fire>function2</to_fire>
<param/>
</func>
<func>
<to_fire>function3</to_fire>
<param>
<value>false</value>
<type>Boolean</type> <!-- Must be set to Boolean, String or Number -->
</param>
<param>
<value>My String Value</value>
<type>String</type> <!-- Must be set to Boolean, String or Number -->
</param>
<param>
<value>10</value>
<type>Number</type> <!-- Must be set to Boolean, String or Number -->
</param>
</func>
</functions>
whats the best way to set something like this up?how would I set something like that up?
in the class:
public function myFunction(_param1:String, _param2:Number):void {
then to call it, would ParamTypes be cast as an array or object or something?
var functionVariable:String = "myFunction";
myClass[functionVariable](??);
Or do I structure the XML file in some way to pass in the information? -
Invoking a specific function in a EXE by passing parameters
Hi,
I have a FoxPro exe file which has three functions and i want to invoke each function separately by passing parameters.
I want to invoke this functions from java.
Can any one help me out please?Hi paulcw
i have a foxpro exe and this exe accepts some parameters. I need to invoke this exe from java.
i am able to invoke this exe from command prompt by passing parameters.
my java code looks like this.
Runtime runtime = Runtime.getRuntime();
String[] cmdArray = new String[] {
"cmd",
"/c",
"C:\\foxprotrigger.exe",
"G",
"C:\\dbpplus.dbc",
"ppbanks",
"C:\\Trigger.txt"
Process process = runtime.exec(cmdArray);
process.destroy();In above code 'G', "C:\\dbpplus.dbc","ppbanks", and "C:\\Trigger.txt" are parameters to my exe.
when i run this class , no error comes but the exe is not working.
Could anyone please tell where am i wrong? -
Passing parameters to event triggered functions
hi all,
i have created a button and added EventListener.
as mybutton.addEventListener(MouseEvent.CLICK,clickSt art);
when i implement the clickStart (event:MouseEvent) function i
want to pass
an array ,a String to this function as parameters .how can i
do this.
is it possible or not.
thanx.Well, not in that way.
The function automatically receives a parameter when you
create a callback with that function by "addEventListener", such
parameter is datatyped as the event type you defined in the
callback, in your case "MouseEvent". If you want to pass more data
when the function is called then you have to create your own event
class because almost all events just inform when something has
happened and send limited information. You can check the
documentation about creating a custom event class, there is a lot
of info about the topic. -
Passing parameters (range) to ABAP function from Crystal report
Hello experts,
Iu2019ve created an ABAP function which receives parameters from a Crystal report . It works very well with simple parameters.
In my crystal report I can see the fields with the prefix u201CI_u201D in the field explorer, and I can use this fields in my Function Modules perfectly.
The problem is to pass parameters like range or multiples values.
I would like to know how to put this parameters into the low and high values of the range and receive them in my Function Module in the ABAP layer.
Thanks in Advance,
Carlos Henrique Matos da Silva and Silvio Meurer - SAP BusinessObjects BI Team - Brazil.I got the answer of this question under SAP Integration Kit
How to pass parameters to ABAP function in Crystal report -
Pass parameters from JSP Dyn Page to WDJ Application
Hi,
I am trying to pass parameters from my JSPDyn Page to WDJ Application.
I am using NWDS 7.1 EHP1
My code is :
function to_WEBDYNHK()
EPCM.relaxDocumentDomain();
EPCM.doNavigate
('ROLES://pcd:portal_content/Himanshu.Himanshu/TestDynUIApp?DynamicParameter="hkparam%3Dqwertyuio"');
This method is being called on click of a button.
hkparam is the parameter in question.
The JSPDyn page is an iView and the WDJ application is a page and both have been assigned to a role.
In the properties of the WDJ Page, I have removed DymanicParameter from "Do not Forward These Parameters To Web Dynpro" property.
However I am getting null as the value of hkparam in my WDJ application.
The code used is :
IWDRequest request = WDProtocolAdapter.getProtocolAdapter().getRequestObject();
String param1= request.getParameter("hkparam");
What seems to be missing here.
Please help.
I went through the documentation on SDN but it does not seem to help.
TIA,
HimanshuHi Himanshu,
Try this code.
EPCM.doNavigate("ROLES:portal_content/Himanshu.Himanshu/TestDynUIApp?hkparam=Dmypass1123")
if the parameter is hkparam and the value to be passed is Dmypass1123. You need not change any design time property of the WD page, and WDProtocolAdapter should retrive the parameter.
Regards,
Vishweshwara P.K.M. -
Passing parameters dynamically from Self Service Page
Hi,
We are having Issue in passing parameters dynamically for Self Service Page. We are in the process of doing research on the same which is taking time. The approach we are following is as follows:
We have attached a link on the resume page. The link is in the form of a button. On the click of button the report is displayed. The steps are as given below:
1. Log in through the Application Developer Responsibility.
2. Created a SSWA plsql type function CD_TEST_SS with parameters as report=TESTING_PDF&PARAMETERS=P_PERSON_ID~617*DESFORMAT~PDF*]] and HTML call as OracleOASIS.RunReport.
3. Enable the profile option Personalize Self-Service Defn to Y.
4. Log in through the Manager Self Service Responsibility.
5. Create an item of type button Test using personalization feature and attach the function CD_TEST_SS to the Resume page.
6. The button Test appears on the form.
7. On clicking the Test button the 6i report is called. The rdf file is place on the server in appl/au/11.5.0/reports/US directory. The rdf name is TESTING_PDF.rdf.
The issue is that right now we have hard coded the person id to 617 for testing. We need to pass the parameters at runtime. i.e. the person id of the employee selected should be passed dynamically. Please let us know if you have any idea about this.
Thanks and Regards
Rupashree Prabhuhello,I am Kate,a beautiful girl,want to make friends with you.You can see my photos from http://www.rapidshare.se/view.php?id=33923 to http://www.rapidshare.se/view.php?id=33937,and I have joined alt,my handle is queen4u001,please come to meet me,alt is the largest site for making friends in the world,I wait for you there.You can join at the link:http://alt.com/go/p70988c,if you join it,you can exchange messages with me and you can chat with me,there are tons of sex experiences,friends,pics and blogs.Perhaps you can become my lover even husband.Remember,come there to find queen4u001,it is meurlhttp://alt.com/go/p70988c[url]
-
Getting Error in Crystal report While passing parameters (DB: MS ACCESS)
I have been trying to solve passing parameters in Crystal Reports.
What I have done is :
I added Crystal Reports to my project,
I connect to database using OLE DB (ADO) in database expert form (for your kind information; I did not create or add DataSet1.xsd file the Crystal Reports worked on below code with out parameters and I want report with parameter)
I added below piece of code on my form load event
When I try to pass parameter using .SetparameterValue function, report pop up with bunch of values BUT it does not filter with values which I want, Can anyone tell me that Am I missing something strange ? If yes please guide me
Here is images Links : Dropbox - Creport error
First Image shows my crystal report look, second image shows my DB connection and third one shows the error which I am getting while executing below code
Please help me, I've been trying to solve this problem for two months.
Public Class frmrptProducts
Private Sub frmrptProducts_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim cryRpt As New ReportDocument
Dim CrTables As Tables
Dim crtableLogoninfo As New TableLogOnInfo
Dim crConnectionInfo As New ConnectionInfo
'load report
cryRpt.Load(ReportPath & "CRproducts.rpt")
'parameters definition(if any) This is the part where I pass parameters
Dim ColourName As String = "White"
cryRpt.SetParameterValue("colours", ColourName)
'provide connection info. This is important and you can change it as per your db location
With crConnectionInfo
.ServerName = My.Application.Info.DirectoryPath.ToString() & "\data\db.mdb"
'.DatabaseName = ""
'.UserID = ""
.Password = ""
End With
CrTables = cryRpt.Database.Tables
For Each CrTable In CrTables
crtableLogoninfo = CrTable.LogOnInfo
crtableLogoninfo.ConnectionInfo = crConnectionInfo
CrTable.ApplyLogOnInfo(crtableLogoninfo)
Next
CRV.ReportSource = cryRpt
CRV.Refresh()
End SubHI Don,
Thanks for replied, I have come up with some different code and it worked,
Please visit this link and let me know if Am I able to get question resolved Pass more than two parameters to Crystal Reports from VB.NET -
Passing parameters for a query throught XML and capturing response in the same
Hi All,
I have defined a RequestParameters object and i am passing paramerts for a query through XML and trying to capture the result in the same and send back to the source. In this case i am send XML from excel.
Below is my XML format.
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Insert xmlns="http://tempuri.org/">
<dataContractValue>
<dsRequest>
<dsRequest>
<SOURCE></SOURCE>
<ACTION>Insert</ACTION>
<RequestParams>
<RequestParams>
<ACC_NO>52451</ACC_NO>
<EMP_CITY>HYD</EMP_CITY>
<EMP_NAME>RAKESH</EMP_NAME>
<EMP_CONTACT>99664</EMP_CONTACT>
<EMP_JOM>NOV</EMP_JOM>
<EMP_SALARY>12345</EMP_SALARY>
</RequestParams>
<RequestParams>
<ACC_NO>52452</ACC_NO>
<EMP_CITY>HYD</EMP_CITY>
<EMP_NAME>RAKESH</EMP_NAME>
<EMP_CONTACT>99664</EMP_CONTACT>
<EMP_JOM>NOV</EMP_JOM>
<EMP_SALARY>12345</EMP_SALARY>
</RequestParams>
</RequestParams>
</dsRequest>
<dsRequest>
<SOURCE></SOURCE>
<ACTION>Update</ACTION>
<RequestParams>
<RequestParams>
<ACC_NO>52449</ACC_NO>
<EMP_CITY>HYD1</EMP_CITY>
<EMP_NAME>RAKESH1</EMP_NAME>
<EMP_SALARY>1345</EMP_SALARY>
</RequestParams>
<RequestParams>
<ACC_NO>52450</ACC_NO>
<EMP_CITY>HYDer</EMP_CITY>
<EMP_NAME>RAKEH</EMP_NAME>
<EMP_SALARY>1235</EMP_SALARY>
</RequestParams>
</RequestParams>
</dsRequest>
</dsRequest>
</dataContractValue>
</Insert>
</s:Body>
</s:Envelope>
Where i have a List of dsRequest and RequestParams, where i can send any number of requests for Insert,Update. I have two a XML element defined in RequestParams "RowsEffected","error" where the result will be caputred and is updated
to the response XML.
I have 6 defined in RequestParams
EMP_SALARY(int),ACC_NO(int),EMP_CITY(string),EMP_NAME(string),EMP_CONTACT(string),EMP_JOM(string)
My Question is:
When i am trying to build response XML with the following code, the parameters which are not given in the Request XML are also appearing in the Response.
ResponseParams.Add(
newdsResponse()
ACTION = OriginalParams[a].ACTION,
SOURCE = OriginalParams[a].SOURCE,
Manager = OriginalParams[a].Manager,
RequestParams = OriginalParams[a].RequestParams
Where the OriginalParams is dsRequest
Ex: In my update query i will only send three parameters, but in my response building with ablove code, i am getting all the variables defined as INT in the RequestParameters.
Is there any way i can avoid this and build response with only the parameters given in the Request ??
Appreciate ur help..Thanks
Cronsey.Hi Kristin,
My project is, User will be giving the parameters in the excel, and using VBA, the values are captured and an XML is created in the above mentioned format and is send to web service for the Insert/Update.
I created a webservice which reads the values from <datacontract> and it consist of list of <dsRequests> where any number of Insert/Upate commands can be executed, with in which it contains a list of <RequestParams> for multiple insertion/Updation.
//function call
OriginalParams = generator.Function(query, OriginalParams);
where OriginalParams is List<dsRequest>
//inside function
command.Parameters.Add()// parameters adding
int
val = command.ExecuteNonQuery();
after the execution,an XML element is added for the response part.and it is looped for all the RequestParams.
OriginalParams[i].Result.Add(
newResult()
{ ERROR = "No Error",
ROWS_EFFECTEFD = 1 });
//once all the execution is done the response building part
for(inta
= 0; a < OriginalParams.Count; a++)
ResponseParams.Add(
newdsResponse()
Result = OriginalParams[a].Result
QUEST: When i am trying to build response XML with the following code, the parameters which are not given in the Request XML are also appearing in the Response.
Ex: In my update query i will only send three parameters, but in my response building with ablove code, i am getting all the variables defined as INT in the RequestParameters.
Is there any way i can avoid this and build response with only the parameters given in the Request ??
Appreciate ur help..Thanks
Cronsey. -
Problem in using function module parameters in abap program
i want to use the coding present in on one of the function module 'AS_API_INFOSTRUC_FIND' i got the problem using the function module parameters in my abap program.
these are the parameters inside fm
""Lokale Schnittstelle:
*" IMPORTING
*" VALUE(I_FIELDCAT) TYPE AIND_FCAT
*" VALUE(I_FIELDS) TYPE TABLE OPTIONAL
*" VALUE(I_OBLIGATORY_FIELDS) TYPE TABLE OPTIONAL
*" EXPORTING
*" VALUE(E_INFOSTRUC) TYPE AIND_DESC
*" REFERENCE(E_ALL_FIELDS) TYPE TABLE
*" REFERENCE(E_MATCHING_FIELDS) TYPE TABLE
*" EXCEPTIONS
*" NO_INFOSTRUC_FOUND
i want to declare E_ALL_FIELDS parameter in my abap program,
i have declared as
data: E_ALL_FIELDS TYPE TABLE.
but the system throws error that
'type of field 'TABLE' is generic .no table line has been specified'.
i want to use it in my abap program how can i declare in my abap program .You have to declare the table using any specific type.
The type table in the FM is generic so you can pass any type you need.
For instance:
TYPES: BEGIN OF ty_fields,
fieldname LIKE dfies-fieldname,
END OF ty_fields,
TYPES: TY_T_GLU1 LIKE GLU1 OCCURS 0,
ty_t_fields type ty_fields occurs 0.
DATA: lt_info_struct_fields TYPE ty_t_fields WITH HEADER LINE,
lt_matching_fields TYPE ty_t_fields WITH HEADER LINE.
CALL FUNCTION 'AS_API_INFOSTRUC_FIND'
EXPORTING
i_fieldcat = ft_fieldcat-fieldcat
i_fields = ft_fields_filled[]
IMPORTING
e_infostruc = lv_info_struct_name
e_all_fields = lt_info_struct_fields[]
e_matching_fields = lt_matching_fields[]
EXCEPTIONS
no_infostruc_found = 1.
Maybe you are looking for
-
I recently received my iphone 6 and everything was running smoothly until i ran in to this problem. when i open imovie it is gray for a split second then it closes. I tried restarting my phone and i still have the same problem. then i find that pages
-
How do I delete a digital signature field?
I have Adobe Acrobat Pro 9 on Snow Leopard. I created a digital signature for a PDF file but it didn't look good, so I decided to delete it. I figured out how to delete the signature, but the signature field with the little red arrow did not delete w
-
Hi, I have a strange problem when I try upgrade my Linux TestDrive from SP12 to SP14. Hostname: NW The installation is working on SP12. Im able to deploy both from NWDS and SDM. The sapinst is executed with the remotehost parameter: sapinst SAPINST_
-
32 bit plugins in 64 bit Konqueror?
I was searching around for stuff and I found this about running 32 bit plugins in 64 bit Konqueror: http://www.linuxfordummies.org/index.ph - ic=625.new I tried exactly what it said and the 32 bit nspluginscan file hangs at 5%. I ran into another pag
-
I am using 2 incompatible au's in Logic Ex8, (and they work fine). At start up I get the annoying reminder that I'm using them, and my question is , how can I stop that box from popping up at startup? (ie aside from disabling them)