abap

Home / Posts tagged "abap"

SAP Basis – Generating a System Key from Solution Manager

Hey Everybody, I’m trying my hardest to simply change the instance number on my ERP 6.0 system (I’ll talk more about that in another post), but one of the things I tried was doing a system copy (unfortunately that also is causing me headaches), but it reminded me of another little tip.  How do you get the system key from solution manager.  Obviously, step one is to have solution manager, or access to someone else that does (a solution manager system key doesn’t need to be connected to your system.  You can call up any Basis friend, give them a little info and get a key that will work).

Now, on with the show:

After executing T-code SMSY in Solution Manager system, you need to do the following steps:

Create a system by right clicking on System entry and select Create new system.
Enter the System Name i.e., SID (3 chars)
Product = SAP ECC (select from the list)
Product Version= ECC 5.0 (select from the list)
Save the entries.
Select Menu Item “System—>Other Configuration” and enter the SID which you have created earlier.
Enter the Server Name(hostname)
Finally click on Generate “Installation/Upgrade Key Button ”

The system generates a system Key ,copy that system Key and paste it in the SAPINST screen when it prompts for Sol man Key.

That’s it.  Pretty easy, but still required…

Have a great new years eve, and remember as the new budget cycle opens up, if you need help with anything, or have use for one of our SAP Easy Button’s please let us know.

Thanks,

MIke

ABAP – Create an ABAP Custom Header Automatically for all your Programs

I found this cool post that showed me a way to have my own ABAP custom header default into every new program I created.  I thought I’d share it with you all (and add it to my note book :> ).

It’s really pretty easy.  Simply go to table: TSE05 (use SE16N, since no table maintenance has been defined).

If you want to update a program, use the following:
APP_OBJ = ADDM
KEYWORD = REPORT

Next up, just make the changes as you’d like.  Feel free to add additional lines, move around what’s there, etc.  Now you don’t even need to paste your header into every program, just set up your boilerplate once, then you only need to populate in the information.  Just like that you have your own ABAP custom header that will populate every time you create a new program.

Happy Hacking,

Mike

Variant Configuration – Using a Parameter ID in a Dependency

Another fun tidbit I learned from my friends at Elogic.  Have you ever needed the model to change based on who is running it???  I know it sounds unusual, but I ran into this scenario.  We had a group that was constantly updating the bill of materials, however the business had begun a round of testing.  They needed to have the BOM locked down, but we didn’t want to have the modeler’s doing weird things just to test the new things they created.  For this, we used a Parameter ID in a dependency to handle this issue.

So, we created a copy of the BOM that was consistent.  This would provide the business with a bill of materials that wasn’t constantly adding new materials that would change the MRP results, or costing amounts, or introduce new errors.  Then, in our test environment, we added both BOM’s and used a parameter ID to determine who would see each bill of material.

Now for the new part, using a PFUNCTION, we called an ABAP function that would check for a specified user parameter.

* Read the user setting for this parameter
CALL FUNCTION ‘G_GET_USER_PARAMETER’
EXPORTING
parameter_id    = l_parid
IMPORTING
parameter_value = l_parva
rc              = l_rc.

l_parid is the paremeter ID to look for, and l_parva is the value returned from that parameter.  Using this function, you can define the cstics you want to use.  then you can assign this PFUNCTION exactly like any selection condition.

While I admit, it won’t be common, you never can tell when this could come in handy.  If you need more code around the PFUNCTION, just ask, but it’s pretty easy stuff.

Happy configuring…
As always, if there is anything we can help you with, please press the contact us button above, and let us know what we can do for you.

Mike

ABAP – Screen Elements Naming Convention

It’s been a while since I put a post out about code, and since I’ve been spending a lot of time creating screens lately, I thought I’d drop a quick tidbit out there for any of you programmers out there.  Lately, I’ve been creating screens to work as a configuration screen for one of our applications.  What this means is that there are lots of screen elements, radial buttons, etc in order to make it look good.  I have a table behind the scenes to hold all the information, but like normal screen design, you don’t make a table that goes 1 to 1 with the screen, it’s too inefficient.

Why do you care about any of this? Well, by following a standard naming convention, you can make life really easy on yourself.  Let me give you an example.  I have a screen with about 100 radial buttons (30 rows, some with 2 options, some with 3, some with 4).  Well, by following a naming convention with a standard prefix, putting the field name in the same spot, and adding the occasional suffix, you can dynamically read the field name and make it work for everything you put on the screen without having to read every line.

