L M Rojas
L M Rojas

Reputation: 11

Call function with startrfc shows help info (SAP Netweaver RFC SDK in Bash)

I'm trying to make a request to a function in a SAP RFC server hosted at 10.123.231.123 with user myuser, password mypass, system number 00, client 076, language E. The name of the function is My_Function_Nm with parameters: string Alternative, string Date, string Name.

I use the command line:

/usr/sap/nwrfcsdk/bin/startrfc -h 10.123.231.123 -s 00 -u myuser -p mypass -c 076 -l en -F My_Function_Nm

But it always shows me the help instructions.

I guess I'm not specifying the -E pathname=edifile, and it's because I don't know how to create an EDI File to include the parameters values to the specified function. Maybe someone can help me on how to create this file and how to correctly invoke startrfc to consume from this function?

Thanks in advance.

Upvotes: 1

Views: 967

Answers (2)

Suncatcher
Suncatcher

Reputation: 10621

You should use sapnwrfc.ini which will store your connection parameters, and it should be places in the same directory as client program.

Sample file for your app should be following:

DEST=TST1
ASHOST=10.123.231.123
USER=myuser
PASSWD=mypass
SYSNR=076
RFC_TRACE=0

Documentation on using this file is here.

For calling the function you must create Bash-script, but better to use Python script.

Upvotes: 0

vwegert
vwegert

Reputation: 18483

If you actually check the help text the problem shows, you should find the following passages:

RFC connection options:

   [...]    

  -2       SNA mode on.
           You must set this if you want to connect to R/2.
           [...]

  -3       R/3 mode on.
           You must set this if you want to connect to R/3.

Apparently you forgot to specify -3...

Upvotes: 0

Related Questions