Urgent: No data while calling remote function in custom widget.
Hi,
I created a function module with transaction se37 and in its attributes checked the 'Remote Enabled' radiobutton.
Now in my widget I called this remote function in my RFC view.
The data is not displayed in the widget and in debug mode error is displayed :
"Type error: data.root has no properties (RFCRequest .js: Line 102 )"
what is the reason for the error ?
or am I going wrong with remote function module call.
regards,
Omkar H. Nakhate
Hi,
Thanks for the information provided.
We are using Eclipse plug in to create the widget
After Debug yahoo widget,
This is my Konfabulator log.
Welcome to Yahoo! Widgets 4.5.1 (build 10A39) on 04/03/08 17:01:44.531
Type '/help' for help.
Loaded Widget 'rfc_call' from C:\Documents and Settings\Administrator\Desktop\new Data\rfc_call\Main.kon
04/03/08 17:01:44.875: rfc_call version is 1
Main.kon (Included file 'js/utils/PlatformUtil.js')
Main.kon (Included file 'js/utils/DomUtil.js')
Main.kon (Included file 'js/utils/CommonUtil.js')
Main.kon (Included file 'js/utils/Common.js')
Main.kon (Included file 'js/utils/Timer.js')
Main.kon (Included file 'js/utils/DataLoader.js')
Main.kon (Included file 'js/utils/RFCRequest.js')
js/utils/PlatformUtil.js (Included file 'js/skinlib/Skin.js')
js/utils/PlatformUtil.js (Included file 'js/skinlib/SkinCell.js')
js/utils/PlatformUtil.js (Included file 'js/skinlib/SkinConfiguration.js')
js/utils/PlatformUtil.js (Included file 'js/skinlib/SkinCustomDraw.js')
js/utils/PlatformUtil.js (Included file 'js/skinlib/SkinImage.js')
js/utils/PlatformUtil.js (Included file 'js/skinlib/SkinInput.js')
js/utils/PlatformUtil.js (Included file 'js/skinlib/SkinList.js')
js/utils/PlatformUtil.js (Included file 'js/skinlib/SkinElementStyle.js')
js/utils/PlatformUtil.js (Included file 'js/skinlib/SkinEvents.js')
js/utils/PlatformUtil.js (Included file 'js/skinlib/SkinComponent.js')
js/utils/PlatformUtil.js (Included file 'js/skinlib/SkinText.js')
js/utils/PlatformUtil.js (Included file 'js/skinlib/SkinLabel.js')
js/utils/PlatformUtil.js (Included file 'js/skinlib/SkinViewDefinition.js')
js/utils/PlatformUtil.js (Included file 'js/skinlib/SkinViewDraw.js')
js/utils/PlatformUtil.js (Included file 'js/skinlib/XmlUtil.js')
js/utils/PlatformUtil.js (Included file 'js/skinlib/ConfigurationReader.js')
js/utils/PlatformUtil.js (Included file 'js/skinlib/SkinUtil.js')
js/utils/PlatformUtil.js (Included file 'js/skinlib/ResourcesReader.js')
js/utils/PlatformUtil.js (Included file 'js/skinlib/ResourceBundle.js')
js/utils/PlatformUtil.js (Included file 'js/skinlib/Components.js')
js/utils/PlatformUtil.js (Included file 'js/skinlib/ComponentEvents.js')
js/utils/PlatformUtil.js (Included file 'js/skinlib/ComponentProperties.js')
js/utils/PlatformUtil.js (Included file 'js/skinlib/WidgetUtil.js')
Main.kon (Included file 'js/skinlib/SkinLib_Include.js')
js/utils/PlatformUtil.js (Included file 'components/c.About/js/c.About.js')
js/utils/PlatformUtil.js (Included file 'components/c.About/js/c.About_Include.js')
js/utils/PlatformUtil.js (Included file 'components/c.Feedback/js/c.Feedback.js')
js/utils/PlatformUtil.js (Included file 'components/c.Feedback/js/Animation.js')
js/utils/PlatformUtil.js (Included file 'components/c.Feedback/js/c.FeedbackController.js')
js/utils/PlatformUtil.js (Included file 'components/c.Feedback/js/c.Feedback_Include.js')
js/utils/PlatformUtil.js (Included file 'components/c.Footer/js/Footer.js')
js/utils/PlatformUtil.js (Included file 'components/c.Footer/js/c.Footer_Include.js')
js/utils/PlatformUtil.js (Included file 'components/c.Header/js/Header.js')
js/utils/PlatformUtil.js (Included file 'components/c.Header/js/c.Header_Include.js')
js/utils/PlatformUtil.js (Included file 'components/c.StartupManager/js/tasks/Task.js')
js/utils/PlatformUtil.js (Included file 'components/c.StartupManager/js/tasks/TaskSet.js')
js/utils/PlatformUtil.js (Included file 'components/c.StartupManager/js/tasks/JavaChecker.js')
js/utils/PlatformUtil.js (Included file 'components/c.StartupManager/js/tasks/FoundationChecker.js')
js/utils/PlatformUtil.js (Included file 'components/c.StartupManager/js/tasks/WidgetDeployer.js')
js/utils/PlatformUtil.js (Included file 'components/c.StartupManager/js/TaskViewer.js')
js/utils/PlatformUtil.js (Included file 'components/c.StartupManager/js/StartupServices.js')
js/utils/PlatformUtil.js (Included file 'components/c.StartupManager/js/ActivityLogger.js')
js/utils/PlatformUtil.js (Included file 'components/c.StartupManager/js/c.StartupManager_Include.js')
js/utils/PlatformUtil.js (Included file 'components/c.Table/js/Table.js')
js/utils/PlatformUtil.js (Included file 'components/c.Table/js/c.Table_Include.js')
js/utils/PlatformUtil.js (Included file 'components/c.TellToFriend/js/c.TellToFriend.js')
js/utils/PlatformUtil.js (Included file 'components/c.TellToFriend/js/c.TellToFriend_Include.js')
js/utils/PlatformUtil.js (Included file 'components/Main/js/controller/Controller.js')
js/utils/PlatformUtil.js (Included file 'components/Main/js/view/View.js')
js/utils/PlatformUtil.js (Included file 'components/Main/js/model/Model.js')
js/utils/PlatformUtil.js (Included file 'components/Main/js/Main_Include.js')
Main.kon (Included file 'components/Main/js/Main.js')
04/03/08 17:01:45.859: Starting deployment
04/03/08 17:01:45.859: Deployment Finished
17:1:46! [Components.create] cAbout : c.About
17:1:46! [Components.create] cFeedback : c.Feedback
17:1:46! [Components.create] cFeedbackHeader : c.Header
17:1:46! [Components.create] cFeedbackFooter : c.Footer
17:1:46! [Components.create] referenced1 : c.Table
17:1:46! [Components.create] cMainHeader : c.Header
17:1:46! [Components.create] cMainFooter : c.Footer
17:1:46! [utils.DataLoader]> open( POST http://127.0.0.1:7531/SapMiddleTier/RESTJSON/ewcs/service/rfct?serviceProvider=&httpMethodOverride=POST true );
17:1:46! [utils.DataLoader]> headerName: Content-Type ; headerSource: text/xml
17:1:46! [utils.DataLoader]> data: <root><RfcRequest name='ZTABLE'><![CDATA[ <T_ROM></T_ROM> ]]></RfcRequest></root>
17:1:52! [utils.DataLoader]> (http://127.0.0.1:7531/SapMiddleTier/RESTJSON/ewcs/service/rfct?serviceProvider=) request returned
TypeError: data.root has no properties (RFCRequest.js: Line 102)
Similar Messages
-
What is the exact syntax for calling remote function module.
Hi to all
1.....what is the exact syntax for calling remote function module.?
Thanks and regards,
k.swaminath reddyhi
good
Lets do simple example where you will first create a RFC in one server (say A) and create normal program in othere server (say B). Finally you will call the RFC in A from B.
Do the following steps for creating RFC in server A.
1. log on to server A
2. go to se37
3. Edit -> function groups-> create function group and give the function group name (say ZGRP).
4. create a FM ( say Z_TEST_RFC) in se37 providing the function group which is created just now.
5. go to attribute tab -> choose remote-enabled module from processing type.
so that your FM will become RFC.
6. provide the import parameter in import tab.
we will provide only two import parameters.
- parameter name : P_NUM1, typing: TYPE, associated type : I & check the pass value (all the parameters of RFC must pass by value).
- parameter name : P_NUM2, typing: TYPE, associated type : I & check the pass value
7. provide the export parameter in export tab.
parameter name : P_SUM, typing: TYPE, associated type : I & check the pass value
8. write the given simple code in source code tab.
FUNCTION Z_TEST_RFC.
P_TOT = P_NUM1 + P_NUM2.
ENDFUNCTION.
Do the following steps for creating ABAP program which will call the RFC in server B.
1. se38 - > creat a program.
2. write the given simple code.
data tot type i.
call function 'Z_TEST_RFC' destination 'XXXXXX'
exporting
p_num1 = 10
p_num2 = 15
importing
p_tot = tot.
write tot.
please note that XXXXXX is RFC connection which is avialable in sm59 transaction in server A.
-go to sm59 - > abap connection (list of RFC connection configurations are avialable). choose server B connection and replace it of XXXXXX in the code.
finally you can execute the normal abap program that will call the RFC and display the result.
reward point if helpful.
thanks
mrutyun^ -
How to compare a parameter while calling a function?
Hello,
I have a powershell script with a function doing a switch process. While calling the function in the script I want to compare if the parameter is contained in the switch condition of the function.
function test{
[CmdletBinding()]
Param(
[Parameter(
Mandatory=$False,
ValueFromPipeline=$True,
ValueFromPipelineByPropertyName=$False
[string]$InputValue
$Param = switch($InputValue){
A {"string1,string2,string3"}
B {"string1,string2,string3"}
C {"string1,string2,string3"}
Return $Param}
If ((test($search)) -match ""){
$scrDynMSGArry = (test($search)).Split(",")
$NV = [PSCustomObject]@{
Param = $ParamString1 = $scrDynMSGArry[0]
String2 = $scrDynMSGArry[1]
String3 = $scrDynMSGArry[2]
Error message is: InvokeMethodOnNull for doing the split and reading the array.
I think there is a problem doing the comparison but have no idea to solve this.
Can anybody help?
Regards, DoreenThis appears to be what you are trying to do:
\_(ツ)_/
From how he is wording things, it sounds to me that if I pass $search the letter F, he wants to check to see if the switch statement contains a case for F, and if not do something. I do not think this can be done but he could always have a Default case,
returning something to indicate they need to choose something else, or the default parameters needed for whatever he is doing to work.
If you find that my post has answered your question, please mark it as the answer. If you find my post to be helpful in anyway, please click vote as helpful.
Don't Retire Technet
She please ;-)
But clayman2 is right: $search can be F, G, ... but I want to use the function "test" only if its A,B or C.
I thought if $search is F it does not enter the if part beacause the condition is not true:
If ((test($search)) -match "")
You think thats not possible?
Would it be better to compare $search with my conditions (A, B or C are defined and known) for itself and then enter the function "test"? Can I have or conditions in the if part like
If ($search -eq "A"){$scrDynMSGArry = (test($search)).Split(",")
$NV = [PSCustomObject]@{
String1 = $scrDynMSGArry[0]
String2= $scrDynMSGArry[1]
String3= $scrDynMSGArry[2]
elseif ($search -eq "B"){$scrDynMSGArry = (test($search)).Split(",")
elseif ($search -eq "C"){$scrDynMSGArry = (test($search)).Split(",") -
Calling Remote Functions Locally Triggers any Database commit(Implicit)
Hello,
Am making use of RFC enabled function module as normal function module (Calling remote function module locally).
My question is does it trigger any implicit database commit or not. Since synchronous RFC triggers database commit.
Regards,
Tenzin ChoegyenI057200 wrote:
Since synchronous RFC triggers database commit.
Let me correct the statement both synchronous as well as asynchronous RFCs trigger an implicit DB commit.
SAP documentation on synch-RFCs states:
If the content of dest is equal to the constant space, then the addition DESTINATION is ignored and a normal call CALL FUNCTION func is executed.
Please note that you should not use the DESTINATION addition or use DESTINATION space. DESTINATION none will start the FM as an RFC in the same app server. -
INTERNAL_SERVER_ERROR while Calling SCMS_HTTP_CREATE Function Module
Dear All,
We want to attach document (PDF, DOCX, TXT etc.) in DMS using WD application.
We converted data xstring to binary format. Now when we call Function Module SCMS_HTTP_CREATE, it gives SY-SUBRC = 5. INTERNAL_SERVER_ERROR.
Code:
*"*"Local Interface:
*" IMPORTING
*" VALUE(IV_ARCHIV_ID) TYPE TOAOM-ARCHIV_ID
*" VALUE(IV_AR_OBJECT) TYPE TOAOM-AR_OBJECT
*" VALUE(IV_OBJECT_ID) TYPE SAPB-SAPOBJID
*" VALUE(IV_SAP_OBJECT) TYPE TOAOM-SAP_OBJECT
*" VALUE(IV_LENGTH) TYPE I
*" VALUE(IV_MIMETYPE) TYPE STRING
*" VALUE(IT_DATA) TYPE ZTAB
*" EXPORTING
*" VALUE(EV_FLAG) TYPE CHAR1
*" VALUE(EV_DOC_ID) TYPE SAEARDOID
DATA : LV_ARC_DOC TYPE SYSUUID-C,
LV_MIMETYPE TYPE W3CONTTYPE,
LV_ARCDOC TYPE TOAV0-ARC_DOC_ID.
CALL FUNCTION 'SYSTEM_UUID_C_CREATE'
IMPORTING
UUID = LV_ARC_DOC.
CALL FUNCTION 'SCMS_FE_GROUP_OPEN'.
LV_MIMETYPE = IV_MIMETYPE.
CALL FUNCTION 'SCMS_HTTP_CREATE'
EXPORTING
MANDT = SY-MANDT
CREP_ID = IV_ARCHIV_ID
DOC_ID = LV_ARC_DOC
COMP_ID = 'data'
MIMETYPE = LV_MIMETYPE
LENGTH = IV_LENGTH
* SIGNATURE = 'X'
* DOC_PROT = 'rcud'
* TEXT_MODE = ' '
* ACCESSMODE = 'c'
* SECURITY = ' '
* OVERWRITE = '-'
* IMPORTING
* DOC_ID_OUT =
TABLES
DATA = IT_DATA
EXCEPTIONS
BAD_REQUEST = 1
UNAUTHORIZED = 2
FORBIDDEN = 3
CONFLICT = 4
INTERNAL_SERVER_ERROR = 5
ERROR_HTTP = 6
ERROR_URL = 7
ERROR_SIGNATURE = 8
ERROR_PARAMETER = 9
OTHERS = 10
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'SCMS_FE_GROUP_CLOSE'
LV_ARCDOC = LV_ARC_DOC.
CALL FUNCTION 'ARCHIV_CONNECTION_INSERT'
EXPORTING
ARCHIV_ID = IV_ARCHIV_ID
ARC_DOC_ID = LV_ARCDOC
* AR_DATE = ' '
AR_OBJECT = IV_AR_OBJECT
* DEL_DATE = ' '
* MANDANT = ' '
OBJECT_ID = IV_OBJECT_ID
SAP_OBJECT = IV_SAP_OBJECT
* DOC_TYPE = ' '
* BARCODE = ' '
EXCEPTIONS
ERROR_CONNECTIONTABLE = 1
OTHERS = 2
IF SY-SUBRC <> 0.
** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
While Calling FM 'SCMS_HTTP_CREATE' is Raise Exception 5 INTERNAL_SERVER_ERROR.
Thanks
Regards
RohitHi,
Content-Type: application/xml
...check for the content type of the message that is sent ot the WS.....with the above mentioned content-type going to the WS currently...WS is not able to parse the req and hence the error....in other words wrong format being being passed.
Regards,
ABhishek. -
Calling Remote function tool leads always to a logon screen
Hello,
I run an remote function tool in system A. In System B I run a report calling this function module.
Each time, I execute the report, a remote logon screen appears. It looks the same like the one you logon the system. You have to specifiy client, user and password.
I know one possibilty to avoid this logon screen appeaering.
System B (holding the function module) must declare System A as a trusted system. Thus, the user does not need to logon system B, each time calling the func. module. I processed this in correspondence with the help data, but the screen still appears.
Is there any other possibilty to avoid appearing the logon screen or does anybody know wheter I did something wring??
thanks, holgerHi Holger,
1. This has to do with tcode SM59 (Maintain RFC Connections)
THE CALLING SYSTEM HAS NOT DEFINED
USER ID / PASSWORD TO LOGON TO THE TARGET SYSTEM.
HENCE, IT SHOWS BLANK LOGIN SCREEN
2. Under the node RFC Destinations ---> R/3 Connections,
various systems are defined for RFC Purpose.
3. Lets say ur system(which u want to connect) is PRD.
4. Double Click PRD and go the the details.
5. There are 3 Tabs. Goto LOGON/SECURITY TAB.
6. In the logon information , enter the
USERID and password and client.
7. Save.
Then try your program.
Hope this helps.
Regards,
Amit Mittal. -
Webdynpro/abap portal unable to call Remote functions?? HELP
<b>Scenario:</b>
webdynpro/abap system A talks to system B.
webdynpro Abap has a call as
call function 'BAPI_FLIGHT_GETLIST'
destination 'RFCB'....
At "A"
created SSL Server for https, created certificate request and imported it from SAPtest ticket.
imported certificates for the SSL from "mySAP" and "Server CA" downloaded from sap site
enabled the ACLs for the above 2 certificates on client '000"
The browser's http proxy tool shows that after login to system A with Http, further requests go through RFC destination to system B, called RFCB.
RFCB config to systemB as a specific user, everything is fine.
However, if RFCB is set to 'current user', it does not work.
So, SSO ticket is not used to login to system B, I guess.
How to set up the RFCB. If I change to 'trusted system', I get RFC authentication error. The sdn shows to setup S_RFC auth object into user profice with PFCG.
Can you help?
Thanks.Hi ,
I have used RFC's couple of time in WebDynpro ABAP .As I am doing WD Application for SRM where I require to fetch data from other R/3 servers .
Now do you want something like this . You will pass some parameters to RFC and based on that will updates data in that Remote R/3 and Also send results that you want show over WebDynpro Application .
Please see thread below .See that help you or not.
Re: RFC call Dumps with ***Ilegal reference***
Cheers
Parry -
CNTL_ERROR while calling a function module from Java webdynpro
I am calling a RFC function module from javawebdynpro app
which inturn calls a function module performing BDC on CAPP transaction. When I run this from SE37 of the same system or a different system everything works fine. But when called from Java webdynpro app, it raises a CNTL_ERROR exception and creates a short dump.
Any help on this is highly appreciatedGood catch, BI Learner. This was exactly it: when assigning the values from SOURCEFIELDS directly to the import/export parameters, you have to make sure that the types are EXACTLY the same, otherwise it will not work (the routine stops with an error when calling the FM, but there is no dump).
Therefore, to solve my problem, I created the declarations precisely as expected by the FM and assigned the values to these fields:
DATA:
SOURCEVAL TYPE /BIC/OIINVQTY,
SOURCEUOM TYPE /BIC/OIUSUOM,
USITM TYPE /BIC/OIUSITM,
TARGETUOM TYPE /BIC/OIUSUOM,
CONVERTED_COST TYPE /BIC/OIINVQTY.
DATA PRODUCTION_UOM TYPE /BIC/OIUSUOM.
" get the Production UOM
SELECT SINGLE I~/BIC/USPRDUOM
FROM /BIC/PUSITM AS I
INTO PRODUCTION_UOM
WHERE I~/BIC/USITM = SOURCE_FIELDS-/BIC/USITM AND I~OBJVERS = 'A'.
IF ( SY-SUBRC = 4 ). " no records found
"RAISE PARTNO_NOT_FOUND.
RAISE EXCEPTION TYPE CX_RSROUT_SKIP_RECORD.
ENDIF.
" load the parameters
SOURCEVAL = SOURCE_FIELDS-/BIC/USFRZMFC.
SOURCEUOM = SOURCE_FIELDS-BASE_UOM.
USITM = SOURCE_FIELDS-/BIC/USITM.
" then you can call the FM
CALL FUNCTION 'Z_CA_CONVERT_US_COST'
EXPORTING
PSOURCEVAL = SOURCEVAL
PSOURCEUOM = SOURCEUOM
PUSITM = USITM
PTARGETUOM = PRODUCTION_UOM
IMPORTING
PTARGETVAL = CONVERTED_COST
EXCEPTIONS
CONVERSION_NOT_MAINTAINED = 1
PARTNO_NOT_FOUND = 2
OTHERS = 3.
" ... [do the rest]
Thanks for your help,
Dennis -
Local function calling remote function - error
Dear All
i have following remote function wich return some value from both methods ie.
1) select func1(variable, varialbe) from dual@remoteDB; working
2) select func1(variable, varialbe) from dual; -- by making a synonym at local
Now i create a local function funclocal calling remote functino i.e. func1 in this example as:
CREATE OR REPLACE FUNCTION funclocal(locc varchar2, artnoo number)
RETURN NUMBER IS
query_str VARCHAR2(1000);
STKQTYY NUMBER;
artno number(10);
loc varchar2(80);
BEGIN
artno := artnoo;
loc := locc;
query_str := 'select func1(loc, artno) from dual ';
EXECUTE IMMEDIATE query_str
INTO STKQTYY;
RETURN STKQTYY;
END;
compiled successfully.
But when i run as:
SQL> select funclocal('abc', 469183) from dual;
select funclocal('@st3', 469183) from dual
ERROR at line 1:
ORA-00904: "ARTNO": invalid identifier
ORA-06512: at "funclocal", line 11
Please guide me.
Regards
SaeedEXECUTE IMMEDIATE query_strAs Andreas states: Why are you using dynamic sql?
From what I see all you need is sth like
create or replace function funclocal (locc varchar2, artnoo number)
return number
is
begin
return func1 (locc, artnoo);
end funclocal ;
/even the whole concept of a »local« function seems suspicious. Why do you need that one? -
Invalid column type error while calling db function.
We are getting an exception while calling the database function which returns a Varray of objects. We are using jpub to generate the wrapper method, ran sqlj to generate the JDBC code. The environment is weblogic 5.1 EJB container with ORacle 8.1.6.0.0 database. The JDBC driver is 8.1.7 thin, sqlj version is 8.1.7. I am giving below the exception.
When the sqlj option profile=false is not set, the error is Classcast exception. Appraently the weblogic connection object can not be used to do oracle specific calls. If somebody has done similar things(creating a bean which calls the stored function with weblogic which returns the oracle object types) or know what the issue is, please let me know.
Thanks,
Vijay.
stackTrace:
java.sql.SQLException: Invalid column type
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Compiled Code)
at java.sql.SQLException.<init>(SQLException.java:43)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:273)
at oracle.jdbc.driver.OracleStatement.get_internal_type(OracleStatement.java:4560)
at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:225)
at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:350)
at weblogic.jdbcbase.pool.Statement.registerOutParameter(Statement.java:438)
at sqlj.runtime.profile.ref.RTStatementJDBCCallable.registerOutParameter(RTStatementJDBCCallable.java:135)
at sqlj.runtime.profile.ref.ParamRegProfile$ParamRegCachedStatement.registerParameters(Compiled Code)
at sqlj.runtime.profile.ref.ParamRegProfile$ParamRegCachedStatement.getStatement(ParamRegProfile.java:101)
at sqlj.runtime.profile.ref.CachedStatementProfileWrapper.getStatement(CachedStatementProfileWrapper.java:134)
at sqlj.runtime.ExecutionContext$StatementStack.setStatement(ExecutionContext.java:995)
at sqlj.runtime.ExecutionContext.registerStatement(ExecutionContext.java:523)
at com.xpede.calculator.processor.jdbc.NewPrdGroupPkg.maincalculator(NewPrdGroupPkg.java:341)
----------------------Weblogic essentially wrappers the Oracle JDBC driver - as you can see from the stack trace, it does not just wrapper the connection object, but also the statement object.
The SQLJ runtime does not recognize the JDBC layer anymore as an Oracle JDBC driver.
What is happening at runtime may be the following:
(1) The invalid column type likely results from SQLJ attempting to register the type as Types.OTHER (code 1111). This typecode is not supported by Oracle JDBC.
(2) The class cast exception when using Oracle objects may result from a getObject() call which returns the value in default format (such as oracle.sql.ARRAY) rather than the JPublisher-generated wrapper object.
Are you using JDK 1.2 / runtime12.zip?
In that case you can try the standard (java.sql.)SQLData interface (in JPub: -usertypes=jdbc). However, this interface will not support wrappers for VARRAYs. -
Error while calling a function.
Hi,
below is my callable statement through which am calling a function which returns the service years of a person with personid as parameter.
But dont know why am getting an error which is returning the serviceyrs as 0.
when i try to debug, the problem is in this statement
System.out.println("the output1 is "+cs.getInt(1));
is there any problem with my code.
please look the code below
thanks
kumar
OADBTransaction txn=getOADBTransaction();
OracleCallableStatement cs = (OracleCallableStatement) txn.createCallableStatement("begin :1:=LMIG_UTILITY_PKG.GET_TOTAL_SERVICE(p_person_id => :2); end;",1);
try
cs.registerOutParameter(1,Types.INTEGER);
cs.setInt(2,Integer.parseInt(pid));
System.out.println("person id is "+pid);
System.out.println("the output1 is "+cs.getInt(1));
cs.execute();
serviceyrs= cs.getInt(1);
cs.close();
catch(SQLException sqle)
System.out.println("ERROR"+sqle.toString());
System.out.println("Service years are "+serviceyrs);Hi, Guess u are missing the connection to the JDBC call.
Try the following...it worked for me..
Connection conn = this.getOADBTransaction().getJdbcConnection();
OracleCallableStatement ocs = null;
String param = null;
try {
String stmt = "BEGIN :1 := <PkgName>.<FunctionName>(:2); end;";
ocs = (OracleCallableStatement)conn.prepareCall(stmt);
ocs.registerOutParameter(1, OracleTypes.CHAR);
ocs.setString(2, <param>);
ocs.execute();
param = ocs.getString(1);
} catch(SQLException se)
{ throw OAException.wrapperException(se);
finally
try {
ocs.close();
return(param);
} catch(Exception e)
throw OAException.wrapperException(e);
} -
Hi,
I know there are many questions in this subject but none of them help to resolve the issue I am currently facing.
Below is the signature of C Function from DJVULibre added in .NET code
[DllImport("C:\\Program Files\\DJVULIBRE\\LIBDJVULIBRE.dll", CharSet=CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
private unsafe static extern int ddjvu_page_render(IntPtr page, ddjvu_render_mode_t mode, IntPtr pagerect,
IntPtr renderrect,
IntPtr pixelformat,
ulong rowsize,
[Out][MarshalAs(UnmanagedType.LPArray)]byte[] imagebuffer);Below is how I am calling this function in the c# codebyte* buffer = (byte *)Memory.Alloc(nSize);
try
IntPtr ptr1 = (IntPtr)Memory.Alloc(Marshal.SizeOf(prect));
Marshal.StructureToPtr(prect, ptr1, false);
IntPtr ptr2 = (IntPtr)Memory.Alloc(Marshal.SizeOf(rrect));
Marshal.StructureToPtr(rrect, ptr2, false);
byte[] array = new byte[nSize];
fixed (byte* p = array) Memory.Copy(buffer, p, nSize);
ddjvu_page_render(page, ddjvu_render_mode_t.DDJVU_RENDER_MASKONLY, ptr1, ptr2, fmt, (ulong)stride, array);
finally
Memory.Free(buffer);
}call to ddjvu_page_render in above code is throwing "Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
Prior to this post I must have tried all the option could find in various blogs.
Appreciate any help, is almost a day I am clueless, your timely help could save my jobThanks Viorel, below is the definition of original C function
DDJVUAPI int
ddjvu_page_render(ddjvu_page_t *page,
const ddjvu_render_mode_t mode,
const ddjvu_rect_t *pagerect,
const ddjvu_rect_t *renderrect,
const ddjvu_format_t *pixelformat,
unsigned long rowsize,
char *imagebuffer );below is how the code is calling this function in C#, the in pointers are all valid pointer I checked in debugging window byte* buffer = (byte *)Memory.Alloc(nSize);
try
IntPtr ptr1 = (IntPtr)Memory.Alloc(Marshal.SizeOf(prect));
Marshal.StructureToPtr(prect, ptr1, false);
IntPtr ptr2 = (IntPtr)Memory.Alloc(Marshal.SizeOf(rrect));
Marshal.StructureToPtr(rrect, ptr2, false);
byte[] array = new byte[nSize];
fixed (byte* p = array) Memory.Copy(buffer, p, nSize);
ddjvu_page_render(page, ddjvu_render_mode_t.DDJVU_RENDER_MASKONLY, ptr1, ptr2, fmt, (ulong)stride, array);
finally
Memory.Free(buffer); -
Error while calling the function which returns SQL Query!!!
Hi,
I have a Function which returns SQL query. I am calling this function in my APEX report region source.
The query is dynamic SQL and its size varies based on the dynamic "where clause" condition.
But I am not able to execute this function.It gives me the following error in APEX region source.
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
Even in SQL* Plus or SQL developer also same error .
The length of my query is more than 4000. I tried changing the variable size which holds my query in the function.
Earlier it was
l_query varchar2(4000)
Now I changed to
l_query varchar2(32767).
Still it is throwing the same error.
Can anybody help me to resolve this.???
Thanks
AlakaHi Varad,
I am already using 32k of varchar2. Then also it is not working.
It is giving the same error. I think there is something to do with buffer size.
My query size is not more than 4200. Even if i give 32k of varchar2 also buffer is able to hold only 3997 size of the query only.
Error is
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
Tried CLOB also. It is not working.
Any other solution for this.
Thanks
Alaka -
Ora-06502 while calling oracle function
I am using 9.2.0.4.0 database.
I have vb.net application that uses oracle provider for .net to connect to database.
I am calling Oracle function which returns varchar2 value back.
when i execute cmd2.ExecuteNonQuery, I get ora-06502 error.
CREATE OR REPLACE FUNCTION ZZZ_TEMP( p_val IN VARCHAR2) RETURN varchar2
AS
BEGIN
RETURN 'HELLO';
EXCEPTION WHEN OTHERS THEN
RETURN SQLCODE||' - '||SUBSTR(SQLERRM,1,100);
END;
************** vb.net code
Dim cmd2 As New Oracle.DataAccess.Client.OracleCommand(UserSchemaName & ".ZZZ_TEMP", con)
Dim VAL As String
Try
cmd2.Parameters.Add("RetVal", Oracle.DataAccess.Client.OracleDbType.Varchar2, ParameterDirection.ReturnValue)
cmd2.Parameters.Add("p_val", Oracle.DataAccess.Client.OracleDbType.Varchar2, ParameterDirection.Input).Value = "XYZ"
cmd2.Connection = con
cmd2.CommandType = CommandType.StoredProcedure
cmd2.ExecuteNonQuery()
VAL = cmd2.Parameters("RetVal").Value
Catch ex As Oracle.DataAccess.Client.OracleException
MsgBox(ex.Message)
End TryIf I change this function to retrun number rather than Varchar2 and change my
RetVal parameter as follow it works. I am noticing that there might be a bug when function returns varchar2
cmd2.Parameters.Add("RetVal", Oracle.DataAccess.Client.OracleDbType.int32, ParameterDirection.ReturnValue)
cmd2.Parameters.Add("p_Val", Oracle.DataAccess.Client.OracleDbType.int32, ParameterDirection.Input).valu ="XYZ" -
Hi All,
While calling the receipt Un-application API, I am getting a error like' Customer Transaction Identifier has taken a precedence over the transaction number'
Kindly suggest as to how can I troubleshoot this?
Appreciate your valuable InputssHi,
i recommend having a Service request logged for this issue, as from related documentations in metalink most of them seemed to be a bug where oracle suggested patches (code Fixes) ... hence reaching oracle support would be a better approach ...
Regards,
Ivruksha
Maybe you are looking for
-
How can I remove an old e-mail that I am no longer using? How can I correct my birthdate?
-
Zire 21 Problems with Vista- No Users?
Hi. When I open Palm Desktop, it prompts me to select a user, but there isn't one there. I've tried re-installing my palm software several times. the strangest part is that when I first installed Palm Desktop, it worked fine, but then I re-installed
-
Hi Gurus Can we use BC in generic extraction ? How?
-
Add the ability to manipulate image data early during the import process
Following many discussions about the inability to cleanly support aspect ratio in LR, it would be useful to have the ability to interviene in the import process (early) and manipulate the exif data. It is possible to attach a metadata preset during i
-
CT5760 HA Pair not Forming?
We just received a pair of wireless controllers, AIR-CT-5760-K9 and AIR-CT5760-HA-K9. I've wired them together with the StackWise cable, as we typically do with our 3850s (top left <-> bottom right, bottom left <-> top right, screws hand-tightenend).