In your PBO, you can do something like this:
LOOP AT SCREEN.
CLEAR: FIELD, VIS, I, Z_CONFIG_WA.
if screen-input = 0.
continue.
endif.
CASE SCREEN-NAME+0(3).
WHEN ‘CH_’.
FIELD = SCREEN-NAME+3(4).
READ TABLE Z_CONFIG INTO Z_CONFIG_WA WITH KEY FIELD = FIELD GRPNAM = GRP.
IF SY-SUBRC <> 0.
READ TABLE Z_CONFIG INTO Z_CONFIG_WA WITH KEY FIELD = FIELD.
ENDIF.
IF Z_CONFIG_WA-FIELD IS NOT INITIAL.
ASSIGN (SCREEN-NAME) TO <FIELD>.
CASE Z_CONFIG_WA-VISIBLE.
WHEN ‘3’.
<FIELD> = ‘X’.
WHEN ‘4’.
<FIELD> = ”.
ENDCASE.
ENDIF.

ENDCASE.
ENDLOOP.

Now, some of the key things to notice, one is that the loop continues if you can’t input anything.  this is purely to speed things up.  Next, by using the position, you can check for the prefix.  In this example, it’s CH_

Next, it finds the key field name to plug into the configuration table.  Next up, it checks to make sure that the table entry exists in the custom configuration table.  As long as it finds an entry, we use a field symbol to assign the value to the screen field.

The awesome part of this is that as long as you maintain a consistent naming scheme, you can set the values for multiple screens and reuse the code.

anyway, I hope this is useful for you.

If there’s anything we can do to help you out, please use the Contact Us Button above and let us know what we can do for you .

Thanks for reading,

Mike

Big Development Projects – Don’t Get Discouraged

I’ve been working on the latest piece of software for JaveLLin Solutions, and recently hit that frustrated/burned out point on it.  This piece is called Proximity, and the basics have already been designed for the transactions.  However, we are doing a major overhaul, adding some additional functionality and adding a configuration screen to give the user flexibility.  Now, I’ve been working on the redesign for the past few weeks.  Yesterday, I thought I had it wrapped up except for minor tweaks.  I handed it off to my partner (he’s done the specifications for this one), and he came back with a rather extensive list of things to add/update.  While is great, we are getting a better product, more robust solution, and just an overall system that should be easy to sell…  so how could this possibly be a problem???

The problem comes in purely from the amount of time I’ve spent, and of course, the disappoint of not being complete with something I thought was finally completed.  So, how do you avoid this letdown?  Let’s start with a few simple things you can do to get refreshed…

1.  Take some time away from this project.  While normally I recommend single tasking everything, sometimes when you’ve been working on the same initiative for weeks, you need to recharge the batteries.  Take me for example.  After I got the news, I almost picked up the keyboard again and angrily started hacking out the updates.  While this could work, my head isn’t in the game.  This would lead to not doing my best work.  So I’m taking the day off and doing some marketing stuff.  In fact, that’s why I’m blogging right now 🙂

2.  Try not to get too invested in your work.  For me, this is nearly impossible, but I’m trying really hard.  After spending weeks doing some great work and fun new enhancements, so suddenly get broadsided with a big new list of things to work on, can hit you personally.  Go back to number point 1…  and then review the changes.  Remember that this isn’t personal, it’s all about making the best product possible.

3.  Review the changes and determine what needs to happen right now, compared to what can wait.  Often things are nice to have, compared to required.  it’s important as a small shop to properly prioritize what needs to happen.  This means looking at what is currently being used by a customer (something you’ve already sold), what has “legitimate” leads for purchase (actual customer interest in the product, have looked at the product so far and decided they will purchase given some additional cleanup/functionality), then what is just something you “believe” customers will want.  Now I am very guilty of doing everything in that third bucket.  While this belief that customers will want it is important to brainstorm new ideas, the important thing is what customers REALLY want.  Of course, this becomes more challenging if you don’t have any actual customers yet.  Regardless, prioritize…  development time is a vital resource, be sure to use it wisely…

4.  Finally, find a way to re-energize yourself about the project.  Get excited about you’ve done, and how these little tweaks will make it even better.  Convince yourself, in any way that it takes, that this is the best use of your time =)

5.  Make the changes, and finish the project =)

