WebUI components for ITSM

I am currently supporting a SAP Solution Manager ITSM project which requires a lot of modification to the standard ITSM WebUI components. Thus, I have created tiny overview of the most important BSP components in this area. I would like to share this overview here, in case anybody else is looking for one of the specified WebUI elements:

Header comp. Search comp.
Ticket (general) AIC_INCIDENT_H AIC_INCIDENT_S
 RfC AIC_CMCR_H AIC_CMCR_S
 Change AIC_CMCD_H AIC_CMCD_S
 Task BT125H_TASK
 Incident AIC_INCIDENT_H AIC_INCIDENT_S
 Service Request AIC_INCIDENT_H AIC_SRVREQ_S

If I missed an important component, please let me know.

Advertisements

Convert saplogon.ini to SAP Java PlatinGUI connections

I like to use my native Mac OSX system and the Java PlatinGUI for working and developing with SAP whenever I can. Of course, I know that the native Windows GUI is way more advanced (because better taken care of by SAP), but I hate to boot my Windows VM every time I want to do something SAP-related. Since I work for multiple clients having multiple SAP installations (ERP, CRM, Solution Manager, …), I want to have my SAP connections in synch. For my Windows systems – yes, I do have a few of them – I share the saplogon.ini via Dropbox. However, that doesn’t help me having the same connection entries in my Mac Java SAPGUI (PlatinGUI).

Hence, I wrote a tiny (and not very fancy) Python script to convert the saplogon.ini entries to the connection strings used in the Java SAPGUI’s connections file (which on Mac OSX can be found in the user’s Application Library folder). It doesn’t do much and it is not very robust against invalid input, but I would like to share it here, so anybody can use it for their own purposes. If you have an advice on how to improve the script radically or on how to support more input information, please let me know.

#!/usr/bin/env python

import sys, os

try:
    fname = sys.argv[1]
    fh = open(fname, 'r')
except:
    print sys.argv[0], ' <path/saplogon.ini>'
    sys.exit(-1)

data = fh.readlines()
fh.close()

# initialize entry data base (100 records)
entries = []
for i in range(100):
    entry = {'description': '', 'server': '', 'router': '', 'database': ''}
    entries.append(entry)

for line in data:
    data = line.strip()
    if data != '':    # ignore empty lines
        if data.startswith('[') and data.endswith(']'):
            key = data.lower()[1 : len(data) - 1]
        else:
            parts = data.split('=')
            item = parts[0]
            value = parts[1]
            try:
                nr = int(item[4 : ])
                entries[nr][key] = value
            except ValueError:
                pass

# now print connection strings for Java GUI
for e in entries:
    if e['description'] != '':
        comp = '/' if e['router'] != '' else ''
        connStr = e['description'] + ':conn=' + \
            e['router'] + comp + \
            '/H/' + e['server'] + \
            '/S/32' + e['database'] + '&expert=true&wan=true'
        connStr.replace("/H//H/", "/H/")
        print connStr

SAP CRM – How to debug BOL objects

With SAP CRM and BOL (Business Object Layer) / GenIL (Generic Interaction Layer), SAP introduced an object-oriented modeling and programming framework. It takes some time to get used to this approach – and knowing OO techniques is most certainly very helpful there – but once you know how to work with BOL/GenIL some development tasks become very easy and straightforward.

With the GenIL BOL and – even more – with the GenIL model browser, SAP delivers tools to analyze and work with BOL objects without requiring custom development. Using these tools, you can browse your BOL model and determine the attributes and relations per object.

However, sometimes you do want to check you objects’ structure directly at run-time, thus in the ABAP debugger. This short post will show you, where to find the appropriate information using the data browser in the debugger. In detail, I will explain how to

  • Access the attributes of a BOL object
  • Find all related objects
  • Find all entities belonging to a BOL collection

 

To start browsing your BOL object, double-click on a BOL entity or collection. You will see something like this:

BOL entity

BOL entity

 

What you see here is the structure (classes, attributes) of a BOL entity of type BTAdminH. To navigate to the (plain) attributes, you must open (double-click) CONTAINER_PROXY -> DATA_REF, then doube-click the object type in the view below.

Data ref object type

Data ref object type

 

You will see your actually BOL type now (BTAdminH in our example) and be able to navigate one step down via ATTRIBUTE_REF.

BOL object

BOL object

 

Once again, you will have to double-click on the object type, then you will see the BOL attributes as you would for any other ABAP run-time or dictionary structure:

BOL attributes

BOL attributes

 

To find about the object related to the current BOL object, go back one step and click on the RELATIONS attribute.

Relations

Relations

 

Double-clicking this entry will display a table with all relations (relation types) as well as a list of related entries per type.

Related objects

Related objects

 

You can use the OBJECTS field to navigate to the related objects.

In most cases, you will start with a collection of BOL objects. Moving from a collection to the objects is possible via the ENTITY_LIST attribute. It is a table with all entities belonging to the current collection.

BOL collection

BOL collection

 

From there, you can use the navigational paths described above. Have fun exploring your BOL objects and collections using the ABAP debugger.

Dynamic Include Texts (IDs …) in SAP Smartforms

I have decided to open a new section in my blog: Time and again, I stumble over SAP related problems and issues that consume quiet a large amount of my (precious) time doing debugging and bug fixing. Sometimes the SCN is a helpful source of information, sometimes it is not. For the issues that I had to fix without finding helpful resources in SCN or on the internet in general, I have created the SAP category in my blog, where I will write short posts on the original problem and the solutions that I have discovered.

The problem that I spent half of my morning on, had to do with SAP Smartforms. It is – generally – possible to create a text object containing the contents of a standard text element. In its most simple form, the text element is given through a static tuple: text name, text object, text ID, and language.

Smartform Text Element Static

It is also possible, to determine the text name dynamically in ABAP coding, e. g. in the Initialization routine, and use a variable as element property. If you want to do this, you have to change the property to dynamic (see red box in the picture below) and put the variable name between &.

Smartform Text Element Dynamic

Now, if you have correctly defined and set your variable, it should work as expected. It should!

For me, it didn’t work. Instead the text name was always empty. After some debugging, I found that the value got lost during a move operation/routine that is executed before the form is really generated.

perform %move using %textkey-name ‘&GV_TEXTID&’.

Further research showed that this routine checks the dictionary object and the variable length. If the value used in the smart form coding is longer than the dictionary element type for the text name field, the value is – not truncated but – set to SPACE. Don’t ask me why the SAP developer chose to go that way; it was surely giving me some headaches 😦

Hence, the solution would be to use global variables that have exactly the same type and field length as the text element property you want to set dynamically!