on 06-05-2007 7:02 AM
Hi all. Sory for my bad english
I wrote folowing Server program:
void main()
{
MySAPServerHost host1 = new MySAPServerHost();
//SAPProxy1Impl consist implementation 1 server function
SAPProxy1Impl server1 = new SAPProxy1Impl(Environment.GetCommandLineArgs(), host1);
host1.Start();
host1.WaitForExit(-1);
host1.Stop();
host1.RemoveAllSAPServers();
return;
}
This program then registering in destination as launch in front-end workstation.
But when i try in this screen of destination make Test connection, i always get error: timeout during allocate...
I see in logs that argument line passed to SAPProxy1Impl();
consist following line
Cmd args = c:\serv\sapservice.exe /H/slv.snos.ru sapgw20 23942215 IDX=10
c:\serv\sapservice.exe - my server program which i write in section program of destination
May be something wrong?
Here already writes about this problem with command line with SAPServer in Net,i don`t know is resolved or not yet.
Hi,
Have you maintained the same program id in command line parameter and RFC destination? And also make sure, you are giving the correct host name in both places.
Thanks you,
Regards,
Govind.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No. When created RFC destination, i choose launch program at front-end,and there is no needed point Program ID, just point Program(i write c:\serv\sapservice.exe)., and needed host and service - i leave its field blanks.
Then i click on button Test Connection and get error described above.
I.e. i am not supply argument line in may program.it goes from sap on launch.
PS my program phisicaly located in c:\serv\sapservice.exe on my computer. an i launch rfc destination test on my computer
Message was edited by:
Micuk Vitaly
Hi, I think this is not going to work.
I've tried it myself and came up with the same error message.
Your server application must register itself to the SAP system.
But I've figured out some workaroud that worked for me.
1. create a .bat file that starts your server application.
2. in SM59 you create a destination that starts this .bat file, like: STARTSRV.BAT
(enter a short CPIC-Timeout, like 1 or 2 seconds because you don't want your ABAP application waiting for a long timeout.)
3. in SM59 you create a destination, mark the registerd server program and enter your program-ID.
(here you leave the standart timeout value)
4. than your ABAP report should look about like this:
REPORT zcallrfcvb.
DATA: preturn(20) TYPE c.
PARAMETERS: pname(20) TYPE c.
This FC calls the first destination that starts your startsrv.bat file (which start your server app) in the FC 'Z_STARTSRV' ther is no need for any import or export * parameters.
with the EXCEPTION Part you just avoid to get an ABAP dump because of the connection error like
in SM59 you've mentioned.
CALL FUNCTION 'Z_STARTSRV' DESTINATION 'STARTSRV'
EXCEPTIONS
OTHERS = 1.
This now is your real FC with the registered application and the program-ID (here: READVB')
In this FC you do what you want to do with your server app.
CALL FUNCTION 'Z_READVBAPP' DESTINATION 'READVB'
EXPORTING
zname = pname
IMPORTING
zreturn = preturn
EXCEPTIONS
OTHERS = 3.
CASE sy-subrc.
WHEN 3.
WRITE: / 'Server not running'.
ENDCASE.
WRITE: / preturn.
-----------------------------------------------------------------------------------------------
Hope this will help you!
Regards, Harald.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.