I’m certainly open to additional methods you have any.  I’d love to hear from you.

Mike

Service Management – Bringing in a General Task List

One of the really nice features in service orders is the ability to default in a General Task List (routing).

If you are familiar with transaction OISD, you already know that you can assign a general task list by plant/service material.  However, one of the things I often run into with clients is that the task lists aren’t specific to a service material (DIEN), rather they are specific to a material or group of materials. For that reason, SAP is so kind to provide a user exit:

IWO10020 (I believe)

this exit lets you impose your own logic on the general task list selected for the service order.  In our case, we a looked at the material in the task list header.  If the servicable materials = material in the header of the task list, bingo, add it to the service order.

You may have other rules that are more generic, product hierarchy, material group, or whatever you use to make a general group.  This way you have the ability to create the task list one time, and have it automatically pulled into every service order that matches your criteria.  This will help your planning and save your service technicians the time of entering in this data every time.

Hope you found this useful,

As always, if you’d like more help in SM, please contact us.  We will be happy to do anything we can for you.

Mike

IWO10020

Variant Configuration Availability Checking – What you might not realize

I’ve been doing Variant Configuration for the majority of my “professional” career.  I learned something in a recent project that I somehow missed up until now.  Sales Order Availability checking for Make-To-Order items has some major limitations.  Let me start by explaining the setup and what we ran into in a recent client of mine when we attempted to use Variant Configuration Availability Checking.

We were creating a reasonably complex VC model and placing it into the sale order.  We were generating an Assemble-To-Order production order directly from the sales order (skipped the planned order step).  Now to further complicate things, we were also using collective orders inside of the VC bill of material structure.  None of these things by them self were that far out there, but it was the first time I’d ever done all of them together.

SAP provides a program, SDV03V10 as an availability checking program.  I found this through some OSS notes and eventually started playing with it.  The functionality worked alright, so we went live with it.  What we quickly discovered after go-live is that orders just weren’t being pulled into early dates.  It quickly became apparent that the MTO availability program ran one line item at a time.  During unit testing, not problem, but suddenly there were many VC line items on the same sales order (or possibly even standard items).  Well, the availability programs don’t exactly play well with eachother.  Below are the conditions we discovered.

  • The standard V_v2 will not pick up any MTO items.  It automatically excludes them from the program selection.  So now this program will only work on standard items.
  • The SDV03V10 program  only executes one sales order line item.
  • Sales order are often complete delivery

This “perfect storm” cause nothing to be rescheduled automatically.  If you are not picking up the pattern, don’t feel bad, it took 3 of us to finally pull this all together.  So, here’s an example:

Sales order 1 has the following items: The original promise dates are shown first.
10           STD1      qty: 1                     Date: 12/12/2012
20           MTO1    qty:1                      Date:12/12/2012

The sales order is complete delivery.
Now there are some inventory changes that make the availability of item 10 to be 11/15/2012 and item 20: 11/20/2012.
if you run V_V2, it will run against the order, but because it is complete delivery and there is an MTO item, it can’t reschedule it earlier than 12/12/2012.  Now if you run the SDV03V10 (or any variation of this), the exact same thing will happen.  This will leave you in a loop where nothing reschedules unless you go into the order and run a ATP check of all items.

After finding this, I decided that JaveLLin Solutions, LLC should design a new program that will mimic the complete ATP check.  If you think this is something you could use, please contact me.

Thanks for reading,

Mike

Web Dynpro Browsers – Not everything is available

One of the biggest frustrations I’m encountering with Web Dynpro (and especially BSP’s) is that they don’t work on web browsers.  So far, I’ve been able to get my simple applications working just fine on Internet Explorer (version 9), but nothing works on Firefox (version 15), I can’t get anything to work on Safari (5.1.7), and only my BSP has been able to run on Google Chrome.  So today I wanted to discuss some of my finding when it comes to Web Dynpro browsers and what is supported.  There are numerous OSS Notes that I’m still sorting through, including:

0999995
1000000
1098009
1296463
1296464
1634749
In addition:  service.sap.com/PAM talks about the availability matrix.  If you navigate to the netweaver, and punch in your specific version (7.01, etc), you’ll see the web browsers that are supported.

