Month: August 2012

Home / 2012 / August

GUI Scripting: A how to guide

Using SAP GUI Script

SAP GUI Script is a fantastic tool that can be used to create transactional testing data, Change existing master or transactional data, create master data in mass or even just data conversion for certain tasks that LSMW can’t handle.  GUI Script has been around for a while, but it always surprises me that so few people are familiar with it.
The basic concept around GUI script is that you can load information into an Excel worksheet, and using a macro, allows you to load data into SAP.  This document is going to walk you through creating your own GUI scripts and using them effectively.

Turning on GUI Scripting

Tranaction: RZ11
Param. Name: sapgui/user_scripting

Press Display
gui-01
If current value is not set to TRUE, press the Change Value and set the value = TRUE.
Please note, typically this a basis function, so if you don’t have access to transaction RZ11, please contact your basis team.
As an additional hint, if you want to have GUI Scripting always active, it is encouraged to activate it in RZ10 (this adds it to the startup profile).

Recording the Transaction

When you are ready to perform the recording,  be sure you know the transaction you want to execute and the data that you can use.  You should also know the screens you plan to visit and the fields that you will be filling in.  Keep in mind, you can always update the recording file, but the better your recording, the less errors you will encounter.
The important thing to remember is that GUI script can NOT perform any logic.  it only works for repeating the same steps over and over again.  This means that if you receive an error on some records, but not others, you will need to execute 2 different scripts.  One script will do the non errors, and other script will do the errors.  You can cut down a lot of time if you can segregate the data early.

gui-02

Activate the recorder.  It is encouraged to always start the main screen in SAP.  This prevents weird things that happens if an error occurs during the playback.

gui-03

Press More if you want to control where the file is saved.

gui-04

When you are ready to start, press the record button (Red Dot Button).

Then proceed to execute the transaction you wish to record.

gui-05

Be sure to use ‘/N’ in front of the transaction code.

gui-07
Enter in the document number and press Operations Button.

gui-08

Please note, when I added a new operation, I entered it on the bottom of the screen.  This allows you to avoid the risk of overriding exisitng data.

Press Enter.
Press Components Tab

gui-09

Again, add the data to the bottom of the screen.
Press Enter
Press Save
Note:  sometimes there will be errors.  If errors occur, you need to remember that maybe not Every order you change will have the error.
gui-10
I encourage you to press the green arrow back on every recording at the end.  This just helps to avoid incorrect loading of data.
gui-11
Press stop.
Now, go find the file.  Be sure to RIGHT click on it.  If you double click on it, it will attempt to execute the exact same transaction again.
You should see something similar to this:

gui-12
The parts of this file you care about are the lines that start: session.xxx
I encourage you to skip the first line that resizes your screen.  and copy all of the remaining lines in the file.
Next up, add this information to the excel file.

Gui Script

This will depend on your version of excel, but what you need to do is find the macro button:
MS 2003:

gui-13

MS 2007

gui-21
Be sure to enable macros.
gui-14
When the macro window opens, be sure to select the correct view on the left hand side of the screen.  Then move to the code section and find the area shown that says “Paste your recorded script below”.
If there is anything currently in this section, be sure to remove it, and replace it with the information from your recording (session.xxx).
gui-15

Now, I’m going to show you how to point this to your excel document.
session.findById(“wnd[0]/tbar[0]/okcd”).text = “/niw32”

session.findById(“wnd[0]”).sendVKey 0

Change:
session.findById(“wnd[0]/usr/ctxtCAUFVD-AUFNR”).text = “4000000”
To:
session.findById(“wnd[0]/usr/ctxtCAUFVD-AUFNR”).text = A

session.findById(“wnd[0]/tbar[1]/btn[17]”).press

Change:
session.findById(“wnd[0]/usr/subSUB_ALL:SAPLCOIH:3001/ssubSUB_LEVEL:SAPLCOIH:1107/tabsTS_1100/tabpVGUE/ssubSUB_AUFTRAG:SAPLCOVG:3010/tblSAPLCOVGTCTRL_3010/txtAFVGD-LTXA1[7,8]”).text = “my test op”
To:
session.findById(“wnd[0]/usr/subSUB_ALL:SAPLCOIH:3001/ssubSUB_LEVEL:SAPLCOIH:1107/tabsTS_1100/tabpVGUE/ssubSUB_AUFTRAG:SAPLCOVG:3010/tblSAPLCOVGTCTRL_3010/txtAFVGD-LTXA1[7,8]”).text = B

