Zieglers

Just little about C#, .NET, SQL Server, SharePoint and SAP

Archive for November, 2009

SharePoint 2010 – one million items in a list

Posted by zieglers on November 21, 2009

Just like most people, i downloaded and installed SharePoint 2010 last week. Unlike mentioned, I had no issues while installing on Windows 2008 R2 environment. It’s been a week and still no issues.

Looks like it’s going to take a while for me to get used to new ribbon interface. Definitely you get to see and do more with ribbon, but will take a some time to remember what is where.

Actually, main focus of this post is a lot mentioned new feature of SharePoint 2010. “Limitation on number of items stored in a list”  problem seems to be solved – Now, SharePoint lists can handle millions of items.

In order to see this, I decided to do a little experiment. My aim is firstly to insert one million items in a list successfully. As I write this post items are still being inserted, 731371 and still counting… So far it’s been 6 hours and still inserting.

I have to also mention that my experiment environment is done on a  Win 2008 R2 with 2 GB Ram and using an external usb hdd. So this waiting time can be way less if you try with a powerful workstation. Anyhow, how do I insert 1 million items to a list? Of course using PowerShell script..

Here is a very simple PowerShell script which inserts items to a list. This script is just assigning ‘Title’ column values: Item – ItemNo

========================================================================================

// Set site url
$siteurl = “http://yourservername”

// get site obj
$mysite=new-object Microsoft.SharePoint.SPSite($siteurl)

// open root web
$spWeb = $mysite.OpenWeb()
 
// get test list obj
$spList = $spWeb.Lists[“TestList”]

// Insert 1 million items
$i = 1001

do { Write-Host “Item – “$i
         $spitem = $spList.Items.Add() 
         $spitem[“Title”] = $i.tostring()
         $spitem.Update()
         $i++
}
while ($i -le 1000000)

========================================================================================

Will update this post once insert operation is completed…

(next morning)

Ok, now i see insert operation is completed. As you can see below, one million list items are inserted into a list using PowerShell.

At this point I’d like to do some test re item select/update/delete operations. Also wondering how filtering is going to work in such a large list. If you have suggestions for other tests or things to check, please let me know, i’ll try to apply them as well. At the end, I’d like to have a some sort of comfort level while suggesting a client ‘one million item is ok in a SharePoint 2010 list’.

… to be continued…

zieglers

Advertisements

Posted in IT Stuff, SharePoint | Tagged: , , , | 2 Comments »

Reading QueryString paramater values using JavaScript in SharePoint

Posted by zieglers on November 13, 2009

Here is a nice javascript snippet which allows you to read querystring parameter values. Actually i used this code in a SharePoint application page to read ListId and ItemId values that i was passing from previous page.

// ************************************************************
// Create an array to keep query string variables
var qsParm = new Array();
// This function gets query string values from current page
// and stores them in above defined array
function qs()
    {
            var query = window.location.search.substring(1);
            var parms = query.split(‘&’);
           
            for (var i=0; i<parms.length; i++) {
                var pos = parms[i].indexOf(‘=’);
                if (pos > 0)
                {
                    var key = parms[i].substring(0,pos);
                    var val = parms[i].substring(pos+1);
                    qsParm[key] = val;
                }
            }
    }

qsParm[‘ListId’] = null;
qsParm[‘ItemId’] = null;
// Call function – get query strings
qs();
// For example show ListId
alert(qsParm[‘ListId’])
// ************************************************************

zieglers

Posted in IT Stuff, SharePoint | Tagged: , , , , | Leave a Comment »

SAP IDES ERP 6.0 EHP4 / NetWeaver 7.01 Installation Guide on Windows 2003 64-bit – Part 2

Posted by zieglers on November 12, 2009

In this 2nd part of the article, I’ll mention installation environment details. Although SAP doesn’t recommend installation on laptops, I did my test installation on a virtual machine. As host machine I used Windows 7 Ultimate 64bit and VMware Workstation. Here are guest 64bit operation system details:

=========================================================================================

Installation Guest Machine details

* Windows Server 2003 R2 – Standard x64 Edition

19

* MS SQL Server 2008 x64 with collation CP850_BIN2 (this is very important. you can only install SAP with this collation)

