I'm trying to upload a file from a server directory to the SAP CRM System (attachment to an Opportunity), therefore I am using the method create_with_file of the cl_crm_documents class.
To call this method I am using a RFC-Function created by myself.
If I test my RFC-Function within the Function Builder, everything works fine.
If I execute the RFC from a external System (in my case MS-Outlook) an error occurs: "Exception: RFC callback server not available".
I started the debugger and the program runs about half way through (So the connection works):
The create_with_file calls a couple of functions until the RFC_START_PROGRAM function is called. The error occurs exactly at this line.
Does anybody know why the error occurs only if I call the function remotely? How to solve this?
I don't have access to a CRM system, but this is what's probably happening: The class you use tries to perform some action on the front-end PC using the SAP GUI. For this, it performs an RFC call back or the SAP GUI. This works fine as long as you are using the function builder because there's a GUI connection available. Once you use some other means to invoke the function module, the GUI is no longer there and the program won't work. I'd suggest you check the code to see whether there is some parameter or customization that allows you to suppress the RFC call...
Related
How to get the name of the calling program from within an asynchronous remote function call (aRFC) ?
CALL FUNCTION 'BAPI_MATERIAL_SAVEREPLICA' STARTING NEW TASK lv_taskname
DESTINATION IN GROUP DEFAULT
The called BAPI triggers a user exit that I need to disable for this particular calling program. However, the local part of the stack is lost after the RFC and the name of the calling program on the local system is unknown.
The closest solution I could think of was disabling the user exit when the calling program is SAPMSSY1 (RFC calls), but that it not as accurate.
Maybe the parameter CALLER_PROGRAM of the function module RFC_GET_ATTRIBUTES. I'm not sure it works in all kinds of RFC calls.
I was trying to invoke BAPI_MATERIAL_DISPLAY functional module from SAP JCO, This is how i pass my input parameter.
function.getImportParameterList().setValue("MATERIAL", "10");
From my program output i got
The material 10 does not exist or is not activated.
If I execute BAPI_MATERIAL_DISPLAY using SAP logon, iam getting the entry. Using debugger I found that,
My input is going as 00000000000010. And so returning response.
Dunno, how to handle this in a proper way in SAPJCO.
I had directly passed the value 00000000000010 from SAPJCo and this time i got an error,
com.sap.conn.jco.JCoException: (104) JCO_ERROR_SYSTEM_FAILURE: Screen output without connection to user.
Hope SAP is opening a popup. Let me know how to solve both the issues in SAPJCO
Field Material has a conversion exit routine. See also its domain MATNR in the DDIC.
These conversion exits are always called automatically by SE37 but not when the Remote Function Module is called directly - like here from outside from a a JCo program.
So if the BAPI expects to get certain parameters in their SAP internal representation format (I don't know if this is the case here), then you have to do this data transformation on your own beforehand, either by doing this purely within an own routine at Java side, or by calling the appropriate conversion routines at ABAP side via RFC.
For more details on this I recommend to study SAP note 206068.
Regarding your second question with the error message "Screen output without connection to user", I guess that this BAPI expects to have a connection to an SAP GUI for displaying the selected data. With a remote function call you don't have a SAP GUI connection by default, but you can attach a SAP GUI to your RFC connection with JCo, namely by specifying the additional logon parameter jco.client.use_sapgui=1. For this to work, an SAP GUI frontend (either for Windows or for Java) also needs to be installed on your host where JCo is running, of course.
I am using SoapUI with Groovy script and running into an issue when calling multiple APIs. In the system I am testing one WSDL/API handles the account registration, and returns an authenticator. I then use that returned authenticator to call a different WSDL/API and verify some information. I am able to call each of these WSDLs/APIs separate but when I put them together in a Groovy Script it doesn't work.
testRunner.runTestStepByName("RegisterUser");
testRunner.runTestStepByName("Property Transfer");
if(props.getPropertyValue("userCreated") == "success"){
testRunner.runTestStepByName("AuthenticateStoreUser");
To explain the first line will run the TestStep "RegisterUser". I then do a "Property Transfer" step which takes a few response values from "RegisterUser" - the first is "Status" to see if it succeeded or failed, second is the "Authenticator". I then do an if statement to check if "RegisterUser" succeeded then attempt to call "AuthenticateStoreUser". At this point everything looks fine. Though when it calls "AuthenticateStoreUser" it shows the thinking bar then fails like a timeout, and if I check the "raw" tab for the request it says
<missing xml data>.
Note, that if I try the "AuthenticateStoreUser" by itself the call works fine. It is only after calling "RegisterUser" in the Groovy Script that it behaves strange. I have tried this with a few different calls and believe it is an issue calling two different APIs.
Has anyone dealt with this scenario, or can provide further direction to what may be happening?
(I would have preferred to simply comment on the question, but I don't have enough rep yet)
Have you checked the Error log tab at the bottom when this occurs? If so, what does it say and is there a stacktrace you could share?
Say I have a WCF app hosted in IIS. And in that app I run this line of code:
Console.WriteLine("Testing, testing 1 2 3");
Where will that be written to? Or is it ignored and just lost?
Is there someway to capture it when needed?
Nowhere. More specifically:
NullStream, which is defined as "A Stream with no backing store.".
All the methods do nothing or return nothing. It is an internal class
to Stream. The following code is taken from Microsoft's source code.
Basically, when one of the Console write methods is call the first
time, a call is made to the Windows API function GetStdHandle for
"standard output". If no handle is returned a NullStream is created
and used.
quoted from here: https://stackoverflow.com/a/2075892/12744
actually, the same answer goes to on to address the second part of your question too:
To actually redirect Console output, regardless of the project type, use
Console.SetOut(New System.IO.StreamWriter("C:\ConsoleOutput.txt")),
I am creating a Java application that controls a Controller Area Network (CAN) controller via a vendor-supplied can.dll file.
can.dll contains a function bool openPort(DWORD memAddr) that allows the application to establish connection with the CAN controller.
I wrote a C++ test application, loaded can.dll via LoadLibrary and found this function to be working as it should, i.e. it returns true.
However, in my Java application, calling this via JNI or JNA returns false.
I hope someone can help me with this problem as I have been trying to fix this problem for more than a week.
Thanks :)
JL
I think you might want to look at sockets as an alternative or other IPC solutions.