Since this can get long, I’ll jsut show you the first 2 changes.  You’ll notice that I found the first two lines where I entered in data.  I changed it to a single letter (no quotes).  This is the excel column where you enter in the data.  It’s that simple.  If anything is a constant, just leave it as it is.
When you’re done, press save and you’re ready to execute.

Executing the Script

Now, the first step before executing the script is gathering all the data.  Typically, this is done using SE16, SE16N, or certain reports (IW73, VA05, COOIS, etc).  As always, be careful with the data you enter.  It’s your user id that will be assigned to the change :).

Once you have the data you wish to execute, simply go the excel worksheet and execute the macro
*** NOTE:  Remember, when the script is running you can’t do anything with Excel.  You can continue working in SAP, but Excel will be locked for the duration of the script.

gui-16
**** NOTE ***
This is a VERY important one.  Be sure that the first SAP window open on your screen is the client you wish to change.  If you are doubt, be sure to logout of any client/system you do not want to change.  For example, if you are logged into production and QA.  You want to make the change to QA, I encourage you to log out of production.

gui-17
Press Run
Note:  if you have multiple excel windows open, be sure the correct macro name is highlighted.  If you aren’t sure, close the other excel documents.

gui-18

Gui Script will always give you a chance to check the results of the FIRST record.

gui-19

I encourage you to always check and make sure it saved properly before pressing ok.  If it did not, press cancel.  Otherwise the script will go all the way to the end.

Once you are done, it will return control back to excel.

gui-20

As long as you see OK in the row, the record processed.  if you don’t see ok, you’ll need to check that record and possibly reprocess it.

 

Tax Planning – Making Sure Uncle Sam gets his cut, and nothing more

A few days ago, I asked my accountant to make sure I was on track for my tax withholding for the 2012 year.  To my surprise, i wasn’t 🙁
What I quickly discovered is that the better I do, the more I need to pay in (gotta love our system, penalized for working harder).  The short story is that you need to be inconstant communication with your accountant.  I made a big mistake in not communicating my changes to my accountant.

So, here’s what I recommend.  First off, if you are a contractor, make sure that any time your rate changes, notify your accountant.  My rate changed by $10/hr in Feb, and that threw off the calculations by quite a bit.  To make things worse, I was also helping some clients remotely.   All of this factors into a much higher tax payment.  I always recommend working with your accountant because he can keep up to date if your tax bracket changes.  For me, I hate have to come up with large sums of money in April, I try to pay my estimated taxes as I go.  Even if you pay the whole bill in April (not sure if that’s allowed or not) you still need to be accruing money to pay that bill later.

Just as a side note, remember that in the US, the more successful you are, the more you are expected to be pay in taxes, and not just as a straight percentage.  This is always a conflict in my heart.  I strive to be successful and keep increasing my income in order to clear off all my debt and provide for my family’s future.  However, I vehemently disagree with how the government chooses to spend my money, so my ultimate goal is to start checking out of the system.  I want to pay off my debt, and build my homestead to be self sufficient, so that I can start to minimize the amount of money I pay in for taxes.  If you haven’t read Atlas Shrugged, I highly encourage it.  (for those of you without the diligence to read a 1000 page book, there is also a movie version that gives the same info.  ha ha).  So, my rant is over…

Just remember, keep in close contact with your accountant.  You don’t want a major surprises in the middle of the year (or in March).

Still learning the hard way…

“Who is John Gault?”

 

My Ideal Customer – More Marketing Stuff

Last week I started to talk about the unique selling proposition.  That was step one of the marketing class that my friend Justin and I both undertook.  The class is pretty good, but has some gaps, but that what you get when you sign up early and pay the bargain price =)