23

* Java JDK 1.4.2_17 windows-amd 64bit. If you have problems finding a 64bit version for Java 1.4.2_? SDK, here is the link: http://java.sun.com/j2se/1.4.2/SAPsite/download.html

Java SDK versions provided in above link are specific builds for SAP customers. For my installation, I used following version.

20

Also, you should download Java Cryptography Extension 1.4.2 since SAP Installer will ask for it during installation.

==========================================================================================

Starting Installation Process

If you have downloaded all necessary installation media as described in part 1(https://zieglers.wordpress.com/2009/11/10/sap-ides-erp-6-0-ehp4-netweaver-7-01-installation-guide/) and prepared your installation guest machine as described above, now we can start installing SAP IDES ERP 6.0.

There are also couple of important details to mention:

1. Your machine name CAN NOT be more than 13 characters. Otherwise you’ll get an error during installation during prerequisite check. As for this demo, i renamed my machine to ECC6.

2. Increase your virtual memory. Make it at least 20480 MB. Otherwise you’ll get a warning during installation prerequisite check. If you wish, you can continue installation like that, however it’s highly recommended that you increase your min virtual memory. This will increase both installation and SAP runtime performance.

3. Make sure you install correct version of JDK (link given above). If not, you may get some java runtime related errors during installation.

4. Although in this demo, i install using an external drive, if you have a chance, copy installation media to your hard drive and start installing SAP from your hard drive. (i’d suggest using min 7200rpm drive!!!) It’s better to keep installation media and installation path (where you install your SAP instance) on different partitions. Also, make sure that you have enough space on your drive for this installation. Just to give you an idea, once installation is complete, just the size of database files will be 160GB!

5. Important!!! If you’ll follow this demo, make sure you name your SAP instance (SID) as ECC. The reason is, once we start installation, as first step, installer will ask you to enter SAP Solution Manager Key for your installation. At this point, make sure you have your installation details as follows:

  • SID: ECC
  • Client: 00
  • Host: ECC6

Before starting, it’s always a good practice to organize installation media in logical folders so that it’s easier to find once sap installer asks for them.

Since we are installing on a 64bit windows environment, we need to start the installer for that one specifically.

Go to installer folder > 51037622 > IM_WINDOWS_X86_64 > sapinst.exe.

Now, installer starts loading…

Select EhP4 for ERP 6.0 > MS SQL Server > Central System installation option, as seen below.

Provide System ID. For this demo, it’ll be ECC.

Then, enter master password for your system. This password will be used for all SAP accounts created during installation. You’ll also use this password after installation to log in with DDIC and SAP* users.

Provide export package paths. Installer will ask you in the order of 1, 4, 2, 3.

Once you are done with entering all necessary parameters, parameter summary will be displayed. Here if you want you can make some changes.

Here i strongly recommend increasing number of database abap import jobs. By default it’s 3. For this demo, i chose 10 import jobs to be executed in parallel.

Once you are done revising input parameters, you can click next.. At this point installer has got all required input from you.. Installer will start executing 23 phases.

Here 1st phase is ‘Check Solution Manager Key.’ You need to have a unique key for your installation that you need to obtain from SAP Solution Manager. If you’d like to follow this article and use same names i used here, drop me a personal note, i’ll try to pass it over…

Longest phase will definitely be ‘Import ABAP‘ phase. Depending on your machine, this phase can take from hours to couple of days. 🙂 Be patient!!! Make sure you turn off Windows Automatic Updates. Last thing you wanna see is to wake up in the morning, run to your machine and see it`s been restarted by Automatic Updates!

If everything goes ok, once installation is complete, you`ll see a screen as follows.

Finally, we completed SAP IDES ECC 6.0 installation. Now, you can go ahead, install SAP GUI and start using your system. 🙂

Let me know if you have any questions.. Hope this post helps some folks out there..

Found this post helpful? Please donate, so that i can donate you back 🙂

zieglers

Posted in IT Stuff, SAP | Tagged: , , , , , , , , , | 50 Comments »

SAP IDES ERP 6.0 EHP4 / NetWeaver 7.01 Installation Guide on Windows 2003 64-bit – Part 1

Posted by zieglers on November 10, 2009

ECC Chart

Recently i was checking the posts I wrote about SAP IDES installation, and realized it’s been a while since I wrote the last one: https://zieglers.wordpress.com/2007/08/26/sap-r3-ides-47200-sr1-installation-on-windows-2003-r3-and-sql-server-2005/

Well, I think a brand new one is almost necessary: Here I give u, SAP IDES ECC 6.0 Installation on Windows 2003 with SQL Server 2008. I’ll try to explain the process with screenshots and try to keep it really simple. Hope it works!

=========================================================================================================

Step – 1: Download installation DVDs / files from SAP Service Marketplace:

Navigate to installation media

https://websmp101.sap-ag.de/~SAPIDP/002006825000000234912001E

Once you are at SAP Service Marketplace homepage, first click ‘Downloads‘ in first line navigation and then ‘SAP Installations & Upgrades‘.

1-) 1  2-) 2  

