Skip to Content

Over in my Personas idioms document I mention the concept of “transaction free lookup”, that is being able to lookup data in an SAP system without ever leaving the SAP home screen. The example I give there is of taking a purchase order number and looking up some of the details of the PO and displaying them directly on the home screen and not having to see ME23N at all. For this blog I want to take a simpler example. We use Service Management in ERP6 to manage the maintenance of our campus. One thing our users often want to do is lookup a functional location code to check they have the right one. Like this:

 

This is done with a simple script that calls transaction IL03, feeds it the value from the “Location” field on the home screen, copies the location description and then navigates back to the home screen before pasting the description in the appropriate place. Like this:

 

/wp-content/uploads/2013/08/screenshot_262594.png

/wp-content/uploads/2013/08/screenshot_262594.png

/wp-content/uploads/2013/08/screenshot_262594.png

 

You can take this process a little further by providing fuzzy matching. For example, what if I know part of what the building is called and want to find the location code? Like this:

 

 

Here you can see the search finds two locations with “university” in the description and you can choose which you want just by selecting the line. The corresponding details are copied back to the home screen. This uses a technique described by Tobias Queck in the document SAP Screen Personas – How to access the selected row in a grid for managing data presented in a grid. In summary, you need to use a JavaScript action in a script to access the selected line of the grid. The rest is standard Personas scripting. Here’s a detailed walkthrough.

 

The first thing to note is that there are two scripts involved, one on the home screen “Find” button which navigates to the search transaction and one on the search transaction that copies data back to the home screen. The first script is straightforward:

 

/wp-content/uploads/2013/08/screenshot_262594.png

/wp-content/uploads/2013/08/screenshot_262594.png

 

The only tricky thing here is step 3 – a little piece of Javascript to prepend and append “*” characters to the search term so that we do a wildcard search. Otherwise this is a simple script to run transaction IH11 to search for functional locations by description. It leads us to this IH11 screen (with an appropriate flavor):

 

/wp-content/uploads/2013/08/screenshot_262594.png

 

Now the fun starts! First note that there’s a hidden script button on this screen that does all the hard work. This button is linked to the GridView via the view’s properties, and in particular the PushOnClick property:

/wp-content/uploads/2013/08/screenshot_262594.png

 

The script on this button is quite short:

 

/wp-content/uploads/2013/08/screenshot_262594.png

/wp-content/uploads/2013/08/screenshot_262594.png

 

The clever stuff is in the first three steps. Step 1 grabs the whole table from the GridView. Step 2 takes the functional location code from the second column and step 3 takes the description from the third. The column number is in the brackets after “args.table” and columns are numbered from 0. The code “parseInt(args.row)+1” represents the selected row number. After that we simply navigate back to the home screen and paste the values into the appropriate text fields.

 

These techniques, along with the ability to call WebRFCs for lookup (Calling RFCs from a Personas script) or update (Using WebRFC for update in a Personas script) mean that via Personas you can give a user access to a lot of functionality in an ERP system without ever being aware of running an actual transaction.

To report this post you need to login first.

6 Comments

You must be Logged on to comment or reply to a post.

  1. Paul Hardy

    Traditionally clever things like custom screens with their own flow were done by ABAP programmers, using the tradtional DYNPRO and nowadays the good old Web DYNPRO.

    Every so often a new product comes out and the advertising blurb says “save money doing (whatever it is) you no longer need programmers, this can be done by business users WITHOUT ONE LINE OF CODE!!!”.

    A good example, is the graphical mapping in PI. Instead of writing a transformation program, you just drag and drop fields from the two structures and link them together? What could be simpler? I wish I could upload an image in this comment, I would show an actual graphical mapping I have seen in PI with boxes all over the place, about ten times as complicated as an ABAP program to do the same, and it still had lots of little Java programs inside some of the boxes.

    Variant Configuration also has it’s own programming language, as does SAP HR, and I have seen monstrous constructs in those locations as well.

    What is my point you may ask? Just from looking at the screen shots above it looks like you need to have the mindset of a programmer to some extent to get the fancy things from Screen Personas, and I wonder if people will end up building vast amounts of fucntionality and without realising it take more time and effort to get the desired outcome than if it had been offloaded on a programmer in the first place….

    (0) 
    1. Steve Rumsby Post author

      Just from looking at the screen shots above it looks like you need to have the mindset of a programmer to some extent to get the fancy things from Screen Personas, and I wonder if people will end up building vast amounts of functionality and without realising it take more time and effort to get the desired outcome than if it had been offloaded on a programmer in the first place….

                         

      You are right, to some extent. I am a programmer, and I’m pushing the boundaries a little of what Personas was designed to do. However, so far the cases I’ve encountered where a programmer’s brain is required are pretty limited. Most of what we’ve done so far with Personas can be done without a programmer. Standard scripting is, technically, programming, but it really isn’t hard to pick up. We have non-programmers here able to do it perfectly well.

      The JavaScript and WebRFC stuff is a different matter, but generally they make up just one or two steps of a longer script. Those specific steps could be added by a programmer, or they could be done by copy and paste – there’s not a lot of scope for variation. Any RFC functions would clearly need to be developed by a programmer.

      The bigger picture here is that, WebRFCs aside, all of the core functionality used by Personas is standard ERP transactions. That enormously reduces the testing effort for this stuff. It also enormously reduces the development effort. You’re building on core ERP rather than starting with a blank screen and having to develop it all. This was one of the main attractions for us.

      (0) 
  2. Cyrus Minab

    Hi Steve,

    First and foremost I would like to mention how much I personally enjoy reading your blogs and exploring some of the functionality.

    The example that you described above in regard to floc is exactly one of the cases that I’m trying to build which is basically do a fuzzy search by floc’s description and get a list of values and selecting the floc and displaying the data. What I wanted to ask you is in regard to classification and characteristics. In my scenario, I also need to display few of characteristics values against the floc’s classification. Have you had any personal experience retrieving characteristics value in Personas setting? Have you encountered any issue in this regard?

    Thank you again for sharing your experience.

    (0) 
    1. Steve Rumsby Post author

      My example is using the list display transaction IH11 to build a list of matching locations, and then selecting one from that list for further processing. Are you saying you want the characteristics to display in the IH11 list, or that you want to display them in the functional location display transaction IL03?

      I’m glad you are finding my blogs useful 🙂

      Steve.

      (0) 
        1. Steve Rumsby Post author

          So you have data for a functional location that is not displayed on the main screen but hidden behind a menu or a button, and you’d like to “move” it to the main screen. That sounds very much like what I did with IW33, described in this blog – Simplifying a multi-screen transaction with Personas. Basically I built a script that would copy the data from its standard place to the main screen, in the same way as described here, and than used the main screen’s “OnCreateHandler” to fire that script when the screen is rendered so that the process happens automatically. Read the blog and see if it helps. If you have further questions, ask them in the comments over on that blog!

          Steve.

          (0) 

Leave a Reply