Well, step 2 (I’m a couple weeks behind on this, but luckily there are no tests) it to define who my idea customer is.  In my head this sounds easy, my ideal customer is anyone that will pay me a lots of money for my applications (or even services, but I’m trying to move out that model if possible).  However, after listening to the class, I learned there is a lot more to it.  Every person you interact can connect with you on different levels.  For example, I met my best friend James one night at a pick up game of flag football.  We had an instant chemistry, and someone knew after that night we would be lifelong friends.  Now I’ve met other people that when I initially met them, they drove me crazy, and hated to be in the same room with them.  Then we eventually built some rapport, and started to find common ground, and some of those people are now friends of mine that I keep in close contact with.  What I personally learned is that I often saw traits in other people that I hated about myself.  Until I realized that I didn’t them, I actually hated that part of my own personality, I couldn’t bring myself to like them.  Anyway, enough with the psychology lesson.  What is important is to know what sort of people you want to deal with, probably on a long term basis.  According to the class, you want to be able to visualize a single person that will be your customer.  It helps to avoid trying to sell to everyone, the whole be all things to all people.  We all know it doesn’t work, but it doesn’t stop us from trying.  Since I need to keep blogging, I figured the best way would be for me to figure it out with you… my audience (that I really hope will eventually show up.  ha ha)

My Ideal Customer is:
1.  someone that knows what they need, and can articulate it to me.
2. someone that can express their needs without being blunt/as ass.  (we all know the type)
3. someone that can afford what I’m selling
4. someone with vision for their organization.  Someone that is constantly seeking improvement.
5.  someone that understand their business.  For example, for me, they should fully understand their Service business and it’s problems.
6.  someone looking to build a long term relationship.  I don’t want a 1 and done customer.
7.  someone in their mid 30’s to early 40’s.
8.  and entrepreneur.
9.  someone with a small family and wants to be able to spend more time with time.
10. someone that reads self improvement books and listens to audio books.
11. someone that LOVES what they do.
12. someone that has seen multiple ways of doing business, not just a single company for their whole career.
13. someone very unassuming.  Doesn’t live and die by name brands or status symbols.
14.  someone that believes in the constitution of the US.
15.  a gun owner, or at least pro 2nd amendment.
16. someone that takes pride in being prepared for possible disasters (corporate or personal)
17. someone unwilling to accept government handouts in exchange for government control.
18. a Green Bay Packer fan (couldn’t resist)
19. someone that understands that success comes from hard work, not just a good idea.
20. someone that roots for the underdog.
21. low maintenance.  Won’t be pestering me daily with every little thing.
22. someone that can make a decision.
23. someone that takes care of their employees and wants to see them happy. (family too).
24. eats primal/paleo lifestyle.

The deal killers, or traits that I don’t want to deal with:
1.  short sighted, doesn’t look at the long term picture.
2.  Micro-managers.  Needs to be a hands off type person that will give a destination, but will allow people to get there any way they choose.
3. someone that thinks the status quo is good enough.
4. someone that procrastinates and just won’t pull the trigger, even when they know exactly what they should do.
5. vegan

Finally, you have to name your avatar (and I don’t mean the blue guys in that movie)…  So for me, my Avatar will be Alex.  I know it’s bias, but for those of you that don’t know, I have the coolest little boy, just about to turn 2.  So I can’t think of a name better than his =)  He will be 6′ tall, athletic build, brown hair, blue eyes.

Think I have him in my mind…
now…  who’s your ideal customer???  according to the class, we need this guy/girl for later lessons…  so start picturing =)

WMIGO is ready for the next phase – MIGO + WM is a winning combination

For anyone that’s been reading, you’ll know that I started a tool that would allow you to do a material movement and create the transfer order in a single step.  Well, I’m excited because last night, I put the finishing touches on that tool.  I still need to do some full scale testing and create the documentation for it, but round one is done.  It uses the idea of transaction MIGO and incorporates the WM pieces into it.