On the left navigation, select ‘Installations and Upgrades‘, then ‘SAP Application Components‘.

3-) 3   4-)4

Then, select ‘SAP ERP‘, ‘SAP ERP Enhance Package‘ and ‘EHP for SAP ERP 6.0 / NW 7.01‘ respectively, as shown below. 

5-) 5 6-) 6 7-) 7

Since we’ll be installing IDES version, select ‘IDES-Version‘, and then ‘Windows Server – SQL Server‘.

😎 8 9-) 9

Download media for Export, SAP Installer, Java Component, UC Kernel and SAP GUI

Installation media necessary for SAP ERP 6.0 can be categorized in 5 main titles. This means once you start installing SAP ERP 6.0, SAP installer will ask you installation DVDs for 3 parts. Those are 1. Export DVDs, 2. Java Component, 3.Kernel. Additionally, you’ll need SAP Installer media itself and also SAP GUI. Now, let’s take a look which ones to download.

Export DVDs: You need to download 27 export parts named ‘IDES ERP 6.04/NW 7.01 Inst. Export‘. Once you extract those, there will be 4 DVDs, as shown below. Normal SAP ERP 6.0 installer comes with 2 export DVDs. Extra 2 DVDs result from the fact that IDES version includes many sample companies and related data to be installed.

10   11

Note from installation experience: Once installer finishes import jobs, you’ll have almost 160 GB sized database files and 10GB log file in total. No kiddin’! 🙂 (See below)

12     13

Java Component: You need to download 4 parts for ‘NW 7.0 EHP1 SR1 Java based SW Components‘ as shown below. This will be only 1 DVD. Depending on your installation choice – ABAP vs. JAVA based – you might not need those during installation.

14

Also you need 3 parts BS Java components, ‘Java Comp. 7.0 SR1: ERP,CRM,SRM,SCM‘, as shown below.

15

SAP GUI 7.10: You need to download 2 parts for ‘NW 7.0 Presentation – 7.10 Compilation 4 Present.‘, as shown below.

16

UC Kernel: You need to download 1 part for ‘BS 7 SR1 UC-Kernel 7.01 Windows Server on x64 64bit‘, as shown below.

17

SAP Installation Master: You need to download 3 parts for ‘IDES Inst. Mst. 7.01: ERP, CRM, SCM‘, as shown below. This is basically our SAP NetWeaver Software Installer.

18

=========================================================================================================

This completes 1st part of this article – SAP IDES ERP 6.0 Installation – Gathering Installation Media. We’ll continue with installation environment in 2nd part of the article and start the installation.

If you didn’t recieve your installation media as DVDs, above mentioned approach was an alternate way to get your installation media. Hope this helps and let me know if you have questions.

Found this post helpful? Please donate, so that i can write more of those 🙂

zieglers (runs SAP) 🙂

Posted in IT Stuff, SAP | Tagged: , , , , , , , | 16 Comments »

SharePoint Alerts Export Import add-in Part – 3

Posted by zieglers on November 9, 2009

Alerts

Here is the 3rd part of the article – SharePoint Alerts Export Import add-in. I realized that it’s been a while that i wrote first and second articles. Taking a quick look at those, i see that “importing alerts” logic is left for this article.

