Saturday 31 October 2009

DDK's Top 3rd Party Applications and Utilities

I thought before I move to Windows 7 Ultimate and blow away Vista 32, I'd make a note of all the utilities I use the most (as a reminder to install them on the new OS!):

  1. All SysInternal Applications (http://technet.microsoft.com/en-us/sysinternals/bb795535.aspx), especially Process Monitor - to find out which processes are locking which files, what registry entries are used by an application. Autoruns is also one of my favourites.
  2. Tera Copy (allows resume if you file copy fails) - http://www.codesector.com/teracopy.php
  3. Fullshot Image Capture (http://www.inbit.com/fullshot.html) - I use this every day at work.
  4. Scooter Beyond Compare (http://www.scootersoftware.com/)
  5. ImgBurn - For all image burning needs e.g. Techned ISO images when installing Windows 7 (http://www.imgburn.com/)
  6. Lutz Roeder's .NET Reflector (http://www.red-gate.com/products/reflector/)
  7. Avast Antivirus - I've found this to pick up viruses that Norton misses on corporate networks (http://www.avast.com/eng/download-avast-home.html)
  8. VLC - Video Lan (http://www.videolan.org/) - wave your codec issues goodbye.
  9. HighJackThis (Antispyware) - http://free.antivirus.com/hijackthis/
  10. SpyBot Search and Destroy (Antispyware) - http://www.spybot.info/
  11. Firefox Mozilla, with Firebug and Download Helper and PDF download Addons
  12. Microsoft Virtual PC
  13. Microsoft Expression Studio
  14. Visual Studio 2008
  15. Type Mock
  16. NUnit
  17. MyGeneration (free code generation tool)
  18. Eclipse
  19. WinRAR
  20. uTorrent
  21. PowerISO - for mounting ISO images
  22. WSP Builder (for SharePoint deployment)
  23. CCleaner (aka Crap Cleaner)
  24. Visual Color Picker 2.0
  25. Notepad++ (as notepad replacement) - I hate having no undo!
  26. Paint .NET
  27. GIMP (another great free image manipulation program)
  28. Filezilla FTP Client
  29. Quest Toad for SQL Server
  30. Windows Live Messenger
  31. SharePoint branding tool http://brandingtool.codeplex.com/. This helps with the re-application of themes across existing sites as described here http://www.heathersolomon.com/blog/archive/2008/01/30/SharePoint-2007-Design-Tip-Import-your-CSS-for-SharePoint-Themes.aspx

I'm sure I've forgotten a few - but that will have to do for now!

Friday 30 October 2009

SharePoint 2007 vs SAP DMS vs SAP KM vs OpenText for Document Management

Differences between SAP DMS and SharePoint 2007


With SharePoint 2007 having such an incredible level of growth and popularity in the CMS, Portals and Collaboration space, questions arise as to whether the document management system (DMS) that comes with SAP should be used at all if both co-exist in the same enterprise environment. Here are some of the advantages as I see them when comparing the 2 systems:

SharePoint 2007 Advantages
  1. Familiarity to MS Office users and reduced training
  2. MS Office Integration e.g. Check in, check out and update document metadata from within Word/Excel/etc itself - without Install of SAP Easy DMS
  3. Offline capabilities i.e. checkout to "SharePoint Drafts" folder so you can work from home without a connection - without SAP Easy DMS
  4. Licensing - Licensing models are different - no SAP licenses required - esp if most users are not using SAP.

SAP DMS Advantages

  1. No Additional Licenses required if all users are using SAP
  2. Direct link of document to Business Entities directly without specifying additional metadata (e.g. supporting documentation for invoice) - this is sometimes a more natural linkage.

As desribed in this Cap Gemini blog on the subject - "Will we get to the point where companies just have their SAP system as a backend database and have SharePoint vNext (SharePoint 2014) as the integration platform? "
(From http://www.capgemini.com/technology-blog/2009/02/will_sharepoint_14_become_sap.php)

[UPDATE 2nd November 2009 - 1]
It has been pointed out to me that a comparison between SAP KM and SharePoint 2007 would be a more relevant comparison.

SAP KM Advantages

  1. Doesn't have requirement for client (like SAP Document Management System (DMS) does)
  2. Can preview CAD and other documents within the Web UI directly, unlike SharePoint
  3. Closer integration with SAP Business Data versus SharePoint

[UPDATE 2nd November 2009 - 2]
SAP Document Management offering with OpenText

One of my Oakton colleagues brought this to my attention - SAP now has a partnership deal with OpenText.

"The last option (out of SharePoint/DMS & KM/OpenText) is really powerful but comes at a price as OpenText is a leader in Document Management and integrates into SharePoint seamlessly. For large organisation with strong records management requirements with industrial class DM requirements option 3 would be a good choice, hoping that OpenText has done all the heavy lifting in terms of SAP Integration."

Wednesday 14 October 2009

SAP - Creating and Updating Vendor Master Records through SAP API

As an ERP, you would think that programatically creating a basic Vendor record in SAP would be one of the basic, easily accessible functions right?

WRONG! (Thunderclap ensues...)

When creating technical specifications for a vendor create function being called from SAP BPM, I tried to find how to programmatically create a Vendor. Unfortunately, this area is not well documented (like many areas of SAP) so I had to do the usual exhaustive/brute force search for the correct Function Module or Class Calls to make. This is what I found:

  1. There is a BAPI in SAP called "BAPI_VENDOR_CREATE" that I found through standard transaction /nbapi - however if you look at the definition it doesn't actually have any parameters. This effectively makes it useless. Obviously it is for internal use!

  2. The SAP Enterprise Service (BusinessPartnerDataManagementSupplierIn) is not comprehensive at all - it has a create, but not an update. Seems like quite an oversight to me... I am reluctant to use the enterprise service (which is the "Best Practice" Method of making updates to SAP) for the "Create Vendor" call, but another API set for the Update of that same Vendor. My search continues...
  3. Perhaps it is available as a Class, not a BAPI or Enterprise Service.... so I went to transaction /nse80 (Repository Browser) and did several exhaustive searches on SAP classes. I eventually found a few possible candidates - and nailed it down to the "Vendor Maintenance API" - VMD_EI_API, which has an "INITIALIZE" Method and a "MAINTENANCE" method which allows for the create and the update of vendors. Voila!

    Using the Repository Browser to nail down that Vendor Create API:

Found the needle in the proverbial haystack at the bottom of the search list (VMD_EI_API - the SAP Vendor Maintenance API):

Here is the model we used to call this from web services (done via SAP PI to simplify mapping):


UPDATE (14 Oct 2009) : Obviously other people have been having the same issue trying to find the API - as per my post on the SAP Developer Network (SDN) - https://forumsa.sdn.sap.com/thread.jspa?messageID=8283585#8283585


SAP - How to find which SAP Classes, Interfaces and BAPIs write to a particular SAP Table in SAP GUI

  1. In SAP GUI, go to /nse11 and enter your table name (e.g. Table "LFA1" for SAP Vendors).
  2. Click display to display the table (this is just transaction SE11_OLD)
  3. Just choose Programs, Classes/Interfaces and click Execute. You will be provided with a full list of the BAPIs, classes and interfaces that reference that table.
  4. Alternatively you can use transaction /nse37 to search for BAPIs that have a name similar to the table or the functionality they expose (e.g. *VENDOR*).

Emulating SAP GUI in InfoPath 2007 - How to determine how extended lookup fields in the SAP GUI are populated & using the InfoPath SLP Addon

I've recently been creating browser based InfoPath forms as a frontend to SAP to make it a bit more palatable from the end user perspective. Most of the built-in forms in SAP GUI have a lookup mechanism that allows users lookup related data and pick a particular record. e.g. relate the Requesting Employee to a particular Purchase Order.


However, I had 2 issues in doing this:

  1. InfoPath doesn't have the ability to pop up a lookup form to permit the search for lookup information when creating records via a picker (as opposed to a dropdown with 1000s of records in it).
  2. It isn't obvious where the data comes from in the SAP GUI - it can be from SAP tables, views or function calls.


Resolution 1 - InfoPath Form:


For creating lookups/pickers for large datasets I used the SLP Addon for InfoPath 2007 (at http://hermansberghem.blogspot.com/2007/11/free-download-slp-infopath-extension.html). This allows lookup screens to be implemented outside the InfoPath form (it's not really feasible to have 1000s of SAP records show up in an InfoPath dropdown). I then created SharePoint Custom Application Pages which made calls to SAP Enterprise Services and to BAPIs exposed as web services to populate the lookup forms. This worked much better than I expected.


Resolution 2 - Determining Datasources of Lookup fields in SAP :

To work out how some of the equivalent lookup forms were populated in SAP, you can either cross your fingers and trawl through all the foreign key relationships and structures OR you can simply do the following:

  1. In SAP GUI, go to your transaction that does the lookup (e.g. Project Create Transaction /ncj01).
  2. Click on the field that does the lookup e.g. Person Responsible for the Project and click on the lookup helper button

  3. Press F1 for help when on the lookup screen

  4. Click on the Technical Information Icon on the Help Screen
  5. There you have it – the table name for the lookup - TCJ04:
  6. Double-click on the table name in the Technical Information form to View the Table Definition
  7. If you want, use transaction /nse16 to view the data and click Execute to confirm that the lookup information is the same as presented in the SAP GUI.

SAP Transaction and BAPI Knowledgebase

The SAP GUI is the default application for updating and viewing SAP data. While it is aimed at business and power users, it is quite an inaccesable rich client windows application with limited search functionality and the requirement to know many SAP "transaction codes" off the top of your head.

To help me (and you) a little, below is a list of some of the most useful transactions available in the SAP GUI Tool (pictured below). I've had to use them all more than once in my current SharePoint to SAP Integration Project and especially in writing combined SAP/SAP BPM/SharePoint technical specifications:

SAP Transactions (enter through SAP GUI transaction area in the top left hand side)

Note that you can prefix a transaction with /o (instead of /n) which will open the transaction up in a new window in the SAP GUI e.g. /ose11 for the ABAP dictionary
  1. /nse11 = ABAP Dictionary (for maintenance of tables and table data)
  2. /nse16 = Data Browser for Tables
  3. /nbapi = official UI for looking for built-in BAPIs with full documentation.
  4. /nse37 = Function Builder (for searching for custom BAPIs not in /nbapi)
  5. /ose24 - to find SAP classes (not BAPIs). Look here if you cannot find a BAPI that will do the job e.g. Vendor creation
  6. /soamanager = SOA manager
  7. /nsicf = Maintain web services
  8. /nswf_bam = Business Activity Monitoring (for SAP BPM)
  9. /nse80 = object explorer
  10. /nse10 = Transport Organizer (to see what is in a transport)
  11. /nXK02 = Change Vendor
  12. /nxk01 = create vendor
  13. /nme23n = Official Display Purchase Order, click “Other purchase order”
  14. /ncj03 = Display Project (NB. typically, any business object transaction ending in 01 is for create, 02 is update, 03 is for display)
  15. /h - turn on ABAP debugging (so you can work out what SAP GUI screens are doing in the background). Also allows you to write to tables directly with a workaround.
  16. /ncat2 - Timesheet entry
  17. /ncat7 - Transfer to Controlling (FICO).
  18. /ncats_da - Display Working Times
  19. /npa30 - Maintain HR Master Data.
  20. /nsu01 - User maintenance - so you can unlock users in SAP
  21. /nsxmb_moni - (For PI Server) - Integration Monitoring
Commonly Used Tables
  1. LFA1 - Vendor Master
  2. LFM1 - Vendor master record purchasing organization data
  3. EKKO - Purchasing Document Header
  4. EKPO - Purchasing Document Item (aka Line Items in your Purchase Order)
  5. T016 - List of Industries
  6. T000 - Clients
  7. T001 - Company Codes
  8. T005 - Countries
  9. T005 - Unit of Measurement (e.g. EA, Square Metres)
  10. PROJ - Projects
  11. PRPS - Work Breakdown structure (WBS) - basically project line items
  12. SKA1 - General Ledger Account master (aka Chart of Accounts)
Enterprise Services Additional Notes
  1. AccountDeterminationExpenseGroupCode is synonymous with GL (General Ledger) Code when working with Purchase Order Enterprise services.

    The SAP GUI - definitely not an intuitive application

Tuesday 6 October 2009

SAP Web Dynpro Java - Adding a new Item row to an existing model object

As part of a proof of concept (PoC) for one of my clients, I had to create a purchase order form which had multiple items against it - using an Adobe Form in Adobe Lifecycle Forms Designer. Some articles suggested that a JavaScript client side call (e.g. Table1.Row1.instanceManager.addInstance(1); would work - but in Adobe Document Services, this would never render for me - even if I forced the render to the most recent version of Adobe (9.0). It was suggested by SAP consultants that we should just be doing a full post back to the server and adding items in the server side Java code instead.

For adding items in a dynamic table like this on the server side (using the SAP Purchase Order Create Web Service (PurchaseOrderCreateRequestConfirmation_In, SAP ECC604), see below:


public void onActionAddItemRow(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionAddItemRow(ServerEvent)

// Here we get the current parent node of the model from the view
// context to which we want to add the item row

com.sap.demo.jrd.readpobyws.wd.readpowsmodel.PurchaseOrder poN = wdContext.currentPurchaseOrderElement().modelObject();

// Here we create a new, empty instance of the item row casting
// to the correct model class by using the associated model property
// of the parent node
// Note that at this point the instance is not yet bound to the item

com.sap.demo.jrd.readpobyws.wd.readpowsmodel.Item itemN = new Item((ReadPOWSModel) poN.associatedModel());

// Here we create an instance of a subnode of Item using the same
// approach
com.sap.demo.jrd.readpobyws.wd.readpowsmodel.SHORT_Description descN = new SHORT_Description((ReadPOWSModel) poN.associatedModel());

// If you wish to set default values in the leaf elements this is how
descN.set$0023SimpleContent("New item");
itemN.setID("99");

// Here we put the subnode for the Description into the parent Item
itemN.setDescription(descN);

// Here we create an instance of the subnode for the Accounting Coding
// Block Assignment using the same approach
com.sap.demo.jrd.readpobyws.wd.readpowsmodel.PurOrdERPItmByAcctgCodgBlkDistrRsp_SAcctgCodgBlkAssgmt aCBAsN = new PurOrdERPItmByAcctgCodgBlkDistrRsp_SAcctgCodgBlkAssgmt((ReadPOWSModel) poN.associatedModel());

// If you wish to set default values this is the example:
aCBAsN.setAccountDeterminationExpenseGroupCode("0000112000");

// Here we create an instance of the subnode for the Accounting Coding
// Block Distribution, i.e. the parent of the ACB Assignment
com.sap.demo.jrd.readpobyws.wd.readpowsmodel.PurOrdERPIdRsp_SAcctgCodgBlkDistr aCBDN =
new PurOrdERPIdRsp_SAcctgCodgBlkDistr((ReadPOWSModel) poN.associatedModel());

// Here we put the subnode for the ACB Assignment into the
// parent ACB Distribution
aCBDN.addAccountingCodingBlockAssignment(aCBAsN);

// Here we put the subnode ACB Distribution into the parent item
itemN.setAccountingCodingBlockDistribution(aCBDN);

// Finally – once the substructure has been built, we add the item
// to the purchase order node – i.e. set the item as a new row
poN.addItem(itemN);


//@@end
}