Hello,
This is my first raised question to the community.
I've just very recently found out that it is possible to record steps in SAP and save them to a vb file.
At the same time I also found out that, you can use an adapted code e.g. inside a VBA excel file and run it to create the same behavior as if you were pressing the run command in SAP for such a stored script.
This was a big thing to me because working in SAP and to have any possible interaction to it from the "outside" would be a mind changer.
I've since searched and searched for a way to create my interaction outside the VBA IDE and to use Visual Studio to run my code. So far, it was impossible to me to have it working. Errors after errors.
My question at this point, without having to keep spending time is simple: Can I assume this is even possible? Use a VS application to run C# or VB.NET to do the simplest thing like run a transaction in SAP from the outside?
I use Windows 10 - 64 bit and the SAP GUI for Windows release 7600.1.9.1160.
If anyone could provide me the feedback, I could then build up my knowledge and start asking step by step questions.
I have absolutely no knowledge about this topic. I'm familiar with C# and just a small bit on VB.NET, so, any gain from this point is a benefit. To be honest, there should be a lot of other people in the same conditions.
Please let me have your precious feedback.
Many thanks in advance.
Regards
Request clarification before answering.
Hi Stefan,
Thank you for your answers.
I'll need time to investigate your comments.
The way I actually login, does not allow me to understand what is happening behind the login.
Using the method OpenConnectionByConnectionString and a string like "/H/iwdf8997.wdf.sap-ag.de/S/3200" is only good if I know what to use as the string. How will I know this?
I simply select the name of my system (e.g. Production ERP) and press Log On on the SAP Logon 760.
Then a new window starts and SAP Easy Access is shown confirming my login. I don't know any other way to lunch the SAP Easy Access.
Can you help?
Thank you.
Regarding the connector, this link points us to the place where we are able to download the software: https://support.sap.com/en/product/connectors/msnet.html
But it seems that not every one is able to download the applications.
The message:
You are not authorized to download this file
Please make sure that your company has purchased this software product. If you have a valid license, but still cannot download this file, please report an incident under component XX-SER-SAPSMP-SWC.
Incident ID: XYZ
What shall I do?
The company does have valid licences, but I'm not be using a valid email address.
What shall I do?
Please feedback.
Regards,
Pedro
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ptuga
Hello Pedro,
you can find the SAP router string (/H/) and the connection number (/S/32 + instance number) of the connection string inside your SAP Logon.

To download the SAP NetWeaver RFC library contact you admin, he should have an S-user and be able to download the necessary files for you.
Best regards
Stefan
Hi Stefan,
I have no idea about what you mean with "inside your SAP Logon.".
Under the SAP Logon 760 I have my workspaces and connections etc. which I need to select (one) before I press Log On.
I can select a workspace and all available connections are displayed at the right (e.g. productive system). If you right click on a connection, you can access properties and there are 3 tabs with Connection/Network/Code Page but nothing like what you have shown specifically.
I can find a SNC Name, Description, System ID, message server and the SAProuter which is blank and even Instance number as 00. Probably I'm not looking in the right place.
This connection type is set as "Group/Server Selection".
I cannot find any "SAProuter String" and I have no way to know unless you guide me to it.
If the connection is set to "Custom Application Server" then the text show will show, but this is not my case for the connection I use.
Any ideas?
Please feedback.
Thank you.
Kind regards,
Pedro
ptuga
Hello Pedro,
sorry for my delayed reply.
To your questions:

In the properties you can find the Host /H/ string as SAP Router and the last two digits of the Service /S/32xx in the Instance Number.

You need an S-User with the permission to download files. Talk with your system administrator.
Best regards
Stefan
Hi Stefan,
Delay is not a problem. Many thanks for your feedback.
My connections properties don't show the same dialog that you shown previously:

I guess that is because the "Connection Type" is set to "Group/Server Selection".
Once you change this to Custom Application Server" a very similar is displayed:

But no field is selected, and I don't wish to change this by obvious reasons.
I can find other connections (that I don't use) which are defined as "Custom Application Server" but all fields are filled except the "SAProuter String"! On this specific one the "Instance Number" is a 2 digits number, "SAProuter String" is empty.
Not really sure how to move from here?
Can you help?
Kind regards,
Pedro
Hi Stefan,
Replacing "C11" in:
app.OpenConnection("C11", True)
with my connection "Description" did the trick!
Maybe some of the fields are empty, hence, not required and just the "Description" is fine.
Problem: When my app finishes the connection is closed immediately. Can I keep the connection open?
Please feeback.
Regards,
Pedro
Hi Stefan,
The way I'm doing things does not make it simple.
All my apps run in C# but for SAP interfacing I'm using VB dotNET because coding is much simpler.
So my main application (in C#) asks some requests to my slave application (VB dotNET).
Sometimes other requests might follow and I don't need to open a new connect everytime I make a new request.
Ideally, my slave app should check if one connection is open and execute the request from the main app and if not, should open a new connection but, leave it open once the code finishes for consequent requests to be executed also.
Does this make sense? Difficult to explain it in words.
Is this possible?
Regards,
Pedro
Hello Pedro,
from my perspective it makes no difference to automate SAP GUI via SAP GUI Scripting with C# or any other language. Sure is it possible to combine C# and VB.NET, but as you can see it can be more complex with the synchronization. In my opinion in this case one language approach would certainly be more beneficial.
Best regards
Stefan
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.