RFC call from MII using JCO
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
Chandan
I 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
Similar Messages
-
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 -
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 -
Duration of an Abap Function call from Java using Jco3
Hi guys!
I would like to use this discussion to get some refernces of the duration Timespan of an RFC call from Java to SAP. At the moment, i need at last about 200ms to call the Abap function. I'm just using one simple import and export parameter (so no deep structures). I think that the reason for my poor performance is, that the Java Tool and the SAP instance are not in the same network. So, i hope some of you have some data, how fast an RFC call from Java using Jco can be executed.
greetings, HannesHi Hannes,
I think you have already got the answer to your question - the network set-up you have is probably the bottleneck. Whenever I've worked with Java <-> ABAP and they are in the same network, I've had no performance problems at all.
Does your RFC contain any complex logic or business processes? Are you able to try and call something that does nothing, say it just accepts an input string and returns it straight away as an export. Do you have any scope for testing with your Java tool on the same network as the SAP system?
Cheers,
G. -
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 -
Calling Java API from ABAP using JCo (Part 2)
Hello,
This is an additional question to thread Calling Java API from ABAP using JCo
Has anyone managed to get the input parameter value
input.getString("REQUTEXT")
that is being passed from ABAP?
If yes, what kind of setting you need to do? Because when I execute, it has no value.
Thus, the below ECHOTEXT parameter returns blank value:
output.setValue(input.getString("REQUTEXT"),"ECHOTEXT");
When I debug by printing the below line, the input XML is indeed without value:
System.out.println(input.toXML());
Anybody knows how to pass input variable from ABAP to JAVA using JCo?
rgs,
hiroshiHallo Hiroshi,
as far as I can see, you are doing it the right way. The problem might be that the ABAP program does not fill in this parameter because something went wrong in the SAP System.
Have you tried setting a breakpoint (an HTTP session - remote breakpoint) and tried checking step by step if the value is being processed and put into the REQUTEXT field?
Bye,
Sameer -
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 -
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 -
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 -
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 -
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 -
JCo 3.0 - RFC call from EJB with SSO
Hello,
I am trying to call abap using JCo 3.0 from EJB (NW CE 1.0). I have configured destination on server with authentication method to use SAP Logon tickets. But when I call my EJB method that looks like this:
JCoDestination dest=JCoDestinationManager.getDestination("RFCCallTest");
JCoRepository repo=dest.getRepository();
JCoFunction f= repo.getFunction("ZMG_RET_NAME");
JCoParameterList in=f.getImportParameterList();
in.setValue(0, "param1");
f.execute(dest);
I get an exception when executing the first line of code:
Message: Exception occurred during lookup of RFC Destination RFCCallTest: No SAP logon ticket found
Category: /System/Security
Location:com.sap.security.core.server.destinations.provider.DestinationsProviderFrame.getDestinationProperties()
When I change the destination authentication method to Technical user it works well.
SSo between the servers works.
This scenarion also works when I use older JCo implementation (2.x)
BR
ViktorHi Bill,
I too faced the same problem for quite some time on SP9. I thought it was the adapter problem that persisted ...but it was not !!
After importing the RFC structure into XI, if the name of the imported RFC program is renamed/changed on R/3 side, then you will get the same error "lookup of binding via CPA-cache failed for AdapterType RFC, AdapterN."
So make sure that RFC program name on the R/3 side was not changed/renamed after you have imported the RFC structure into XI.
If the RFC program name had changed, make sure you reimport the RFC structure to avoid this problem.
Regards,
Sridhar -
Asyncronic JCO RFC call from JAVA to ABAP
Hi,
Please could you provide a sample java code to establish JCO RFC call to ABAP?
Thanks.Hi Denis,
Import the model In NWDS for ABAP for RFC.
Please check here [Accessing ABAP Functions using the Adaptive RFC Model |http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a00f7103-6790-2a10-ac9c-fcac7c5b18a3?quicklink=index&overridelayout=true]
[Web Dynpro Model: Backend Access|http://www.sdn.sap.com/irj/sdn/nw-wdjava?rid=/webcontent/uuid/403e6bf5-426e-2910-b0a8-a95548724af9#section10 [original link is broken]]
Also check here /docs/DOC-8661#section10 [original link is broken]
Hope it helps,
Redards,
Arun -
Calling external Java from ABAP using JCo?
Does anyone know if one can use JCo to write a server application that can be called from ABAP.
We are presently using JCo to communicate from Java to SAP.
But we need to call an external Java program from within ABAP.
Is this possible?
Thanks for any input.
FredHi Gregor,
I was hoping you would reply to this -- these posted messages had been here for quite sometime now.
Anyway, here's the case. Our Basis team is installing the JCo in our SAP development server. This is our first time to implement this technology, so no one has a clue at all.
Got a couple of questions for you...
1. What do we need the JDK for? Is it mainly for editing, running, and compiling java files (e.g. Example5.java)?
2. Does the JDK need to be installed at the SAP server as well? Or it doesn't matter, as long as the java files will be accessible from where it was installed at?
Thanks for any response!
Maybe you are looking for
-
Service Order status change thro' Action
Hi all abaper After completing billing, thro the action I am changing service order user status as completed. i hv written my code in class method. After billing as action runs my code from method execute and changes the status properly and gets save
-
I'm a learning dreamweaver user. So I wanted to add a Facebook like button and followed a tutorial on widgets. However, when I insert the widget it shows up in coding in split view but not my actual page. I've tried uploading it and it still wouldn't
-
My iPhone is stolen yesterday around 12 noon, please help me to find my iPhone back with how to track his whereabouts.
-
10.6 Server's Firewall Blocks It's Own Internet Connection
I had this problem about two years ago when I was trying to run 10.6 on my home server (Mac mini) for the first time. Eventually I gave up, reverted the mini back to 10.5, and ram problem-free for years. When 10.7 came out, I tried to upgrade the min
-
How to see the keyboard shortcuts in pages like " alt " function in word?
how to see the keyboard shortcuts in pages like " alt " function in word?