I’m still sorting through all these notes, but to provide an application that can be given to your customer is increasingly difficult.  How do I tell a customer, please use my web application, but you can only use internet explorer.  In addition, there are a number of people (myself included) that upgrade to the latest browser when it comes up.  So this means, there will always be a percentage of time that someone won’t be able to access my application.  I welcome any experiences that people have had with this.  Maybe I just don’t have the right support parks.  For example, I’m using ERP 6.0 EHP4, on Netweaver 7.01.  So far, this states that I can use Internet explorer (up to version 9), and Firefox (up to version 10).  Now, if I was using Netweaver 7.3, EHP1, I’d have access to safari & chrome.  Again, this is subject to being on the latest netweaver support pack.  Short story, I’m a little concerned  with selling a Web Dynpro application, because I’m afraid I’ll spend all of my time troubleshooting what releases are supported for the given clients.

Just to throw it out there…  BSP’s are even worse.  Since SAP has stopped supporting the technology.  My Rapier application works fine in internet explorer and Google chrome, but apparently the functionality is too complicated and Firefox & Safari do not support it.  My problem is that I don’t even know what functionality isn’t supported.  I do a lot of dynamic things in my BSP, so it’s a lot areas to focus on.  The question for me becomes, do I focus on correcting the old technology, or just convert it to web dynpro (easier said than done… but that’s another story).

Oh well, gotta do it, but at least I’m getting a better idea of what is and what isn’t supported.

Web Dynpro – Select-Options – Putting Select Options on Multiple Tabs in the Same Window

Well, after spending some actual working on my Web Dynpro application, I’ve already come across my first little challenge.  In my selection screen, I have multiple tabs, each with a set of select-options.  So this ran into my first extension of my skills…

So, it’s not rocket science, but why not share it, just in case it might be able to help you in your endeavors.
So, for more details, check out my other posts on Web Dynpro.  They talk about using select-options, and how to setup the basics.

Building on this concept, I’m going to walk you through the process of adding multiple selection blocks.
First step, go back to the web dynpro component and add multiple component usages.
Now the biggest change is that we will use multiple views.  We will setup one view for each tab (or each selection option).  We will still do all of the same steps, however, the steps take place at a view that will dropped into the main view.
In my example, I have a view for selection screen that contains multiple tabs.  I then have a view for each of the tabs.  This allows me to use a separate component usage in each tab.  This allows me to put different fields on each one and still keep the functionality I want.
Now, the last of the work happens again at the Window.  Now, instead of just embedding the WDN_SELECTION_SCREEN, we will be embedding the single tab view into the ViewContainer, then the WDN_SELECTION_SCREEN inside of that view.

It’s actually pretty slick.  I’m enjoying the flexiblity of Web Dynpro and what it lets me do.  Now if I could just figure out how to get it working in Firefox & Safari.  I have a feeling it has to do with the version of each of those browsers being relatively new.  Either way, I’m still researching, and you can be sure when I figure it out, I’ll let you know…

of course, if you already know the answer, I don’t “need” to struggle… I’ll happily learn from your hard work.  ha ha ha.

Thanks again for reading,

Mike

Web Dynpro – Select-Options – Overview of the process

Finally, I get around to my first post about Web Dynpro.  I’m starting simple and replicating the selection screen for Broadsword, my service dashboard.  So any good selection screen usually has some select options.  So I wanted to pass along my lessons learned and a little bit of code too.  For starters, how do you create the select-options.  There isn’t an object that you can drop onto the screen for SELECT-OPTIONS.  You need to put a little more effort into adding it.

1. Create a create a component on the Used Component Tab of the Web Dynpro Component.  component use:  usage_so (for example) Component: WDR_SELECT_OPTIONS
2. Add the component to the view (properties tab).  Be sure to add both options (one with the controller, one without the controller).
3.  On the layout of the View, add a ViewContainerUIElement to the screen where you want to place it.
4.  Create a method for the View, INIT_SELECT_OPTIONS.  this method is where you will define the actual fields and layout.  We’ll discuss this in more detail tomorrow.  You can use the following methods:  add_selection_field or add_selection_fields.
5.  Update the WDDOINIT method, add the line:    wd_this->init_select_options( ).
6.  Attach the component to the ViewContainerUIelement in the window.  You will embed the WND_SELECTION_SCREEN to the ViewContainer in order to make the connection.

Alright, that’s enough for this post.  Tomorrow I’ll talk about the code for INIT_SELECT_OPTIONS.  Hope this information on SELECT-OPTIONS is useful.