Importing alerts can be done for a selected site collection and also individual subsites can also be selected explicitly. Alerts export logic was exporting all alerts of a site collection, not only root site, but also all subsites. Also those alert details were stored in an xml file in a structured manner. However, for import operation we need a selective import logic. Not all the time we might need to import alerts for a whole site collection. That’s why logic will be a little more complicated than exporting alerts.  

Moreover, an import operation can take some time based on number of alerts being imported and number of subsites exist. That’s why we need to have an SP Long operation so that user knows operation is being executed. Here there is a nice thing to note, that is, if user somehow closes the browser, import operation is not interrupted and goes on in the background until finished.Another important thing is the difference between type of alerts:  sp list alerts and search alerts. Although both of them are using SPAlert class, based on attributes being set a generic list alert can become a search alert. (p_query is the most important attribute for a search alert, basically which holds the query of the search alert)Here is a look how our Alerts Import application page ui is going to be like.   

1

After this intro, it’s time to get started.  Firstly let’s take a look at UI design. 

Alerts Import Page – UI Design

As for site collection selector seen above in first subsection of UI, we’ll use OOTB SharePoint SiteAdministrationSelector control. This control is frequently used in many application pages of Central Admin. Then, in order to list all subsites (in subsection 2) after a site collection is selected, we’ll have a CheckBoxList control. Finally, there is going to be a FileUpload control to select import file – the file which is exported using Alerts Export page. In addition, there is a “Verify” button to validate selected import file.  

SiteAdministrationSelector control 

<!-- *********************************************************
DISPLAY THE SITE COLLECTION SELECTOR USING THE InputFormSecton AND SiteAdministrationSelector CONTROLS. -->
<wssuc:InputFormSection runat="server"
   Title="<%$Resources:spadmin, multipages_sitecollection_title%>"
   Description="<%$Resources:spadmin, multipages_sitecollection_desc%>" >
   <Template_InputFormControls>
      <tr><td>
         <!-- Put your control here-->

<SharePoint:SiteAdministrationSelector id="SiteCollectionSelector" runat="server" OnContextChange="OnContextChange" /></td></tr></Template_InputFormControls> </wssuc:InputFormSection><!-- ********************************************************** -->   

Subsites CheckBoxList 
 
<!-- **********************************************************
DISPLAY ALL SUBSITES USING THE InputFormSecton AND ASP:CheckBoxList CONTROLS -->
<wssuc:InputFormSection runat="server"
   Title="Web Sites"
   Description="Check web sites for which you want to import alerts" >

   <Template_InputFormControls>
   <tr><td>
      <asp:CheckBoxList ID="cbWebs" runat="server" CssClass="ms-listheaderlabel" EnableViewState="true"   />
   </td></tr>        
   </Template_InputFormControls>
</wssuc:InputFormSection>
<!-- *********************************************************** -->

FileUpload control for Alerts Import file and Verify Button
  
<!-- File name section -->
<wssuc:InputFormSection
    Id="SelectFileSection"
    Title="Select Alerts File"
    Description="Browse to the alerts file you intend to import."
    runat="server">
    <Template_InputFormControls>

        <wssuc:InputFormControl runat="server" LabelText="Name :">
         <Template_Control>
         <span dir="ltr"> 
          <asp:FileUpload ID="FileUpload1" runat="server" />
         </span>
         </Template_Control>
        </wssuc:InputFormControl>

        <wssuc:InputFormControl LabelText="Before importing, you can check this alerts import file for detailed errors, warnings, and other information." runat="server">
         <Template_Control>
          <asp:button class="ms-ButtonHeightWidth" runat="server"
           text="Verify"
           OnClick="ButtonVerifyClick"
           id="ButtonVerify">
       </asp:button>
         </Template_Control>
        </wssuc:InputFormControl>

        <wssuc:InputFormControl runat="server">
         <Template_Control>
          <div><asp:Label id="lblFileValidation" runat="server"/></div>
         </Template_Control>
        </wssuc:InputFormControl> 
    </Template_InputFormControls>
</wssuc:InputFormSection>

Alerts Import Page – Import Logic Design