Some of the lessons I learned while building this, don’t clone transactions, and even be careful cloning screens.  I ran into this when I began to set up the serial number entry screen.  At first, I started by just copying the screen from MB1B.  Nice and easy, right?  not so much.  I quickly  came to the same realization as I did when I copied the MB1B transaction completely.  It works, but it opens the door to a lot of potential headaches.  So, like the main transaction, I looked at what was happening in MB1B, and took the important pieces.  Now there may still be things that will need to be added into future releases.  For example, at this time I’m not covering the user exits and enhancement points that the standard material movement have built into them.  This may be a requirement for some of my future customers, and if so, at that time I’ll work on building those into my solution.  IN the meantime, the functionality works, and I’ve created a pretty slick tool.

Finally, big thanks go out to Jeff Bass, without whom none of this would’ve been possible.  Jeff is quite possibly the best WM teacher out there.  Certainly the best I’ve ever met.  I knew very little about WM before sitting down with Jeff for an hour.  After that, I have a very solid grasp of how it works (and at least enough to set up a simple WM configuration).  So thanks Jeff…  couldn’t have done it without you…

as always, I keep learning the hard way so you don’t have to.

Unique Selling Proposition – USP

Today’s post is again, more on the business side, and not focused on SAP.  I’m big on learning, and trying to make myself better.  lately, I’ve been focusing a lot on sales and marketing, because that is where I’m the weakest.  I recently joined up to a training called the Remarkable Marketing Blueprint.  Sounds like exactly what I need.  The basics behind this is that every week you get a some MP3 files, some pdf’s and the instructor helps give you the map to effective marketing.  Like everything, you have to actually do it, if want the results.  Week 1 had 2 focal points, the first I’m going to talk about today.  It’s the Unique Selling Proposition, or USP for short.  The concept behind it is very simple.  Why should someone buy from me rather than someone else (or buy nothing at all).  Since I’m in the midst of creating a new joint venture, it seemed like the right time to start solidifying this stuff.  Afterall, it makes perfect sense.  If I can’t verbalize why someone should buy our products, why would they bother to buy from me.

Now, I still haven’t come up with my final piece, but I have narrowed down a lot of reasons why my applications should be purchased.  If anyone out there has some thoughts…  or can even give me a different spin on this, please post a comment.  I welcome an outside opinion.

Why is Paper Street Enterprises, and soon to be JaveLLin Solutions the place to buy SAP Add-in’s?
1.  Industry experience.  I’ve worked at or consulted to 12 different companies, all with their own flavor of service management (many also encompassing Variant Config, my other specialty).  I believe my partner Mike is in the same ballpark on the PP side of the house.
2.  Not only have we implemented the solutions, we design them.  I have a special combination of skills that allows me to not only see the problem, but I can define it and solve it using ABAP.
3.  We design the best of breed, or best practice solutions out of the box.  No more painful design cycles.  We give you the tools to improve your business today, not 3 months from now.  Sure, you could hire a developer to do what we’ve done, but you also need to think through all the scenarios we’ve already factored into our tools.  In addition, we can provide updates for any issues encountered by any of our clients…  so your software purchased from us will mostly like cover any processes you have, if not, we can add it.
4.  We are small and nimble.  We can quickly react to the needs of our customers.  If you need a solution that we don’t currently offer, and it looks like it could be a useful tool for other companies, we can quickly change directions and design.

These are really the big things that make us special.  NOW…  how do we work that down into a sentence or two?  I’m still working through that…  the good news is, we know why we’re special.  We just need to get some customers to prove it…

As always, learning things the hard way, so you don’t have to.

Cloning a WordPress Website

Hello again, the past few days I’ve been working pretty hard on getting things setup for the new website.  Being the CTO means that I should probably be able to handle little things like a website.  If you’re been following me, “and judging by the attendance, you haven’t”, you’ll know that I recently had this site redone.  I worked with a guy, Ben Fitts, that I would highly recommend.  Well, I spent a bunch of money to launch that site, and My partner Mike said he also liked it, so why not use it again for JaveLLin Solutions.  In my head, it sounded like a simple task.  I’ll just take my paper street website, copy it over to JaveLLin, and rebrand it.  I’ll give you time to time to stop laughing.

Well, as any good newbie would do, I went to the web and started searching.  It wasn’t long before I found a several pieces of software offering to do this.  I looked at the price tag, and it was $100.  I only needed to do this one time, so I kept digging.  I finally found someone that did the smart thing.  They found out how to do it, added some screen shots, and then sold it for $15.  I bought it.  The instructions were good, and pictures clear, and it was as easy as 8 simple steps…  “mostly”.

