Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to prepare the client for SAPFTP and BAPI_DOCUMENT_CHECKOUTMODIFY2

1,602 views
Skip to first unread message

Michael Cross

unread,
Jun 16, 2003, 6:40:09 AM6/16/03
to
Hello Newsgroup,

I try to develop (VB .NET) a small application connecting to the sap
system via SAP .NET Connector. Unfortunately I ran into some problems
with the BAPI BAPI_DOCUMENT_CHECKOUTMODIFY2. I searched the internet
and found out that other developers have the same problems like me,
but I could not find the solution for my problem.

I try to check out documents which are storaged in the sap database.
So I passed the needed information to the BAPI and usually it works
without an error. But it does not download the wanted file. If I test
the BAPI in SAP (SE37) it works fine. Therefore, I debugged the BAPI
and found out, that the BAPI checks if the client is connected via
SAPGUI or via RFC (external program).

If the client application is connected to the SAP system via RFC I
have to do the filetransfer ether with SAPFTP or SAPHTTP. But I can
not transfer the file with these programs. Maybe that I am not
familiar in configuring a scenario like this.

So, this is what I am doing yet: Before I call the BAPI I run the
program SAPFTP and SAPHTTP. My next step is to allow the start of
these programs with RfcAllowStartProgram from the RFC Library. After
this I call the BAPI. The RETURN Table returns the message "::001 RFC
partner does not allow to start the required p". If I test the
RFC-Destination in SM59 the destination works and the process of
SAPFTP is listed in the windows task manager. How can I get the
process started within my application? Do I have to do some more
configuration work (maybe in saprfc.ini)? Or how can I get SAPFTP
started without SAPGUI? Do I have to implement a RFC Server to get
this functionality?

I would be very glad if somebody could help me. Especially how the RFC
connection works out of the BAPI_DOCUMENT_CHECKOUTMODIFY2 and how to
prepare the system for this.

Kind regards,

Michael Cross

Peter Van Avermaet

unread,
Jun 17, 2003, 5:31:25 AM6/17/03
to
There are 2 pre-defined RFC-destinations that can be used:
("pre-defined" is a big word...)
SAPFTPA - the SAPftp program (a client in the FTP protocol) running on
the SAP R/3 "application server";
SAPFTP - the SAPftp program (a client in the FTP protocol) running on
your PC.

In the latter case, the question is how the application can identify
"your PC".
If you are using SAPgui, it is obvious (it is the PC that SAPgui is
running on).
If you are using other means (.Net and SAPrfc), it is not so obvious.
This may be your problem.

A similar distinction exists for SAPhttp, I think: RFC-destinations
SAPHTTPA and SAPHTTP.
(of course, the SAPhttp program is a client in the HTTP protocol.)

Dieter Krisch

unread,
Jun 17, 2003, 12:55:39 PM6/17/03
to
Michael Cross wrote:

Hello,

I think you are doing it the right way but something is wrong. In
pseudo-code here is
my suggestion:
a) call RfcAllowStartProgram for "saphttp.exe" and "sapftp.exe". To make
sure it is the
right spelling (did you include the .exe??) try a RfcAllowStartProgram
with "*" as parameter,
this allows starting of all programs. After it works, narrow the
parameter down to what you
really need (happy trial&error).
b) call the BAPI. I think the librfc is supposed to activate the sapftp,
not the app-server via a
RFC call.

Good luck, Dieter Krisch

Peter Van Avermaet

unread,
Jun 17, 2003, 1:47:20 PM6/17/03
to Peter Van Avermaet
I have checked the ABAP code for your BAPI.
Deep down it calls function CV120_GET_FRONTEND_TYPE ;
that one, in turn, calls WS_QUERY -
I wonder what WS_QUERY does in an RFC environment.
I suggest you try Google and "Google groups" for WS_QUERY .

Peter Van Avermaet

unread,
Jun 18, 2003, 10:59:37 AM6/18/03
to
I have just tried CV120_GET_FRONTEND_TYPE in the context of RFC
(WebRFC in a SAP ITS).
It runs into an exception NO_BATCH, simply because the WS_QUERY runs
into that exception.
In fact, WS_QUERY calls function GUI_IS_AVAILABLE, does not find any
GUI and raises NO_BATCH (it thinks it is in batch because it does not
find a GUI).

Michael Cross

unread,
Jun 23, 2003, 6:53:02 AM6/23/03
to
Hello newsgroup,

I found the solution and it is quite simple.

Before I call the BAPI with my application I have to allow the BAPI to
start "SAPFTP" with RfcAllowStartProgram("SAPFTP"). Sapftp.exe must be
copied into the applications directory and the appropriate RFC
destination must be configured in SAP (but in my case it was by
default).

Then I start the BAPI call and everything works fine.

All who have answered, I thank you very much.

Kind regards

Michael

0 new messages