So far, we have our UI elements ready. Now, let’s take a look at application logic. Almost all page logic is executed after user clicks ok button. Here is BtnSubmit_Click logic:

Basic validations

  • Check if at least one web selected or not –> Display validation message if no web selected
  • Check uploaded file –>Restrict the user to upload only .xml file

Preparations

  • Assign import log file name and path
  • Get url, port, virtual path details

Import Operation

  • Read Alerts xml file for import operation
  • Initialize date and alert count
  • Iterate through each row of ‘Alerts’. This is also equivalent to looping through each web object.
    • Only import alerts for selected webs
    • Get alert property values from xml
    • Check Alert Template Type. This determines if an alert is a Search alert, List Alert, Item Alert …etc.
    • Create alerts

Alerts Import Page – Implementation

Basic validations

Before starting to import alerts, first we need to check alerts import file. Here we get some info about file using FileUpload control and only allow .xml files.

// Check uploaded file
if (FileUpload1.HasFile)
{
    // get the full path of your computer
    string strFileNameWithPath = FileUpload1.PostedFile.FileName;
    // get the extension name of the file
    string strExtensionName = System.IO.Path.GetExtension(strFileNameWithPath);
    // get the filename of user file
    string strFileName = System.IO.Path.GetFileName(strFileNameWithPath);
    // get the file size
    int intFileSize = FileUpload1.PostedFile.ContentLength / 1024; // convert into byte

    // Restrict the user to upload only .xml file
    strExtensionName = strExtensionName.ToLower();
    if (strExtensionName.Equals(“.xml”))
    {
        // upload the file on the server
        FileUpload1.PostedFile.SaveAs(AlertsDir + strFileName);

        strMessages += “Uploaded file details <hr />” +
            “File path on your Computer: ” + strFileNameWithPath + “<br />” +
            “File Name: ” + strFileName + “<br />” +
            “File Extension Name: ” + strExtensionName + “<br />” +
            “File Size: ” + intFileSize.ToString();
       
        // Assign Alerts File Path
        alertsFile = AlertsDir + strFileName;
    }
    else
        strMessages += “<br />Only <b>.xml</b> file is allowed, try again!<br />”;
}
else
    strMessages += “<br /><b>Select Alerts File: </b>You must select a valid alerts import file.<br />”;

Preparations

You can choose an import log file naming convention based on your needs. Here I used DateTime stamp.

// Assign import log file name and path

string logfile = logDir + “ImportLog_” + DateTime.Today.Day.ToString() + DateTime.Today.Month + DateTime.Today.Year.ToString() + “.txt”;

Import Operation

  • Read Alerts xml file for import operation

// Read Alerts xml file for import operation
System.Data.DataSet ds = new System.Data.DataSet();

// Read selected alerts import xml file
ds.ReadXml(alertsFile);
ds.Locale = System.Globalization.CultureInfo.CurrentUICulture;

// Read xml document
System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
doc.Load(alertsFile);

// Keep a list of selected webs in an arraylist
ArrayList selectedWebsList = new ArrayList();
foreach (ListItem item in cbWebs.Items)
    if (item.Selected)
        selectedWebsList.Add(item.Text);

  • Initialize date and alert count and check datatable loaded by xml file.

// Initialize date and alert count
long AlertCount = 0;
DateTime start = DateTime.Now;
DateTime finish = DateTime.Now;

// Check if xml file has tables for alerts data
if (ds.Tables.Count < 2)
{
    LogMessageToFile(logDir + “ErrorLog.txt”, “Not a valid Alerts xml file”);
    strMessages += “<br /><font color=red><b>File Error: </b></font>Not a valid Alerts xml file! <br />”;
}

  • Iterate through each row of ‘Alerts’. This is also equivalent to looping through each web object.
    • Only import alerts for selected webs
    • Get alert property values from xml
    • Check Alert Template Type. This determines if an alert is a Search alert, List Alert, Item Alert …etc.
    • Create alerts

In case you are having trouble implementing the solution, here is AlertsImportIntoWebs.aspx page: AlertsImportIntoWebs.aspx

zieglers

Posted in IT Stuff, SharePoint | Tagged: , , , , , | 7 Comments »