My first challenge was using a poor hosting site.  For those of you looking for a hosting site, take my advice and avoid Fatcow.  For a long time, they were good enough for me.  But as soon as I started to up my game, I quickly discovered that all of the stuff they offer is out of date.  I can’t updated to latest wordpress, or database, the blog platform was aweful, and the help desk was substandard.  Short story, I’m cancelling my account there.  Hostgator has been great and i would highly recommend using them.  Reasonably priced, and great service.

Anyway, after playing with my site on Fatcow and not figuring out what I did wrong (this took about 2.5 days), I finally decided to make a new domain on my existing hostgator account.  Almost instantly, the cloned site worked.  However, since Ben set me up with a login and protected area to download files, I had to completely reconfigure that.  Not rocket science, but it was time consuming.  However, I’m excited, because the new site is up and running and seems to be great.  One of my next challenges will be adding all the information for Proximity (our newest product).  Adding pages is easy, but coming up with graphics that looks good… well, that will be a learning exerpience again…

Anyway, that’s why you have me…  I learn things the hard way, so you don’t have to…

 

Upgrading the SAP Kernel

You never know what I’m going to talk about next.  Even I wonder if there is a method to my madness (I hope so 🙂 ).  Anyway, today’s task is to update the SAP kernel on my ERP 6.0 EHP4 system.  I can’t get the crazy thing to start, so one of the suggestions online was to upgrade to the latest kernel, so here I am.

Step one.  Download the files.  YOu need the database file, the database independent file, and of course SAPCAR.EXE.  You can find all this on service.sap.com.  Normally, I just do a search and look for Kernel and my version.  In this case, I needed to find Kernel 7.01.  From here, SAP will guide you down the path depending on your OS and your DB type.  Look for the file with the biggest number or latest date.

Next up, save all these files to a location, and extract them.  This is what SAPCAR is for.  Since I’m on windows, I use the cmd.exe and navigate to where I saved the files.  I then use the command sapcar -xvf *.SAR.  The only catch is that once you start the extract, make sure and move SAPCAR.EXE to a different directory.  It gets extracted out the files you are extracting and will dump when it encounters the same file.  You can also extract to a different directory, which probably the better approach.

Next, save a copy of your current kernel, just in case.  For me, the path is:  c:\usr\sap\<SID>\SYS\exe\us\NTAMD64\.   I’ll just grab all of these files and save them somewhere else.  If things go horribly wrong, I’ll just wipe out the changes and paste these files back in.

So obviously, I copy the extracted files to the kernel location.  Be sure to leave all of the existing files in the directory.  Depending on the Kernel, not everything gets updated.

Now test.  I usually restart my system, just to be safe and then fire up SAP. in general, it’s that’s easy…  Hopefully this gets my EHP4 system working so I can take advantage of the new testing and debugging tools not available in kernel 7.00.  Unfortunately, for me, my Kernel doesn’t seem to be the issue.  So back to the drawing board.  It might mean a new install 🙁

Thanks,

Mike

WMIGO – My latest application

A few days ago, I mentioned how I started my integration between Service Management and Warehouse Management.  This started small by cloning the old school transactions MB1A, MB1B & MB1C.  I quickly found why everyone said it was a bad idea.  So I spent the last week designing my own solution.  It’s kind of a cross between the new SAP Enjoy transaction MIGO & and the original MB1A, B and C.

Now the solution is nearly complete (in fact, I hope to be doing my documentation and youtube video of it by next week).  In the meantime, I wanted to touch on what I learned while doing this.  First, trying to replicate an old or even a new SAP transaction can be quite time consuming.  While my functionality to create the Transfer Order from the material movement was quite simple, learning how SAP designed the transaction can be quite involved.  On the plus side, I learned quite a bit about material movements.  For those of you that care, the tables T156, T157 & T158 all help the material movements.  The transaction OMJJ has pretty much everything you need to configure anything in the material movement world.  I had to learn this because since there are hundreds of options for doing a material movement, in my limited experience I’ve probably only done about 15 or 20 of them total.  So I had to learn what values are needed for each of these.  In addition, there are always fields that appear or disappear depending on the movement type.  Table MIGO_CUST_FIELDS became invaluable because it shows what fields should appear by movement type.  It allowed me to keep my transaction very generic (only doing specific logic for a couple of movement types).  I also found there are movement types that can do almost anything, yet I don’t think they are often used.  So like any good application, I’m choosing to ignore those movements and add it to the documentation.  If a customer requests it, I’ll add it later =)

