Dynamic subroutine call
how to perform dynamic subroutine call
Hi,
In the Program where you are writing the PERFORM statement: write as below:
PERFORM <Subroutine Name>(give the other Program name where this subroutine has to be called dynamically) USING <paramters>.
In the Other program you will just call this perform with FORM... ENDFORM...
The PERFORM will not appear in that program.
Regards,
Anji
Similar Messages
-
Dynamic method calls in bounded task flows?
Hi!
I have the following scenario:
We are developing a framework in which we would include modules as ADF libraries (as JAR files) with bounded task flows. This framework contains a bean class with bindings for some UI components in framework which I enable or disable (depends on user action). That is the main reason bean class should be present in framework application.
I have a bounded task flow in every module which needs to call a method in bean with UI component's bindings that would enable or disable that component.
How can I achieve that? To pass bean as a parameter into bounded task flow and then call its methods? That is dynamic method calls for bean.
I'm using JDeveloper 11.1.2.1.0
Thanks for your help
Regards, MarkoHi,
I explained this; +"I have a bounded task flow in every module which needs to call a method in bean with UI component's bindings that would enable or disable that component. How can I achieve that? To pass bean as a parameter into bounded task flow and then call its methods?"+ a couple of times already (not sure if it was all for you) and don't think I change my position here. I also explained how to use a ValueExpression to lookp a managed bean containing component bindings (should be in requestscope).
Frank -
OSB Dynamic service call or dynamic route and transactions
Hello,
I've got the following problem in my OSB architecture for asynchronous incomming services.
OSB version is 10.3.1
ConnectionFactory is XA
Problem domain:
Dynamic service call or dynamic route within transaction boundary
Elements within transaction:
1. JMS Queue ->
2. Upper Proxy Service (De-queue) ->
3. Lower Proxy Service (Canonical Service) ->
4. Business Service (Data Service) ->
5. Database Adapter->
6. Database
Dynamic element
Upper Proxy Service (De-Queue) must be able to determine which Lower Proxy Service (Canonical Service) has to be called on the basis of the message taken from the JMS Queue without losing the transaction (this doesn’t work yet).
Already tried possible solutions:
• Make a service call dynamic by setting the $inbound name attribute. This results in a this property is read-only error.
• Use a Dynamic route instead of a service-call. This results in a loss of transaction. The message is deleted from the Queue without taking failure or success into account.
• Use a Dynamic route with a quality of service set to exactly once in the header. This seems to be ignored, results in a loss of transaction.
• Use a Dynamic route with an explicit reply with failure for errors. Results in a loss of transaction.
• Use a Dynamic Publish. This doesn’t fit the required flow because it has no response.
I hope someone can shed some light on this because I'm at a total loss. I found some references in the forum to what seems to be the same problem but without definite answers. A work-around is also a viable answer.
Regards,
Bas MulHi,
I'll try to clarify.
Upper proxy dequeues a message.
Depending on a value of a specific tag within the message a canonical proxy service (out of 5 at the moment but this numer could increase) has to be called (and be dynamic transform transformed to the format of the specific canonical).
The canonical service must then pass the message to a database adaper's business service which is responsible for the database insert/update/read.
If something in the chain from dequeue to database action goes wrong the message may not dissapear from the queue.
Somehow a dynamic route in the message flow between dequeue proxy and canonical proxy breaks the transaction.
Bas -
Type conflict during dynamic method call.
While executing the following program I get the error "Type conflict during dynamic method call.":
DATA: container_r TYPE REF TO object,
grid_r TYPE REF TO object,
itab_saplane TYPE TABLE OF saplane.
* IMPORTANT NOTE: class names must be in UPPER CASE
DATA: str_cnt TYPE seoclsname VALUE 'CL_GUI_CUSTOM_CONTAINER',
str_gui TYPE seoclsname VALUE 'CL_GUI_ALV_GRID',
meth_name TYPE STRING VALUE 'SET_TABLE_FOR_FIRST_DISPLAY'.
TYPE-POOLS abap.
DATA: ptab TYPE abap_parmbind_tab,
wa_ptab LIKE LINE OF ptab,
ref TYPE REF TO data.
CREATE OBJECT container_r TYPE (str_cnt)
EXPORTING container_name = 'CUSTOM_CONTROL1'. " Name of the custom control area (UC!)
* Construct parameter itab
GET REFERENCE OF container_r INTO ref.
wa_ptab-name = 'I_PARENT'. " Must be upper-case
wa_ptab-value = ref.
INSERT wa_ptab INTO TABLE ptab.
* EXPORTING i_parent = container_r.
CREATE OBJECT grid_r TYPE (str_gui)
PARAMETER-TABLE ptab.
SELECT * FROM saplane INTO CORRESPONDING FIELDS OF TABLE itab_saplane.
* Cannot call set_table_for_first_display directly...
CALL METHOD grid_r->(meth_name)
EXPORTING I_STRUCTURE_NAME = 'SAPLANE' " Type of the rows in the internal table (UC!)
CHANGING IT_OUTTAB = itab_saplane. " The internal table itself
CALL SCREEN 100.
Any help would be appreciated!Hi ...
Apologies ... for confusion ... actually both are required ...
the type 'E' as well as CL_GUI_CONTAINER.
The below code worked for me ...
check out how I cast it to the parent class type ...
DATA : lv_container TYPE seoclsname VALUE 'CL_GUI_CUSTOM_CONTAINER',
lv_control TYPE seoclsname VALUE 'CL_GUI_ALV_GRID',
lv_method TYPE string VALUE 'SET_TABLE_FOR_FIRST_DISPLAY',
lt_par_tab TYPE abap_parmbind_tab,
ls_param LIKE LINE OF lt_par_tab,
lref_cont TYPE REF TO cl_gui_container,
lv_data TYPE REF TO data.
CREATE OBJECT lref_container
TYPE
(lv_container)
EXPORTING
container_name = 'ALV_AREA'.
ls_param-name = 'I_PARENT'.
ls_param-kind = 'E'.
lref_cont ?= lref_container.
GET REFERENCE OF lref_cont INTO lv_data.
ls_param-value = lv_data.
INSERT ls_param INTO TABLE lt_par_tab.
** Now create ALV Control.
CREATE OBJECT lref_alv_ctrl
TYPE
(lv_control)
PARAMETER-TABLE
lt_par_tab.
** Set table for 1st display
DATA : lv.
lv = lref_alv_ctrl->mc_fc_print.
CALL METHOD lref_alv_ctrl->(lv_method)
EXPORTING
i_structure_name = 'T001'
CHANGING
it_outtab = lt_company.
Cheers
Edited by: Varun Verma on Aug 12, 2008 4:19 PM -
Static verse dynamic dispatch call
I'm just getting started with creating my own lab view classes using the class object but I'm having trouble with some of the basic concepts. Are there any good tutorials or knowledge base articles which talk about how to create and use LabVIEW classes? I'm getting hung on static verses dynamic dispatch calls specifically.
Any help would be appreciated!
Thank you,
CraigI'm still getting a handle on LVOOP myself.
Those two different methods control which VI actually gets called when your app is running.
THe static method is very similar to calling a normal sub-VI in LV except you are passing LVOOP data.
The dynamic comes into play when you have more than one class and one is a child of the other. In that case you can create a VI for the child that has the same name as a VI in the parent, but because it has different data, the data it accepts and return is different. This OTHER VI in the child will under the right condition be called instead of the VI in the parent. I understand this to be concidered over-riding. Which versino will be called? It is dicated by the data you pass to the sub_VI call. If you pass the parent data, the parent versino will be called and vise versa.
So the VI to call is determined at run-time depending on the data.
I hope I got that right!
Ben
Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction -
PL/SQL Dynamic procedure call - arrays
I'm having a lot trouble dynamically calling procedures that have an array as a parameter value. It looks like it's not possible as I'm getting the deadly 'PLS-00707 unsupported construct or internal error [num]' message.
Is that true, that I can't pass an array in a dynamic procedure call?
The example procedure I'm calling is,
PROCEDURE test(pusr in NUMBER,
ptble IN VARCHAR2,
prprt IN VARCHAR2,
pccyy IN VARCHAR2,
parea IN VARCHAR2,
pregn IN VARCHAR2 DEFAULT null,
poffc IN VARCHAR2 DEFAULT null,
ptime IN VARCHAR2,
pmnth IN NUMBER DEFAULT null,
pqrtr IN NUMBER DEFAULT null,
prow IN VARCHAR2 DEFAULT null,
carray IN array_pcat)
If I call it like this it works fine.
uwsdm_web.test(pusr=> 100,
ptble=>'mic',
prprt=>'MIC3',
pccyy=>'1999',
parea=>'Statewide',
pregn=>'0',
poffc=>'0',
ptime=>'Year',
pmnth=>0,
pqrtr=>0,
prow=>'1,2,3,4',
parray=> carray);
where carray is the array.
If I change the carray to a value (numeric or character), I get a "PLS-00306: wrong number or types of arguments in call to 'TEST'" error. Efforts to pass multiple values also failed.
If I try to dynamically create the query and pass in the variable of carray, I run into similar problems because it's trying to allocate an array to one line of code.
Any suggestions?
Thanks.
Kurt
nullApologizes for disturbing you,
as soon as I posted my question, I realized that there were some problems with the sintaxis I was using. Thank you very much and please excuse me for that silly question...
Miguel-Angel -
Input data during dynamic vi call
Hi guys. Is it possible to input data during a dynamic VI call?
For eg, i have a car.vi When i call this vi dynamically, i want to also input the value turn left or turn right. How do i acheive this in LV?hi there
use a invoke node on the VIs reference and call the "Set control value" method to set values of controls during execution of the dynamic VI. Use "Get control value" to retrieve values from indicators.
another possible solution would be the usage of a so called LV2 style global a.k.a. FGV (functional global variable). this needs more drawing but is much more efficient and powerful.
DO NOT use simple global variables.
Best regards
chris
CL(A)Dly bending G-Force with LabVIEW
famous last words: "oh my god, it is full of stars!" -
hii guys,
1. provide me a example program for subroutine call
2. as i want add fielda in form
3.provide me driver program not only step or u provide me
1. driver program
2. field i want to add in driver program as well as in form.
3. steps by step.
regards
rahulHi
No need of touching the original Driver program
Write a perform in Script and program in SE38 and do
see the examples
How to call a subroutine form SAPscripts
The Form :
/:PERFORM CDE_CENT IN PROGRAM ZKRPMM_PERFORM_Z1MEDRUCK
/:USING &EKKO-EBELN&
/:CHANGING &CDECENT&
/:ENDPERFORM
The report :
REPORT zkrpmm_perform_z1medruck .
DATA : BEGIN OF it_input_table OCCURS 10.
INCLUDE STRUCTURE itcsy.
DATA : END OF it_input_table.
déclaration de la table output_table contenant les
variables exportées
DATA : BEGIN OF it_output_table OCCURS 0.
INCLUDE STRUCTURE itcsy.
DATA : END OF it_output_table.
DATA : w_ebeln LIKE ekko-ebeln,
w_vbeln LIKE vbak-vbeln,
w_zcdffa LIKE vbak-zcdffa.
FORM CDE_CENT
FORM cde_cent TABLES input output.
it_input_table[] = input[].
it_output_table[] = output[].
READ TABLE it_input_table INDEX 1.
MOVE it_input_table-value TO w_ebeln.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = w_ebeln
IMPORTING
output = w_ebeln.
SELECT SINGLE zcdffa FROM ekko
INTO w_zcdffa
WHERE ebeln = w_ebeln.
it_output_table-name = 'CDECENT'.
MOVE w_zcdffa TO it_output_table-value.
MODIFY it_output_table INDEX 1.
output[] = it_output_table[].
ENDFORM.
/: PERFORM
/: USING &INVAR1&
/: USING &INVAR2&
/: CHANGING &OUTVAR1&
/: CHANGING &OUTVAR2&
/: ENDPERFORM
INVAR1 and INVAR2 are variable symbols and may be of any of the four SAPscript symbol types.
OUTVAR1 and OUTVAR2 are local text symbols and must therefore be character strings.
Example:
In script form
/: PERFORM READ_TEXTS IN PROGRAM 'Z08M1_FORM_EKFORM1'
/: USING &EKKO-EKORG&
/: USING &EKPO-WERKS&
/: USING &EKKO-EKGRP&
/: USING &EKKO-BSTYP&
/: CHANGING &COMPNAME&
/: CHANGING &SENDADR&
/: CHANGING &INVCADR&
/: CHANGING &COMPADR&
/: CHANGING &COVERLTR&
/: CHANGING &SHIPADR&
/: CHANGING &REMINDER&
/: CHANGING &REJECTION&
/: CHANGING &POSTADR&
/: CHANGING &LOGO&
/: ENDPERFORM
In program
FORM Read_texts - To extract the standard texts from the table *
FORM READ_TEXTS TABLES IN_PAR STRUCTURE ITCSY
OUT_PAR STRUCTURE ITCSY.
DATA : L_EKORG TYPE EKORG,
L_WERKS TYPE WERKS_D,
L_BSTYP TYPE BSTYP,
L_EKGRP TYPE BKGRP.
READ TABLE IN_PAR WITH KEY 'EKKO-EKORG' .
CHECK SY-SUBRC = 0.
L_EKORG = IN_PAR-VALUE.
READ TABLE IN_PAR WITH KEY 'EKPO-WERKS' .
CHECK SY-SUBRC = 0.
L_WERKS = IN_PAR-VALUE.
READ TABLE IN_PAR WITH KEY 'EKKO-EKGRP' .
CHECK SY-SUBRC = 0.
L_EKGRP = IN_PAR-VALUE.
READ TABLE IN_PAR WITH KEY 'EKKO-BSTYP' .
CHECK SY-SUBRC = 0.
L_BSTYP = IN_PAR-VALUE.
CLEAR Z08M1_ORG_TEXTS.
SELECT SINGLE * FROM Z08M1_ORG_TEXTS WHERE EKORG = L_EKORG
AND WERKS = L_WERKS
AND EKGRP = L_EKGRP
AND BSTYP = L_BSTYP.
IF SY-SUBRC NE 0.
SELECT SINGLE * FROM Z08M1_ORG_TEXTS WHERE EKORG = L_EKORG
AND WERKS = L_WERKS
AND EKGRP = L_EKGRP
AND BSTYP = SPACE.
ENDIF.
READ TABLE OUT_PAR WITH KEY 'COMPNAME'.
OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_COMP.
MODIFY OUT_PAR INDEX SY-TABIX.
READ TABLE OUT_PAR WITH KEY 'SENDADR'.
OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_ADRS.
MODIFY OUT_PAR INDEX SY-TABIX.
READ TABLE OUT_PAR WITH KEY 'INVCADR'.
OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_INVC.
MODIFY OUT_PAR INDEX SY-TABIX.
READ TABLE OUT_PAR WITH KEY 'COMPADR'.
OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_CPAD.
MODIFY OUT_PAR INDEX SY-TABIX.
READ TABLE OUT_PAR WITH KEY 'COVERLTR'.
OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_COVR.
MODIFY OUT_PAR INDEX SY-TABIX.
READ TABLE OUT_PAR WITH KEY 'SHIPADR'.
OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_SHIP.
MODIFY OUT_PAR INDEX SY-TABIX.
READ TABLE OUT_PAR WITH KEY 'REMINDER'.
OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_RMDR.
MODIFY OUT_PAR INDEX SY-TABIX.
READ TABLE OUT_PAR WITH KEY 'REJECTION'.
OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_RJCT.
MODIFY OUT_PAR INDEX SY-TABIX.
READ TABLE OUT_PAR WITH KEY 'POSTADR'.
OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_POST.
MODIFY OUT_PAR INDEX SY-TABIX.
READ TABLE OUT_PAR WITH KEY 'LOGO'.
OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_LOGO.
MODIFY OUT_PAR INDEX SY-TABIX.
ENDFORM.
REPORT ZMPO1 .
form get_freight tables in_par structure itcsy out_par structure itcsy.
tables: ekko,konv,t685t.
data: begin of itab occurs 0,
ebeln like ekko-ebeln,
knumv like ekko-knumv,
end of itab.
data: begin of itab1 occurs 0,
knumv like konv-knumv,
kposn like konv-kposn,
kschl like konv-kschl,
kbetr like konv-kbetr,
waers like konv-waers,
kwert like konv-kwert,
end of itab1.
data: begin of iout occurs 0,
kschl like konv-kschl,
vtext like t685t-vtext,
kbetr like konv-kbetr,
kwert like konv-kwert,
end of iout.
data v_po like ekko-ebeln.
read table in_par with key 'EKKO-EBELN'.
if sy-subrc = 0.
v_po = in_par-value.
select
ebeln
knumv
from ekko
into table itab
where ebeln = v_po.
if sy-subrc = 0.
loop at itab.
select
knumv
kposn
kschl
kbetr
waers
kwert
into table itab1
from konv
where knumv = itab-knumv and
kappl = 'M'.
endloop.
loop at itab1.
if itab1-kposn <> 0.
select single * from t685t
where kschl = itab1-kschl
and kappl = 'M'
and spras = 'EN'.
iout-vtext = t685t-vtext.
iout-kschl = itab1-kschl.
iout-kbetr = itab1-kbetr.
iout-kwert = itab1-kwert.
append iout.
clear iout.
endif.
endloop.
sort itab1 by kposn.
loop at iout.
sort iout by kschl.
if ( iout-kschl eq 'GSDC' OR
iout-kschl eq 'GSFR' OR
iout-kschl eq 'GSIR' ).
at end of kschl.
read table iout index sy-tabix.
sum.
write:/ iout-kschl,iout-vtext,iout-kwert.
out_par-name = 'A1'.
out_par-value = iout-vtext.
append out_par.
out_par-name = 'A2'.
out_par-value = iout-kwert.
append out_par.
endat.
endif.
endloop.
endif.
endif.
endform.
IN THE FORM I AM WRITING THIS CODE.
/:DEFINE &A1& = ' '
/:DEFINE &A2& = ' '
/:PERFORM GET_FREIGHT IN PROGRAM ZMFORM_PO1
/:USING &EKKO-EBELN&
/:CHANGING &A1&
/:CHANGING &A2&
/:ENDPERFORM
&A1&
&A2&
This Code is to be written in the PO form under ADDRESS window.
/:DEFINE &A1& = ' '
/:DEFINE &A2& = ' '
/:DEFINE &A3& = ' '
/:DEFINE &A4& = ' '
/:DEFINE &A5& = ' '
/:DEFINE &A6& = ' '
/:PERFORM GET_VENDOR IN PROGRAM ZMFORM_PO
/:USING &EKKO-EBELN&
/:CHANGING &A1&
/:CHANGING &A2&
/:CHANGING &A3&
/:CHANGING &A4&
/:CHANGING &A5&
/:CHANGING &A6&
/:ENDPERFORM
&A1&
&A2&
&A3&
&A4&
&A5&
&A6&
Regards
Anji -
Subroutine called from a Dynamic Action.
Calling a subroutine in a program via a dynamic action, works in foreground, but not in background? Any ideas why?
What's a dynamic action and what are you actually trying to achieve?
-
Working with class based exception and dynamic method calls
Hi Gurus,
we just changed out ERP from EHP6 to EHP7.
Since we did so we are facing an issue with an Z-Report we are using quite often.
This reports looks up Workitems and executes the according methods so that we can go into debugging if we were facing any problems or errors.
since the EHP Upgrade this statement has problems:
data: lt_parmbind type abap_parmbind_tab, lt_excpbind type abap_excpbind_tab, lo_runtime type ref to object. call method lo_runtime->(iv_cls_method) parameter-table lt_parmbind exception-table lt_excpbind.this CALL METHOD Statement has Problem with the Exception Table. We are quite often getting DYN_CALL_METH_EXCP_NOT_FOUND short dumps with Exception "CX_SY_DYN_CALL_EXCP_NOT_FOUND".
The system has problems handling the content of lt_excpbind. if i clear this table the CALL METHOD statement works fine.
AS an example we are trying to call /IDXGC/CL_PD_PROCESS_STEPS-->CREATE_DATA. This method has 2 exceptions
/IDXGC/CX_PROCESS_ERROR
Process Layer Exception
CX_BO_TEMPORARY
Temporary Business Exception
The Content of LT_EXCPBIND is
INDEX
NAME
VALUE
2
/IDXGC/CX_PROCESS_ERROR
1
2
CX_BO_TEMPORARY
2
From my point of view the Problem ist, that they are marked as "class based". I think so because if you looked up the SAP Help for the EXCEPTION-TABLE Statement it is written that is statement only works for none-classbased exception.
I think that restriction is quiet clear. But what i am wondering about is.. that restriction also exists for EHP6. And in EHP6 it work. Does anyone know why? Or how i can change me CALL METHOD Statement that i will work again?
Best Regards
UdoClass-based exceptions must be caught using try/catch statement.
Calling dynamically a method catchable exceptions are:
CX_SY_DYN_CALL_EXCP_NOT_FOUND
CX_SY_DYN_CALL_ILLEGAL_CLASS
CX_SY_DYN_CALL_ILLEGAL_METHOD
CX_SY_DYN_CALL_PARAM_MISSING
CX_SY_DYN_CALL_PARAM_NOT_FOUND
CX_SY_REF_IS_INITIAL
Anyway catching cx_root (as shown by Matthias) will catch everything is catchable. -
Updating HTML code dynamically and calling a URL
Hi All,
I have the following requirement -
Consider the below HTML code:
In the above code, the URL >>
https://secure3.i-doxs.net/nytimes/BillaccessView.asp has to be called and this should PICK UP the values from the above code - For example: Client and ABCCO. In other words, the page that is going to be displayed by specifying the URL should use the values that are dynamically generated and specified in the above code.
Please let me know if you have any inputs on how to achieve this.
Best Regards,
RajeevHi there ,
i have a solution for your problem as follows :
Do not mention the action in form tag ; do it as follows .
if you have a submit button then use following code in onclick even of submit as onClick="do_this()" else use onsubmit="do_this()" in <form > tag .
Include the following <script> </script> in Head element .
the JS function do_this should be as follows :
<Script language="JavaScript">
function do_this()
var w_ele;
w_ele = document.getElementById('CLIENT') ;
w_client = w_ele.value ; // this will give u the name entered in client text field ie. ABCCO in this case.
var w_url = "https://secure3.i-doxs.net/nytimes/BillaccessView.asp?w_clien="+ w_client ;
w_form = document.getElementByID('FRM_MAIN');
w_form.action = w_url ;
/*this will call the url as "https://secure3.i-doxs.net/nytimes/BillaccessView.asp?w_client=ABCCO" */
</script>
NOTE :
you need to define ID property for form and text element . currently you have used juse name property .
in the w_url , before' ? ' the name of the parameter in which you want to capture the dynamic client value in target should appear ( i have used w_client just as an example)
so modifications needed in ur HTML as :
<FORM name="frmMain" id="FRM_MAIN" method="POST">
and
<TD> First Name: </TD><TD><INPUT type="text" id="CLIENT" name="Client" value="ABCCO" size="50" maxlength="32"></TD>
I am sure this will solve ur problem as i have done the same thing. if not then feel free to mail me at [email protected]
do reward me points if found useful. -
Why is the template not being used when dynamic page called ?
Hi,
I have created a dynamic page and assigned a template to it. When I call the dynamic page using the 'show' procedure from a form, I do not see the template.
Why is the template not being used ? How can I get the template working when I call the dynamic page ?
I even tried to show the page from the dynamic page's manage components tab and there is same problem. Template is not being used.
thanks,
MainakYou can alter the generated package body to include the following function in the header and footer sections.
Header:
PORTAL.wwv_headings.show_header(
p_template => 'PUBLIC.TEMPLATE_3',
p_heading => 'Dynamic Page',
p_help_link => 'PORTAL_DEMO.EXAMPLE_DYNAMIC_PAGE.help',
p_about_link => 'PORTAL_DEMO.EXAMPLE_DYNAMIC_PAGE.about');
Footer:
PORTAL.wwv_headings.show_footer(
p_template => 'PUBLIC.TEMPLATE_3',
p_help_link => 'PORTAL_DEMO.EXAMPLE_DYNAMIC_PAGE.help');
where
<PORTAL_DEMO> indicates application schema
<PORTAL> indicates the name of the portal (normally this will be portal30 by default). -
Dynamic function call in Forms PL/SQL [SOLVED]
I have a 10G form, which has a dropdown list of values. Depending on the value selected, I look up a setup table which will tell me the name of the database package/function to call.
I then want to call that function with a bind IN parameter and then retrieve the function return value (which is a varchar2 containing message(s) as a stream of text) to display to the user.
I have searched high and low and cannot find a good example.
(a) forms_ddl doesn't seem to have the ability
(b) dbms_sql - some forums/blogs warn away from this due to db version dependencies
(c) exec_sql seems to be very basic and more aimed at odbc calls, rather than calls to native oracle db functions.
Here is example pseudo-code of what I am attempting to do on a WHEN-BUTTON-PRESSED trigger
DECLARE
v_Param1 VARCHAR2 := 'myInputValue';
v_FunctionName VARCHAR2 := 'MYDBPKG.MYFUNCTION';
v_DynamicSQL VARCHAR2;
v_Result VARCHAR2;
BEGIN
v_DynamicSQL := 'BEGIN :v_result:='||v_FunctionName||'('||chr(39)||v_Param1||chr(39)||')'; END';
Bind v_result variable;
execute dynamic sql;
message('the resulting text was <'||v_result||'>');
END;
Obviously, my code above has the function name hard-coded, but my real-life code would retrieve this function name from a database table, so I cannot call the function directly in the Forms PL/Sql.
where the db package/function looks like this:
create or replace package MYDBPKG as
function myfunction(I_Param VARCHAR2) return VARCHAR2;
end mydbpkg;
Anybody got a good example ?
Thanks
Alan
Edited by: Alan Lawlor on 11-May-2011 09:34Alan Lawlor wrote:
(a) forms_ddl doesn't seem to have the ability
(b) dbms_sql - some forums/blogs warn away from this due to db version dependencies
(c) exec_sql seems to be very basic and more aimed at odbc calls, rather than calls to native oracle db functions.you forgot
(d): don't use dynamic SQL
As far as I am concerned (from the code I am exposed to) 99,9% of dynamic SQL code is at best used when there is no need for it and at worst it is impemented the most horrific way you can imagine. OK, this is not the entire truth: in 0,4% it is used when there is no need for it, and in the other 0,5% it is used wrong. And in the other 99% it is a combination of both: it is used when there is no need for it plus it is used wrong. So the very best thing you can do is to avoid dynamic SQL.
but my real-life code would retrieve this function name from a database tablePlease don't do that. This is one of the worst things to do. Forget about the fact that it is a big security hole and most certainly will trash the shared pool of the database and bringing your server down. Most important to developers is that it is a hell of a nightmare to maintain and a lot worse to debug.
So seriously think about if you want to go down the Dynamic SQL route.
cheers -
Dynamic variant calling multiple screens
Hi all,
The concerned issue is that i am trying to execute a report( which on execution throws a selection screen) from a program using 'submit' statement passing a variant. along with it iam creating a dynamic varinat using FM RS_CREATE_VARIANT, the variant is being made, but on execution , the program throws an error meassage " invalid variant called'.
This is because the varinat is calling multiple screens , although only one screen number is passed in teh FM,( screen no 0170).
Please tell me the possible solution fr this .
Cheers,
Thanks in advance.Hi,
first try to pass only the static variant with the submit statement and c whether its working properly.
and than check for dynamic variant..
c the difference and let me know what happens ??
thanks
ravi aswani -
Dynamic variant calling multiple selection screens
Hi all,
The concerned issue is that i am trying to execute a report( which on execution throws a selection screen) from a program using 'submit' statement passing a variant. along with it iam creating a dynamic varinat using FM RS_CREATE_VARIANT, the variant is being made, but on execution , the program throws an error meassage " invalid variant called'.
This is because the varinat is calling multiple screens , although only one screen number is passed in teh FM,( screen no 0170).
Please tell me the possible solution fr this .
Cheers,
Thanks in advance.Hi,
first try to pass only the static variant with the submit statement and c whether its working properly.
and than check for dynamic variant..
c the difference and let me know what happens ??
thanks
ravi aswani
Maybe you are looking for
-
Need advice (tutorials)
hi I am new to photoshop.I am interested in learning and doing stuff with images like editing in images by myself.I am a Java Programmer and i would like to go into the field of web designing.i have tried many tutorials and none have seen explai
-
HI I have assinged a new value field to a cost element in PA tranfer structure for FI flow to CO-PA, If do a journal entry, how can i check whether that amount is flowing into the new value field assinged to the cost element on the CO-PA Side. Thank
-
Change default block size on tftp server
Is there a way to change the default block size on the tftp server so that it defaults to 1024 instead of 512 I am aware that the client can accomplish this by: tftp> tsize tftp> blkzise 1024 but I don't want the client to have to enter these additio
-
Fail to install OAS10g Metadata Repository
I'm trying to install a OAS10g Metadata Repository in the database 10.1.0.4 on Solaris 8 . I meet a error : Loading Repository for OracleAS Portal using the specification file /u/app/oracle/product/bi/portal/repca/ptlload.xml Repository Loader action
-
Hello All, We have one requirement to implement one dynamic multi select list. Currently I am creating this list dynamically and assigning VO. But as per new requirement, we need to change this VO to filter or add some new records. Current Code: // C