cancel
Showing results for 
Search instead for 
Did you mean: 

How to start SAPGUI at entry point to RFC for debugging (using JCO)?

Former Member
0 Kudos

Hi,

I am calling an RFC using JCO and trying to have the SAPGUI pop up at the entry point to the RFC for debugging. But it is not working on Mac OS X.

I activate the debug via

JCO.Client client = JCO.createClient(..);

client.setAbapDebug(true);

client.setSapGui(1);

client.connect();

it gives error:

sh: line 1: /usr/sap/DV2/SYS/exe/run/sapgui: No such file or directory

com.sap.mw.jco.JCO$Exception: (103) RFC_ERROR_LOGON_FAILURE: Start 'sapgui' failed.

at com.sap.mw.jco.rfc.MiddlewareRFC$Client.nativeConnect(Native Method)

at com.sap.mw.jco.rfc.MiddlewareRFC$Client.connect(MiddlewareRFC.java:1098)

I then tried to set environment variable SAPGUI=/Applications/SAPGUI\ for\ Java\ 6.3r5.2/SAPGUI\ 6.30rev5.2.app/Contents/MacOS/SAPGUI

and it then starts up the SAPGUI for Java Logon Pad.

But, I want the SAPGUI to start up at the entry point to the RFC.

Is this possible in Mac OS X? It has worked before on Windows using the RFC SDK utilities or middleware tools such as IBM Crossworlds.

Thanks

Accepted Solutions (0)

Answers (4)

Answers (4)

kyo_choi2
Participant
0 Kudos

These settings works when used with SAP WAS J2EE 6.2 Engine. I am using Windows XP Pro and SAP GUI 6.2. On WAS there's specific settings as well for the debug.

robert_straub
Explorer
0 Kudos

The problem is that there are missing two arguments for the JavaGUI.

1st: -n (no logon window)

2nd: -o (open connection)

On other UNIXes you have the script guistart for this.

To get it to work:

create a script i.e. guistart.

- save it somewhere without SPACES in the path i.e.: "/usr/local/bin".

Unfortunately there are still some internal problems with spaces inside the

executable path.

- dont´t forget to set it executable: chmod +x SAPGUI

- content is the full path to the SAPGUI executable inside the installed Application Bundle.

#----

-


Script start -

-


#!/bin/sh

"/Applications/SAPGUI for Java/6.30/SAPGUI 6.30.app/Contents/MacOS/SAPGUI" -n -o $*

#----

-


Script end -

-


set the environment variable SAPGUI to the full path of the script.

i.e. for bash: export SAPGUI=/usr/local/bin/guistart

Regards

Robert

Former Member
0 Kudos

Hi Robert,

Thanks for the reply, it was very helpful as I had given up hope on getting a solution. Unfortunately I am still getting an error.

1) I created a script as per your directions containing

"/Applications/SAPGUI for Java 6.3r5.2/SAPGUI 6.30rev5.2.app/Contents/MacOS/SAPGUI" -n -o $*

2) Now the SAPGUI application starts, but does not open a window and I get the error:

                                                          1. ERROR #############################

18.05. 11:58:42.943 ERROR: AgiWindowAdaptor::update: no menu

                                                          1. ERROR #############################

3) I switched on the tracekeys with -t CON,SES,EVT,C_AGI to get more detail:

18.05. 11:58:41.420 TRC: Active trace keys: CON,SES,EVT,C_AGI

18.05. 11:58:42.709 CON: new GuiConnection

18.05. 11:58:42.727 CON: GuiConnection.open(/H/<appserver>/S/3235&rfcid=02D5428B909E32190000,tmp)

18.05. 11:58:42.846 CON: new GuiNiNetConnection

18.05. 11:58:42.872 CON: GuiNiNetConnection.open(conn=/H/<appserver>/S/3235&cpg=1127&jenc=MacRoman&jloc=en&rfcid=02D5428B909E32190000)

18.05. 11:58:42.872 CON: GuiNiNetConnection.open: resolved hostSpec = /H/<appserver>/S/3235

18.05. 11:58:42.915 CON: -


18.05. 11:58:42.916 CON: GuiNiNetConnection: sending DIAG data to connection for modus 0

18.05. 11:58:42.918 CON: -


18.05. 11:58:42.919 CON: GuiNiNetConnection: sending DIAG data to connection for modus 0

18.05. 11:58:42.927 C_AGI: calling AgiSessionPool->ParseIt() for modus 0

18.05. 11:58:42.929 C_AGI: AgiLibAdaptor::onNewPrimary

18.05. 11:58:42.941 C_AGI: returned from AgiSessionPool->ParseIt() for modus 0

                                                          1. ERROR #############################

18.05. 11:58:42.943 ERROR: AgiWindowAdaptor::update: no menu

                                                          1. ERROR #############################

18.05. 11:58:42.950 SES: GuiAutomationProcessor: processing automation call list for modus id 0

18.05. 11:58:43.043 SES: new GuiSession

18.05. 11:58:50.557 CON: GuiNiNetConnection: sending CLOSE data to writer thread

18.05. 11:58:50.791 CON: -


18.05. 11:58:50.791 CON: GuiNiNetConnection: sending DIAG data to connection for modus -1

18.05. 11:58:50.793 C_AGI: AgiLibAdaptor::onDelContainer

18.05. 11:58:50.794 C_AGI: AgiLibAdaptor::onDelContainer

18.05. 11:58:50.794 C_AGI: AgiLibAdaptor::onDelPrimary

18.05. 11:58:50.795 CON: GuiConnection.destroyNetConnectionAndParser

com.sap.mw.jco.JCO$Exception: (103) RFC_ERROR_LOGON_FAILURE: Start 'sapgui' failed.

at com.sap.mw.jco.rfc.MiddlewareRFC$Client.nativeConnect(Native Method)

at com.sap.mw.jco.rfc.MiddlewareRFC$Client.connect(MiddlewareRFC.java:1098)

at com.sap.mw.jco.JCO$Client.connect(JCO.java:2983)

Any further ideas on what is wrong? There is a post on another forum http://listserv.sap.com/pipermail/linux.general/2002-June/002538.html with the same error, but no response..

Thanks,

Richard

robert_straub
Explorer
0 Kudos

Hi,

you should use the newest version of the JavaGUI. Then this message (2) should not occure anymore.

There were made some changes on the communication level which should solve the whole problem. But unfortunately those changes are not in this "old" versions.

Unfortunately we have some problems with the Apple JVM. Please see Message: SAP GUI for Mac OS X 10.4 from Michael DE) for more info about Apple vs. JavaGUI version hassle.

Regards

Robert

Christian_Cohrs
Advisor
Advisor
0 Kudos

Hi,

did you use the RFC SDK for Mac OS X?

Best regards,

Christian

Former Member
0 Kudos

Hi,

I'm also trying to work out whether a call via JCO could start up the SAP GUI for JAVA at a specific transaction. Our requirement is to start the application and execute a RFC that will take user input via the SAP GUI screens. We have also been successful with this on Windows but no luck yet with Java.

In your sample code, are you calling a function or simply calling the connect method to get the logon pad? If you had to call a function, would this not maybe logon to the specified server and navigate to the required screen?

Thanks,

Charles

gregorw
Active Contributor
0 Kudos

Hello,

I think you will not have sucess using the SAP GUI for Java to debug JCo applications.

Regards

Gregor