I just need to add the serialization piece and I’m ready to have another application out there.

Thanks for reading

Mike

Learning a New Skill – ABAP Web Dynpro

Just in case I didn’t have enough on my plate, I’ve decided to expand my skill set.  I want to start designing mobile applications for smartphones and tablets.  So the logical first step is get myself up to speed with the latest and greatest in SAP web design.  That’s ABAP web dynpro.  I didn’t just have this idea, in fact I had it almost a year ago, but I got side tracked, distracted, and just generally forgot about it.  Now with the advent of Javellin Solutions, I need to up my game.  Because of that, I just finished (well at least mostly finished) the ABAP Web Dynpro book from SAP.  Overall, it’s pretty good.  I would recommend it.  But I would also encourage you to have an end goal in mind.  At least for me, whenever reading a book like this, I need to try to apply it to whatever I’m going to do with it.  For me, it’s Broadsword & Rapier.  I want to convert both of those Web Dynpro.  Of course, the end result is to get me designing actual apps for the tablets.  My first big product in that space will be the field service apps.  I haven’t even started it (and I don’t have the first clue about applications design for smartphones or tablets) but I have a good plan.  First, apply this new skill to my existing applications while I learn to use it effectively, and deliver an even better product to my customers.  I’ll be posting more about this in the future…  but for today, I just wanted to encourage you to have a plan and always learn a new skill.  You never know when you might need it.

Thanks for reading

Backing Up Data – Learning the Hardway

Well, with any operation, making sure your data is properly backed is pretty important.  Since I love to learn things the hard way, I originally gave no thought at all this.  So in my last post I explained about some of the pain it took to install a simple SAP system.  Well, now envision that I spent the next 6 months beginning my development of my great idea (it would be Rapier, eventually).  One day, I was in between projects, so I was sitting in the living room, catching up on episodes of Lost, coding my BSP masterpiece.  I can’t really remember exactly how it happened, but my portable HDD suddenly started making a clicking sound, my system locked up, and suddenly, all of my work was gone.  The last 6 months of installing SAP, and design of my product gone.  I didn’t have another HDD, I didn’t have backups.  In my naive mind, I didn’t think a HDD would fail (keep in mind, I used to build computers for myself in college, so I should know better).  So…  I went back to square one (happily, I did take some notes on the installation, so instead of months, it took me 2 weeks.)  I redesigned a better BSP app, and learned a lot along the way.  That’s how i learned the first time.

Now…  how did I remedy my mistakes?  I implemented a couple of things.  First, I got myself a great big HDD and kept copies of my SAP systems and various other virtual systems, so I could quickly rebuild if I needed to (I still have those systems to this day, just in case).  The other thing I started to do was to save my SAP transports.  For those of you unfamiliar, as long as your STMS configuration is set up (and this can be a pain), every time you release a transport SAP saves 2 files.  The Data & Cofile can then be backed up somewhere else (I use dropbox so I can quickly get to them, and it keeps them in the cloud).  Then at anypoint, I can upload those transports into a clean system, giving me periodic code and configuration backups.  It doesn’t help if I have to recreate master data, but I have a different method to help me with that.

As a side note, I recently had another HDD fail.  This one less costly, but still painful because I realized I wasn’t backup up often enough, and I wasn’t saving the right things.  So what did I do?  I got myself another HDD, and I now backup my progress weekly (I also do this for all my files and pictures etc too).  In addition, I think I might also get Carbonite to give me everything at a remote location.  I need to figure out how I can have all of my SAP systems on Carbonite.  When I figure it out, I’ll let you know…

In the meantime, learn from me, not with me…  back your stuff up

Mike