Import parameter is empty after an RFC call from BW to JCo
I am calling a Java function (implemented using JCO and deployed on J2EE stack of the Portal box) from within a user-exit in BW (on a separate box) using RFC. The code in BW looks like:
CALL FUNCTION 'Z_BW_VALIDATE_PROXY' DESTINATION 'ACF2PROXY'
EXPORTING
IREQUESTOR = 'AE012345'
IREQUESTED = '012345'
IMPORTING
ERESULT = lv_result
EXCEPTIONS
SYSTEM_FAILURE = 1 message lv_rfc_mess
COMMUNICATION_FAILURE = 2 message lv_rfc_mess.
The following are working/setup correctly:
1. RFC destination ACF2PROXY, in BW using transaction SM59;
2. Java function 'Z_BW_VALIDATE_PROXY' , as the server log on the Portal(J2EE) shows the correct IMPORT and EXPORT parameters after processing a call from BW;
The data types of the parameters in the function call above matches with those of the formal parameters in Java function where they are defined using JCO data types (export parameter is defined at CHAR 1 at both places).
The problem is that I am not getting any value back in the IMPORT parameter 'lv_result'. I am expecting either '0' or '1' which is populated correctly in the Java function.
Any insight is appreciated.
The following is the code of the method in the class that inherits from JCO.Server. In this method the export parameter ERESULT is set with the value of variable 'result'. I thought it may be helpful to reporduce it here.
protected void handleRequest(JCO.Function function) throws MMException
if (function == null) {
LOGGER.logInfo("handleRequest - JCO.Function object is null.");
return;
LOGGER.logDebug("handleRequest(" + function.getName() + ")");
//process this function only, although I don't know what else would fall to this
//server request method...
if (function.getName().equalsIgnoreCase(ACF2Listener.ABAP_RFC_PROXY_FUNCTION)) {
//get input & output definitions from RFC. These are defined in the repository interface definition
JCO.ParameterList input = function.getImportParameterList();
JCO.ParameterList output = function.getExportParameterList();
LOGGER.logDebug("Received the following from ABAP: " + input.toString());
String requestor = input.getString("IREQUESTOR");
String requested = input.getString("IREQUESTED");
//call DAO to read ACF2 for these values
String result = null;
try {
ACF2DAO acf2 = ACF2DAO.getInstance();
if (acf2 != null) {
result = acf2.getACF2Delegation(requestor,requested);
catch (MMException e) {
LOGGER.logError("Exception occured during ACF2 DAO lookup: " + e.getMessage());
throw e;
output.setValue(result, "ERESULT");
LOGGER.logDebug("ACF2 Service Call returning: " + output.toString());
else {
throw new JCO.AbapException("NOT_SUPPORTED","This service is not implemented by the ACF2 Proxy external server.");
Thanks
Sanjeev
Similar Messages
-
Hi All,
I am calling custom function module from MII using JCO and I am facing one problem. Problem is that if any new field is added in function module in ECC side that is not appearing in RFC structure until we restart the MII server. Can anybody provide any solution. I am using MII 12.1 SP5.
Thanks in Advance
ChandanI faced this same issue. Only one solution is to reset the JCo Proxy by running following URL in the same MII server
http://<MII Server>/XMII/JCOProxy?mode=reset
This will reset the JCo cache and the new added fields in RFC at SAP end will be reflected in the Request/Response xml structure of the RFC in BLS
Regards
Som -
Hello All,
I have a standard SAP BSP application(which is statefull, but does not have a script for handling WINDOW closing EVENT , for removing the orphaned sessions, also I cannot add that code now as it's standard).
In one of the bas page I'm calling an RFC function module to a second R/3 system.
When I call the RFC and after doing some processing if I close the application( Please note that underlying session is still active), I still can see the RFC Login in 2nd system.
Is there any way to remove the RFC connection immediately after the RFC call? so that there is no persistent RFC connection, and a connection will be established only on demand.
Regards
GeogyHi Geogy,
Please use the FM "RFC_CONNECTION_CLOSE" after the corresponding RFC call with the same destination.
This will close the connection opened by the previous call.
Thanks
Madhan -
RFC call from a Windows Service
Hi All,
I have created a simple windows service which is making an RFC call to R/3 system. This is not working. Whereas the same piece of code written in a windows application projects(exe) works properly. Does anyone had similer issues working with Windows services ? Is it a known issue of RFC calls from windows service ???
Thanks & Regards
Ganesh DattaHi Juergen,
After I put the debug statements I figured out that connection to R/3 system is unsuccessful.
I am using the SAP .Net Connector 2.0. I wrote a windows service which is manually started. Withing my service I am using Single sign on to connect .This is what was causing the problem. If I disable Single sign on and supply userID and password then connection is successful and also subsequent RFC calls.
I guess within windows service Single sign on does not work.
Thanks for your reply
Best Regards
Ganesh Datta -
I am trying to do an RFC call from Excel to SAP using VBA. RFC is working fine for most the RFC enabled Function Modules except DDIF_FIELDINFO_GET and DDIF_FIELDLABEL_GET.
What can be the reason for this?
Can someonme please help me with a macro code where these FMs are working.
Also can someone please help me with some tutorial on SAP connection with Excel.
<REMOVED BY MODERATOR - REQUEST OR OFFER POINTS ARE FORBIDDEN>
Edited by: Alvaro Tejada Galindo on Nov 12, 2008 9:14 AMHello Jon.
DDIF_FIELDINFO_GET is not working for me either. But I have used another FM (/ZOPTION/LIVE_DDIF_FIELDINFO):
Public Sub RFC_FIELDINFO()
Dim Func As Object
Dim sapConn As Object
Dim tblFIELDTAB
Dim tblFIXED_VALUES
Dim intRow%
Dim intCol%
'* Sub : Call FM /ZOPTION/LIVE_DDIF_FIELDINFO *
'* Author : Holger Köhn *
'* Created : 23.08.2014 *
'* Changed : *
ThisWorkbook.Sheets("TEST").Activate
Cells.Select
Selection.ClearContents
ThisWorkbook.Sheets("TEST").Range("A1").Select
'* create RFC-Connection *
Set sapConn = CreateObject("SAP.Functions")
sapConn.Connection.RfcWithDialog = True
If sapConn.Connection.LogOn(1, False) <> True Then
MsgBox "Cannot Logon to SAP"
Exit Sub
End If
DoEvents
'* run FM /ZOPTION/LIVE_DDIF_FIELDINFO *
Set Func = sapConn.Add("/ZOPTION/LIVE_DDIF_FIELDINFO")
Func.Exports("TABNAME") = "AUFK"
Set tblFIELDTAB = Func.Tables("FIELDTAB")
If Func.Call = False Then
MsgBox Func.Exception
Exit Sub
Else
Application.ScreenUpdating = False
For intCol = 1 To tblFIELDTAB.ColumnCount
ThisWorkbook.Sheets("TEST").Cells(1, intCol).Value = tblFIELDTAB.ColumnName(intCol)
Next
If tblFIELDTAB.RowCount > 0 Then
For intRow = 1 To tblFIELDTAB.RowCount
For intCol = 1 To tblFIELDTAB.ColumnCount
ThisWorkbook.Sheets("TEST").Cells((intRow + 1), intCol).Value = tblFIELDTAB(intRow, intCol)
Next
Next
ThisWorkbook.Sheets("TEST").Activate
End If
Columns.AutoFit
Application.ScreenUpdating = True
End If
'* clear tblFIELDTAB *
Do Until tblFIELDTAB.RowCount = 0
Call tblFIELDTAB.Rows.Remove(1)
Loop
Set sapConn = Nothing
Set Func = Nothing
Set tblFIELDTAB = Nothing
End Sub -
RFC Call from ABAP (R3) to Webdynpro EP
Hi experts,
I have a requirement to initiate a call from an ABAP program on R3 to a standard Portal (Webdynpro) API. Does anyone have any experience with this?
I understand that normally Portal (Webdynpro) applications will make the RFC call to ABAP via the established JCO connection. However there's very limited literature elaborating how the call can be made in the other direction i.e. from ABAP R3 to Portal
Anyone, please kindly advise how, if this can be done. Many thanks!
Best regards,
LionelHi,
I'm trying to make a RFC call from the ABAP program to a built in Java method residing on EP. It is part of a suite of methods provided by the UME engine.
Typically a call is made from a webdynpro program to a SAP ABAP function module. In this case, I'd like to make a call from the SAP ABAP report to the EP method.
Best regards,
Lionel -
Making an RFC call from within the VM container
Hi all,
since a long time I am searching for information on how to implement an RFC call from within the VMC. The problem is that we have implemented several (p)functions in ABAP and we need to implement them in JAVA.
Now I am searching for a way how to just call the already existing pfunctions???
Is it possible to read CRM DB tables too?
Thank you in advance
BorisHi Freeto,
This may be due to the Network Failures.
If you have triggered a job then because of the Network fluctuations the system may not respond properly and cannot execute the job.
So, this is the cause for the failure.
Hope you understood.
With Regards,
Ravi Kanth -
Asynchronous RFC call from R/3
I need to make an asynchronous RFC call from R/3. I receive an error message in R/3 stating that my RFC destination can only be of type I (Internal) or type 3 (R/3 system). In order for it to reach XI I need it to be of type T (TCP/IP). Any help would be appreciated.
Here is the function call.
CALL FUNCTION 'Z_B2B_R3_FUNCTIONAL_ACK' starting new task 'SESSION1'
destination 'RFC2XMBSERVICE'
EXPORTING
MSG_TYPE = msg_type
ORDER_HEADER_RETURN = order_header_return
TABLES
RETURNCODE = i_return.
the RFC desitnation RFC2XMBSERVICE is of type TCP/IP which by default makes it synchronous.
Thanks,
Jimhi,
have you tried:
CALL FUNCTION 'Z_B2B_R3_FUNCTIONAL_ACK'
in background task
destination 'RFC2XMBSERVICE'
EXPORTING
MSG_TYPE = msg_type
ORDER_HEADER_RETURN = order_header_return
TABLES
RETURNCODE = i_return.
commit work.
Regards,
michal -
Excel sheet generation through RFC call from a BSP application
Hi,
I am calling a RFC FM ( in R3) in Event handler 'OnInputProcessing' of a BSP application in a SRM server.
That function submits a report program which geneates a excel sheet using download FM . Excel sheet is not getting generated.
But when i am calling this RFC FM (in R3) from a report program ( in srm server)
this is generating an ecel sheet.
I want to have call RFC from BSP application.
I tried the way of submit a program ( which contains RFC call) from BSP application ,but it is also not generating excel sheet.
My ultimate AIM is to generate excel sheet by trigerring CALL or submit from BSP
application.
can any one propose solution for it.
Useful answers will be rewarded.Hi,
Which FM is it. I guess that the download generated is a SAP gui oriented solution, which will never work in a web environment
Eddy
PS. Reward useful answers and earn points yourself -
Best approach for RFC call from Adapter module
What is the best approach for making a RFC call from a <b>reciever</b> file adapter module?
1. JCo
2. Is it possible to make use of MappingLookupAPI classes to achieve this or those run in the mapping runtime environment only?
3. Any other way?
Has anybody ever tried this? Any pointers????
Regards,
AmolHi ,
The JCo lookup is internally the same as the Jco call. the only difference being you are not hardcoding the system related data in the code. So its easier to maintain during transportation.
Also the JCO lookup code is more readable.
Regards
Vijaya -
Invoke MII Transaction thru RFC Call from SAP
Hi,
We want to get the data from Oracle DB table thru MII (12.0.2).
We need to use RFC call from SAP to MII.
Is it possible to invoke the MII transaction thru RFC by setting in Message Listener?
We have used iDoc messages but not tried with RFC.
How to do that?
Regards,
SenthilI feel MII doesn't have anything equivalent to RFC in ECC. You may try web services in an ABAP program
Hope the article below helps you
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/9f101377-0c01-0010-269f-c3ee905d583b&overridelayout=true
Regards,
Musarrat -
Prevent a dump after a RFC call
Hello.
I created a function group wich is used in a program through a RFC call.
I'm trying to prevent a dump of the program, in case the RFC can't reach his destination for example.
How can i do that ? Is it in the exception of the function or do you have other solutions ?
Thanks for the help.Hi helder,
1. we have to manually add the code/lines
for exceptions, almost in all RFC calls.
<b>(THEN IT WON'T GIVE RUN TIME ERROR)</b>
2.
EXCEPTIONS
SYSTEM_FAILURE = 1
COMMUNICATION_FAILURE = 2
3 just copy paste
report abc.
CALL FUNCTION 'GUI_RUN' DESTINATION 'ABC'
EXPORTING
COMMAND = 'XYZ'
PARAMETER =
CD =
IMPORTING
RETURNCODE =
EXCEPTIONS
SYSTEM_FAILURE = 1
COMMUNICATION_FAILURE = 2
regards,
amit m. -
Hi,
I'm creating a Java Webdynpro where I call RFC's from SAP.
For the images in the webdynpro, I call the standard SAP function 'CVAPI_DOC_VIEW'
When I execute the function in SAP, I get the url to the contentserver with the correct image.
After calling the same function in my Java Webdynpro, the url is empty.
I've checked the importing parameters after calling from webdynpro and SAP and they are the same.
After debugging, I saw that the function 'CVAPI_DOC_VIEW' is the problem. He's exporting an empty url after calling from the webdynpro.
Does anybody knows the possible fault and solution for my problem?I'm not an ABAPer but the last time I've dealt with DMS from Web Dynpro an ABAPer wrote a custom function that gets the file content (XSTRING) by sending DMS parameters (documenttype, documentnumber, documentversion, documentpart).
After getting the XSTRING from my Web Dynpro Java, I convert it to byte[] and created URL by using WDResourceFactory.
Hope it helps...
Omri -
RFC Call from PI freeze ECC system
Hello experts,
we actually load master data in our ECC environment that are sent to the PI environment via IDOC, the integration of those IDOCs in the PI system make RFC call in ECC and after a few minutes, the ECC system freezes.
All dialog process are occupied with report SAPLARFC/SAPLERFC/SAPMSSY1 with user PI2ABAP and WF-BATCH.
We have increase the number of dialog processes, reduce the parameter rdisp/rfc_max_own_used_wp to 50, but each time all the dialog processes are taken until the system freezes.
DO you know which parameter can restrict the number of dialog process used for RFC call?
or maybe a method to avoid this high consumption of all dialog processes in the ECC environment?
Many Thanks.
Thibaud.Hello Juan,
we have set this parameter to 3, but it seems to have no effect, I have applied the note 3223 that affects
- rdisp/wp_ca_blk_no (for wp_ca blocks)
- rdisp/appc_ca_blk_no (for appc_ca blocks)
but now we have a problem at the start of the instance that does not support the new value and lead to the error
Shared Pool Space exhausted.
How can i check this value and can I modify it?
Thanks.
Thibaud. -
RFC call from Delphi (Bad Variant Type error)
Well, I'm trying to call an RFC function from Delphi via ActiveX objects..
I have Codegear 2009 installed and it works without any problem..
But on another system with Delphi7 installed when I ran same code it gives "Bad Variant Type" error when assigning SapLogonControl's connection object to SapFunction's connection parameter... Both computers have same SAP installation. And on both systems ActiveX objects imported correctly on Delphi.
Here is the code:
unit logon1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, OleCtrls, StdCtrls, SAPFunctionsOCX_TLB,
Grids, SAPLogonCtrl_TLB;
type
TForm1 = class(TForm)
SAPFunctions1: TSAPFunctions;
Button2: TButton;
Grid: TStringGrid;
Edit1: TEdit;
Edit2: TEdit;
Label1: TLabel;
Label2: TLabel;
SAPLogonControl1: TSAPLogonControl;
procedure Button2Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1 : TForm1 ;
Table, Funct, Connection : VARIANT ;
implementation
{$R *.DFM}
procedure TForm1.Button2Click(Sender: TObject);
begin
Connection := SAPLogoncontrol1.newConnection;
Connection.User := 'testuser';
Connection.System := 'CRD';
Connection.Client := '300';
Connection.ApplicationServer:= '10.1.1.10';
Connection.SystemNumber := '00';
Connection.Password := 'testpass';
Connection.Language := 'EN' ;
if Connection.LogOn(0,true) = true then
(* parameter "true" = SilentLogOn *)
begin
(* assign the existing connection to the *)
(* component SAPFunctions1 *)
SAPFunctions1.Connection := Connection; // It gives error on this line...
Funct := SAPFunctions1.add('ZGIS_TEST_FUNC');
end;
end;
end.
As I said while Codegear 2009 runs this code without any problem, Delphi 7 crashes on that assignment.. Also I tried outside Delphi, and the file compiled with Codegear works on both systems while the file compiled with Delphi 7 again crashes on buth systems...
Is there a problem with Delphi 7? Should I use at least Delphi 8 or something for compiling?Hi Hakan,
You must use Non-Unicode RFC library for Delphi 7.0.
( Bende Delphi 7.0 kullaniyorum. Ayni hatayi aldim. Unicode library kullanmistim. Kaldirip Non-Unicode olani kullandim. Su an hata yok. RFC cagirabiliyorum. )
Mustafa Yalcin
Maybe you are looking for
-
How to validate a date with time
Hi All, How can I validate date with time? Here is my code: var tempDate:Date = new Date(); if (tempDate < '09/18/2012 7:30:00 AM'){ doSomething Thanks in advanced
-
Power mac g3, preferences, at symbol?
I have a problem, setting the at-symbol on my Power Mac G3, preferences. .mac
-
TS4002 cant access icloud due to maximum number account has been registered
hi there.to whom it may concern just baought iphone 4s.but cannot access icloud due to maximum number account been registered.really need help. thanks
-
Transferred music from computer to laptop...some content won't play
Some of my content is locked, and when I try to authorize, it says that the computer is already authorized, but wont play the song.
-
I have lost my Bookmarks and History listings and neither will record new entries (recently adjusted Facebook options to "Friends Only" for most settings)