SAP Stress Test With
SAP Stress Test With
SAP Stress Test With
Installation
Download the setup and run it. The tool requires Microsoft .NET 4.0 to be installed. The tool
will by default install under user's local application data folder. It is not required to have
administrative privileges to install the tool.
Requirement: The application requires .NET Connector 3.0 32bit version, which is licensed
separately.
It has to be downloaded from http://service.sap.com/connectors.
After .NET Connector installation, please locate the sapnco.dll and sapnco_utils.dll and copy
over into the SAP Stress Tool application directory.
Tested on Windows XP and Windows 7. The tools comes as 32bit .NET application. It runs on
both 32bit as well as 64bit environments. The .NET connector is installed along with the
tool, so separate installation is not required.
Configuration
The configuration is done via an XML file "config.xml". There are no plans to build any kind
of user interface to edit the configuration. Use notepad or XML editor of your choice.
After installation to the target folder, you'll find ConfigExample.xml installed. You may
rename/copy it into a new Config.xml. Who know how to deal with XML Schemas, there is
also "CfgSchema.xsd" installed.
Example 1: Config.xml for single server environment and load balanced environment.
1.
2.
3.
<Systems>
4.
5.
Password="password:put_pwd_here" Server="server1.example.com">
6.
<SalesOrder number="2713100768">
7.
</SalesOrder>
8.
<SalesOrder number="3113009124">
9.
</SalesOrder>
When you configure a system for a first time, put you password as
"password:your_password", wherepassword: is a fixed keyword. When the tool is run,
your password will be automatically encrypted and stored in the confix.xml encrypted.
It is advised to create special user accounts for testing with limited validity. Even
though the password is encrypted, it's being decrypted at run-time, so it shall be
considered as compromised, if the confix.xml is shared with another person.
Use the <SalesOrder number="2713100768" /> tag to list some sales orders.
Those will be later used for simulation. The sales orders must exist in the target system
and the number must contain leading zeroes. The sales order are assumed to be standard
and simple types. The tool cannot simulate advanced order type, where you need to
provide additional conditions manually. You will get errors then in one of the log files.
1.
From the "Target system:" drop down menu select a system configuration to be
used.
2.
3.
If you have added some sales orders to be simulated, the application attempts to
download details about those sales orders. You'll be prompted, confirm with 'Yes'
Increase number of connections by adjusting the "Threads:" spin control.
Start slowly.
Maximum is somewhere around 95 per instance of the tool. If you need
more parallel connections you have to run the tool multiple times, better from
multiple machines in parallel.
The Tool will start to establish connections to remote SAP system. There is
slight delay needed for log on.
4.
5.
6.
7.
8.
9.
My father in law always used to say: "Who's worried stays behind." (in Czech language it's
a funny quote). He was 28 times national champion in Golf.
Few years ago we've done few upgrades from version 4.6 to ECC6. On one of those
upgrades we faced a slight trouble after Go Live. The system started to collapse in an rush
hour. Once per day, when a peak number of users entered the system. The system was low
on physical memory. We got a maintenance window to put more memory, but how to make
sure it was sufficient? A stress test? But how to make 700 users to connect to the system,
just for a testing purpose? Impossible.
That time I had some experience with SAP.Functions ActiveX scripting in VBScript. More
precisely, I knew, how to call RFC_READ_TABLE :-). We had some 1 hour buffer, so I wrote a
simple script, that called that RFC and prepared another batch script, that called the first
one many times in parallel.
Nice try, but a) RFC_READ_TABLE is not very representative example of "business
transaction" b) it is very memory hungry on the client side, so after some 20 connections to
the SAP the client PC memory was completely exhausted (including the virtual one) and
the PC become unusable for 15 minutes due to extensive swapping.
Three month ago I came across .NET connector. Roughly at the same time I got noticed,
that there are 3 other similar projects to be executed and whether it would be possible to
use my VBScript for stress testing. But really, that one was written in 1 hour and is not
something I would be proud of. I can do better! Or not? It's been many years since I'm not a
developer!
So I took it a bit as a personal challenge, whether a person near to 40, has forgotten, how
to swim...
You should know I end up that time with Visual Studio 6. .NET came just after, but I did not
care.
So I took the latest Visual Studio 2012, .NET, C# looked very similar to C++ (I wrote
hundreds of thousand lines in c/c++). I made a "Hello World" in C# and what a surprise it
was like I would talk in my native language. Immediately I downloaded and installed
SAP .NET Connector to try to invoke my beloved RFC_READ_TABLE. But what a surprise,
the .NCO did not appear in the list of available references?? Nor anywhere in the menu to
be added as component to my project?? I spent 2 days looking around and then I gave up,
perhaps I got old and .NET world is not any more for me. Did I perhaps miss that train?
The other day I meat my colleague from Greece and express him my disillusion. He said,
come on, it's simple, you just add the NCO dll into your application folder and add the DLL
as references directly! What a hack ? I tried and it works!
Boosted by this success I wrote a SAP Stress Test tool in 4 days. But let's talk about the
design next time ....
public bool ReadTable(string dest, string table, string fields, string filter, out List<string> ro
1.
ws) {
2.
3.
4.
5.
IRfcFunction readTable;
6.
try {
readTable = destination.Repository.CreateFunction("BBP_RFC_READ_TABLE");
7.
8.
9.
10.
rows = null;
11.
return false;
12.
13.
readTable.SetValue("query_table", table);
14.
readTable.SetValue("delimiter", "~");
15.
IRfcTable t = readTable.GetTable("DATA");
16.
t.Clear();
17.
t = readTable.GetTable("FIELDS");
18.
t.Clear();
19.
if (field_names.Length > 0) {
20.
t.Append(field_names.Length);
21.
int i = 0;
22.
23.
t.CurrentIndex = i++;
24.
t.SetValue(0, n);
}
25.
26.
27.
t = readTable.GetTable("OPTIONS");
28.
t.Clear();
29.
t.Append(1);
30.
t.CurrentIndex = 0;
31.
t.SetValue(0, filter);
32.
33.
//
34.
readTable.Invoke(destination);
35.
t = readTable.GetTable("DATA");
36.
int a = t.Count;
37.
38.
39.
t.CurrentIndex = i;
40.
rows.Add(t.GetString(0));
41.
42.
return true;
43.
... will create local table MY_MARD2, with all SAP table columns, where LGORD is either
XX60 or XX61
Remark: I recommend to use BBP_RFC_READ_TABLE instead of RFC_READ_TABLE, as with
the plain RFC_READ_TABLE I had performance problems and crash dumps on large tables.
1.
2.
3.
4.
5.
6.
Dim NO_DATA
7.
Dim ROWSKIPS
8.
Dim ROWCOUNT
9.
As Object
As Object
As Object
As Object
R3.Connection.SystemNumber = "00"
33.
R3.Connection.System = "XX1"
34.
R3.Connection.Client = "120"
35.
R3.Connection.Password = "password"
40.
Exit Function
41. End If
42. '**********************************************
43. '*****************************************************
44. 'Call RFC function RFC_READ_TABLE
45. '*****************************************************
46. Set MyFunc = R3.Add("BBP_RFC_READ_TABLE")
47.
48.
49.
50.
51.
52.
53.
54.
QUERY_TABLE.Value = tableName
55.
DELIMITER.Value = ""
56.
NO_DATA = ""
57.
ROWSKIPS = "0"
58.
ROWCOUNT = "0"
59.
OPTIONS.Rows.Add
60.
61.
62.
j=1
63.
64.
65.
FIELDS.Rows.Add
66.
67.
j=j+1
68.
End If
69.
Next
70.
Result = MyFunc.Call
71.
72.
73.
74.
75.
R3.Connection.LogOFF
76.
Else
77.
R3.Connection.LogOFF
78.
79.
Exit Function
80.
End If
101.
102.
103.
104.
End If
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
);"
sql = sql & FIELDS(iColumn, "FIELDNAME") & " CHAR(" & fipos(iColumn, 2) & ")
115.
116.
Else
117.
,"
sql = sql & FIELDS(iColumn, "FIELDNAME") & " CHAR(" & fipos(iColumn, 2) & ")
118.
119.
End If
120.
Next
121.
db.Execute sql
122.
'DLog ("Saving " & DATA.ROWCOUNT & " records in local table " & table_name)
123.
Dim rs As Recordset
124.
Dim le As Long
125.
126.
BeginTrans
127.
128.
l = DATA(iLine, "WA")
129.
'sql_ins_l = sql_ins
130.
le = Len(l)
131.
rs.AddNew
132.
133.
134.
135.
136.
GoTo skipme:
Else
137.
138.
))
139.
140.
)), "'", "''") & "'"
141.
End If
142.
143.
144.
'Else
145.
146.
'End If
147.
'rs.Update
148.
149.
Next
skipme:
150.
rs.Update
151.
'db.Execute sql_ins_l
152.
Next
153.
CommitTrans
154.
RFC_READ_TABLE = outArray
155.
Exit Function
156.
abend:
157.
RFC_READ_TABLE = Err.Description
158.
End Function
1.
2.
3.
4.
5.
6.
7.
SqlDataReader rdr;
8.
9.
10.
11.
12.
13.
cmd.CommandType = CommandType.Text;
14.
cmd.Connection = con;
15.
16.
param.Value = name;
17.
cmd.Parameters.Add(param);
18.
cmd.Connection.Open();
19.
rdr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
20.
if (rdr.HasRows) {
21.
rdr.Read();
22.
23.
24.
try {
// password encryption/decryption can be omitted
25.
26.
m function)
27.
28.
29.
return cp;
30.
31.
32.
33.
34.
35.
cp.Add(RfcConfigParameters.MessageServerHost, rdr.GetString(8));
36.
cp.Add(RfcConfigParameters.LogonGroup, rdr.GetString(11));
37.
} else {
38.
cp.Add(RfcConfigParameters.AppServerHost, rdr.GetString(0));
39.
cp.Add(RfcConfigParameters.SystemNumber, rdr.GetString(2));
40.
41.
cp.Add(RfcConfigParameters.Client, rdr.GetString(1));
42.
cp.Add(RfcConfigParameters.SystemID, rdr.GetString(9));
43.
cp.Add(RfcConfigParameters.User, rdr.GetString(4));
44.
cp.Add(RfcConfigParameters.Password, ppw);
45.
cp.Add(RfcConfigParameters.Codepage, "1100");
46.
cp.Add(RfcConfigParameters.Language, rdr.GetString(3));
47.
cp.Add(RfcConfigParameters.PeakConnectionsLimit, "101");
48.
49.
return cp;
50.
51.
52.
53.
54.
55.
228 Views 0 Comments Permalink Tags: interoperability_.net, .net, connector, nco, sql, 3
Objective
Application based on .NET framework 1.1 using NCo 2.0 to be upgraded to .NET
framework 4.0 and NCo 3.0.
Scope
In this case study only the upgrade to NCo 3.0 part is covered.
Challenges
To understand the constraints a little better I would first explain in brief the
structure of the application to be upgraded.
The web service application comprises of two parts (projects) one containing the
web services and other containing the old connector SAP RFC proxy classes and
types. The proxy types are being referenced from web services and removing all
the generated types and classes would have meant writing the entire application
from scratch.
There were 100s of web services which was invoking approximately 120 SAP RFC
to pull and push data from SAP system.
There were dozens of consumer applications based on different technologies
consuming these services and changing anything on consumer application side
was not being considered considering the development and deployment effort it
would have required.
These poses another challenge as the client proxies generated using Framework
1.1 web services was not fully compatible with Framework 4.0 web services as
SOAP standard is changed.
Solution Design
After initial deliberation it became quickly clear that we need to somehow automate the
process of generating proxy classes and types compatible to new NCo 3.0. There were
approximate 120 RFCs and writing codes to populate and invoke proxies would have taken
considerable amount of time.
The output was a .NET based utility which took all the existing classes and types and
converted to types and methods compatible with new NCo. During the runtime it
connected to SAP system to get the RFCs metadata and generated the codes required for
invoking RFCs through new connector.
The next issue was to map the .NET types to the types understandable by new connector
namely RFCTable, RFCStructure and other basic types. Couple of generic conversion
routines were written to convert .NET type Tables and structures to Connector s RFCTable
and RFCStructure types. These routines converted these types at runtime when the RFCs
were invoked.
Similarly we required other set of generic routines to convert the export parameters from
RFCTable and RFCStructure to .NET data types.
And at last to overcome the incompatibility issue in SOAP definitions we had to overwrite
the incoming SOAP request at web server side.
Performance:
Keeping the implementation constraints, the performance improvement achieved was only
slightly better. However, in terms of technical upgrade it was significant achievement. No
change in client application and no consumer application roll out required. Only downtime
needed was for server deployment.
There is scope for further improvement if more framework 4.0 functionality is utilized and
conversion routines are removed.
Refrences:
There is an excellent blog on NCo 3.0 by Thomas Weiss A Spotlight on the New
.NET Connector 3.0 which I found very helpful.
430 Views 1 Comments PermalinkTags: interoperability_.net, .net_connector, .net_connector_clie
nt, nco, integration_architect, 3.0
Patch level 3.0.13 of the SAP .NET Connector 3.0 has just been released. Please
see note 1921800 for a list of bug fixes and enhancements made with this patch
release.
The SAP .NET Connector 3.0.13 can be downloaded from the SAP Service
Marketplace at
https://service.sap.com/connectors
-> SAP Connector for Microsoft .NET
-> Download SAP Connector for Microsoft .NET Version 3.0
If you are lacking the required authorization for downloading software from the
SAP Service Marketplace, please follow the instructions of note 1037574 for
requesting this authorization.
Mobile devices are of course nothing new, they are amongst the earliest of technologies
that connected to back end SAP and other corporate systems however in the past the
whole provisioning activity was very limited and tightly controlled and controllable. Pretty
much anyone with the requisite URL, user name and password can potentially access
almost any piece of centrally stored data from anywhere in the connected world.
It could be argued that the rise of BYO has come about due to failure of corporate IT to
meet the demands of the user community. Often the choice to go with an own device is
driven by frustration with having to labour under the draconian IT policies imposed on
corporate issued technology. A lack of administrator rights to install software, disabled USB
ports, and a geriatric operating system are all signs that IT is applying best practice in
controlling technology but at the same time missing the point that some users actually
function best when their technology is unchained. There are numerous examples of
corporate IT policies overshadowing corporate user efficiency and effectiveness by blocking
or disabling certain functions and user practices but these are not worth restating because
they are pretty well understood.
Not all employees should be considered equal in terms of a BYO policy - how will
you decide?
Additional Reading
http://www.windowsnetworking.com/articles-tutorials/netgeneral/planning-bringyour-own-device-byod-part1.html
http://enterprisemobile.curatasite.com/articles/share/99458/
http://blogs.technet.com/b/tothesharepoint/
297 Views 0 Comments PermalinkTags: sap, erp, mobile, interoperability_.net, .net_connector, .n
et_connector_client, sharepoint, unchained, microsoft_duet,winshuttle
NCo 3 is designed to enable you to work with BAPIs. SAP delivers hundreds of these fancy
function modules for us to use. They are handy for everything from getting a list of
employee benefit elections out of HCM to creating a cash journal document in FI. In fact, by
calling various BAPIs you could whip together powerful applications in your .NET
environment, leveraging SAP's own code for the hard stuff. Myself, I've been thinking about
a custom open enrollment application that leverages the available benefits-related BAPIs in
HCM.
But let's discuss how you call a BAPI using NCo 3. Once you have a destination established,
all BAPIs and RFC-enabled function modules in that SAP system become available to you.
Just call it by name, and you get an instance of the BAPI in your .NET client app with all the
import, export, changing, and tables parameters -- all appropriately typed, all ready to use.
Here's how you do it. First, you need a variable to hold the BAPI.
Dim getBalances As IRfcFunction
module + fancy stuff
Now, you call the CreateFunction method of the repository object, passing it the name of
the BAPI you want. The repository object is a sub-object of the RfcDestination object, and
you know all about RfcDestination objects from my previous post.
getBalances =
myDest.Repository.CreateFunction("BAPI_GL_GETGLACCPERIODBALANCES")
Now, I know from studying this BAPI in SE37 that it has some simple field parameters, a
structure (the RETURN parameter, where success and error messages come from,) and a
table parameter. This particular BAPI works by passing it a GL account, fiscal year, and
some other simple parameters, and in return, you get a table of account balances broken
out by period as well as the fiscal year opening balance. So, I need to set some input
parameters before I can do anything. Let's do it this way.
With getBalances
.SetValue("COMPANYCODE", "1234")
.SetValue("CURRENCYTYPE", "10")
.SetValue("GLACCT", "00000" & strGLAccount)
.SetValue("FISCALYEAR", strFiscalYear)
....
So, with the SetValue method, we identify which parameter we are setting, and giving it a
value. Think of it like a key-value pair where the key is the SAP name of the parameter. One
thing to remember about some of these parameters is that within SAP, often, conversion
programs run automatically that, for instance, pad some fields with leading zeroes. In the
case of the GL account, SAP stores that 10-character field with leading zeroes, and so I
have make sure the value I pass is padded out to a length of 10 characters before I pass it
to my BAPI. (I admit, my example isn't very elegant.) If you find the BAPI doesn't like what
you are passing to it, make sure something like this isn't going on, and you are passing
what the BAPI expects.
Once we pass in our input parameters, we call the RfcFunction's Invoke method. The Invoke
method takes your destination object as its parameter. Behind the scenes, this is where
NCo 3 logs into SAP, executes your BAPI with the parameters you provided, and returns
whatever it is supposed to. How do you retrieve this output? The RfcFunction object comes
with several Get____ methods, including GetTable, GetStructure, GetString, etc.
Dim tblAccountBalances As IRfcTable
Dim strucReturn As IRfcStructure
getBalances.Invoke(myDest) ' <---- where the magic
happens
tblAccountBalances = getBalances.GetTable("ACCOUNT_BALANCES")
strBalanceCarryForward = getBalances.GetString("BALANCE_CARRIED_FORWARD")
strucReturn = getBalances.GetStructure("RETURN")
In the code above, after invoking the BAPI, I simply get the output by calling their SAP
name. Grabbing values from simple fields is easy with methods like GetString or
GetDecimal. GetTable returns an IRfcTable type. The IRfcTable type is fairly intuitive to use
and behaves a bit like a .NET DataTable, and the IRfcStructure sort of behaves like a one-
row table. That's a gross oversimplification, however. Both objects have their peculiarities,
and in my next post, I will discuss some of the things I learned about using them
effectively.
926 Views 2 Comments PermalinkTags: beginner, interoperability_.net, .net_connector, .net_conn
ector_client, bapi
Once you do this, you can get the logon parameters for the SAP instance you
want to use by specifying its name. In this case, I want to log into our sandbox
instance.
Dim myparm As RfcConfigParameters = mySapLogon.GetParameters("ECCSBX")
If you run your code, and stop it just after this line, you'll see that myparm is filled with
parameter data. All that came from your saplogon.ini. The next thing you need to do is set
your desired SAP instance as an RfcDestination, and then from that, you must create a
custom destination. I'm not sure why you can't do this in one step, but you can't.
Dim newDest As RfcDestination =
RfcDestinationManager.GetDestination("ECCSBX")
Dim newCustomDest As RfcCustomDestination = newDest.CreateCustomDestination
Finally, you must pass in the missing parameters, such as user name, password, and client,
to the custom destination. You could get this from the user in a dialog box, pull it from a
database, from the app.config file, or hard code it as in my example below. It's up to you.
newCustomDest.User = "batman"
newCustomDest.Password = "jokersux"
newCustomDest.Client = "110"
user makes
Now, your destination object is fully configured from saplogon.ini information in eight, easy
lines of code. Now, you are ready to take this destination object, start grabbing BAPIs from
the repository, and do amazing things with SAP data. I will discuss how I did that in my next
post.
1978 Views 12 Comments PermalinkTags: beginner, interoperability_.net, .net_connector, .net_co
nnector_client
model based on technology (moving from bricks and mortar to online selling), decides to
renew their manufacturing infrastructure (switch from custom built M.E.S. to an off the
shelf product like WonderWare or modifies the staffing model around a particular
technology stack (offshoring call centers because VoIP is supported) but it rarely plays
such a major role when youre talking about bolting improved functionality or efficiency
engines onto your existing ERP system. Such technologies, like Business Objects for
analytics, Crystal Reports for report writing, Syclo for mobile or Winshuttle for process
automation and UI replacement are all disparate technologies. They have similarities and
major differences. They all rely on SAP as the system of record and they all bring
substantial business benefits for resolving very specific business problems today.
We need to get out of the mode of thinking about technology built to last with an indefinite
life and start thinking about technology that solves the problems that we have today
especially when youre dealing with .NET technology. Ten years ago there was scarcely
such a thing as a smartphone, SharePoint was still an emerging technology and yet today
both are pretty ubiquitous. In another ten years there will be something different. A given
SAP installations dependency on an Oracle database today may suddenly be supplanted
by a HANA RDB and then your enterprise commitment today to the big O may appear to
have been flawed.
575 Views 0 Comments PermalinkTags: interoperability_.net, enterprise_architecture, .net, .net_c
onnector, .net_connector_client, .net_connector_server,integration_architect
Derive and define guiding principles; originating as first from the business
perspective, and next from IT. Typically the latter are more of constrictive nature; e.g.
required to apply a service architecture, required to conform to W3*-standards, ...
Analyze the current state of the IT landscapes (IST) within the company: SAP and
Microsoft environments and server products.
o
o
Presentation
Integration
Application
Data
Service architecture
Loosely coupled
SAP business backend is and remains responsible for the correctness of business
process
Inside-Out
Outside-In (nb: in Microsoft terminology, this approach is also referred to with the
phrase Contract-First)
Inside-Out
As the name already suggests, the starting point here is your current SAP landscape state.
Start with identifying the available functional building blocks in the SAP environment
existing BAPI Function Modules, RFCs, SAP workflow business objects, and already
available SAP webservices. And expose these to outside world, to have the related SAP
data and functionality consumed by a non-SAP front-end.
Advantages
Biggest advantage of this approach is that you have a faster time2market. You can base
your SAP / Microsoft.NET interoperability on already existing, and thus also tested, SAP
building blocks. The only thing that needs to be done is to put a (web)service interface on
them, and then you can integrate with the Microsoft based presentation layer.
Disadvantages
This can be summarized with the phrase Garbage In Garbage Out. If you base your
interoperability architecture on the current state of your SAP environment, there is a large
likelihood that SAP-proprietary concepts will be visible on the integration surface level. In
general, an architecture that originates via this approach will be less pure and transparent.
And thus less future-proof.
Outside-In
The essence of the Outside-In approach is to first agree on and define the conceptual
contract [interface] between the service provider side [SAP], and the service consumer side
[SharePoint]. The idea is to start from the requested application functionalities. Derive and
define at a conceptual level the services you require from the SAP backend to deliver the
application and system functionalities. Describe the service interfaces in W3*-standards
based notation and data structures. From here on, map onto required SAP building blocks:
existing if available, new ones otherwise. At SharePoint / presentation side, you can build
the consumption layer for the defined service interfaces via wsdl.
Thus start at outside with the conceptual, externally visible service interfaces; and
continue then for both provider and consumer / SAP and Microsoft sides to the inside with
their respective technologies.
Advantages
Because you start in this approach with a green field, the resulting interoperability
architecture typical has a cleaner interface, which inherently conforms to interoperability
standards. And because you start from the required business services, it also has a better
chance on being conceptual correct, and future-proof.
Disadvantages
Biggest disadvantage is that this approach requires more investment and time at front in
deriving and describing the service interface layer. Also it requires to get both SAP and
Microsoft departments representatives on par, to have a common understanding of the
applied service concepts. And in case of existing SAP building blocks, a transformation can
be required to map the standards-based service interface to the SAP-specifics Function
Modules, RFCs, workflow business objects.
257 Views 0 Comments Permalink Tags: interoperability_.net
Actions
Login to follow, like, comment, share and bookmark content.
Login Register
Filter Blog
By author:
Clinton Jones
Ed Hammerbeck
Hynek Petrak
Jitesh Kumar Sinha
Markus Tolksdorf
Ramesh Vodela
Venkata Reddy Vatrapu
William van Strien
By date:
By tag:
.net
.net_connector
.net_connector_client
.net_connector_server
3.0
beginner
enterprise_architecture
erp
interoperability_.net
microsoft_duet
sharepoint
stress
stress_testing
test
winshuttle
Follow SCN
Site Index
Contact Us
SAP Help Portal
Privacy
Terms of Use
Legal Disclosure
Copyright
Woman buys new car just so she can ram it into store she disliked
YJNews