VC

Home / SAP / Archive by category "VC" (Page 4)

Variant Configuration – PFunction vs Function

Today post again is largely due to my good friend Jeremy Meier.  I’ve heard about pfunctions for a long time.  But I never understood the different between functions and PFunctions.  So today, to solidify it in my own mind I’m going to talk about PFunction vs Function and why you would use one versus the other.

So, in my previous life, I used functions heavily, and they worked great.  For example, I had functions that would take a string of digits and convert it into specific characteristic values.  The company I worked for used “intelligent” catalog numbers for everything.  This is actually was a great way to implement variant configuration for the customer service group.  They typed in a string of digits, and the configurator figured out exactly what to populate, leaving only a handful of other values for the CSR to populate.  Now this is great.  The function needed to have an input (the catalog number) and bunch of outputs (each cstic that would be populated).  Now this is fine, until the first time you have to make an addition, say you add a new special option that drives a new characteristic.  Well, now you need to update the CU66 function interface, and also the SE37 ABAP function to bring in the new value and output the proper value.  It’s not the end of the world, but it can be a hassle.

Now, what I just finally figured out (yes, I know I can be slow) is that if you simply change the procedure to PFUNCTION vs Function, then you don’t really need any inputs.  the PFUNCTION statement populates the GLOBALS structure which contains the instance of the $SELF, $PARENT and $ROOT.  So now, you know the current level, the level directly above and the topmost level.  Using that instance number, you can plug into any number of CUPR functions that exist in standard SAP.  (CUPR_SET_VAL, CUPR_GET_VAL, etc.)  These functions allow you to extract the configuration using the instance #, and you don’t have to explicitly define every cstic you want to extract.

So, the real difference is PFUNCTION will send the instance automatically.  You can even have a PFUNCTION that has no parameters and you will have the full range of input and output, and you can set anything, including values at the parent level based on something in the lower level.  It really is pretty slick.  So, pfunction vs function, really is a big difference and clearly something I wish I understood a lot sooner in my career.  But like everything, live and learn and keep learning .

Thanks for reading, and thanks again Jer,

Variant Configuration – IPC Trace Functionality – COM_CFG_SUPPORT

My next couple of post will talk about how you can use the IPC Trace functionality.  There are several different ways you that you can trace the dependencies and constraints within the IPC, and today I’ll talk about the first one, COM_CFG_SUPPORT.

Tracing with the transaction COM_CFG_SUPPORT is always available and requires the least effort in the sense of installing any kind of component. However it has the drawbacks of an ugly configuration ui and have to do all steps manually.

The first step to Tracing a configuration session is to figure out what the kbid for the knowledgebase is which you want to test. In order to do so, go to table: COMM_CFGKB in SE16/SE16N.  Pick the most recent KBID that fits your KB and RTV you are tracing.  Next go to COM_CFG_SUPPORT.

blog01-01

Select “Engine Trace” and click on “Start Tool”.

blog01-02

Select the engine module you are interested in and click on activate trace. For a brief list of what these engine modules mean, please have a look at Table 1 “traceable engine modules”.

Then go to tab “Create Config”:

blog01-03

Enter the kbid (which we got from comm_scecfg) and the product id.

Click on Create Config.

This will bring up the initial trace:

blog01-04

You’ll see some of the initial trace lines before anything happens.

1  DDB  201  DDB initialized for knowledge base “X” (version 0001)
2 DDB  219  Instance : “$1(product: XXX)” Created as Root
3  DDB 204 Fact : “sf($1, Cstic_1, INV_P, true)”: Inserted by “Classification”
4  DDB 204 Fact : “sf($1, Cstic_1, NOINP_P, true)”: Inserted by “Classification”

etc…  You’ll quickly start to recognize little things like INV_P is invisible, NOINP is no input, if it’s set by classification or  inferred by the system.

Now let’s set a characteristic value and this will actually show how painful the process is. Go to tab “Configure”.

We need to specify language independent names for the characteristic as well as for the value. The instance ID will be 1 (root instance).  Cstic name will be language independent name, and value is the language independent value.  Pretty straight forward.

Click on OK to set this value and see the trace underneath updating:

Now, you’ll see the new trace lines underneath, so you can see exactly what behavior occurs when you change or set a particular value.

Now, one of the big things to remember is that this won’t help you see what happens during the initialization phase in the sales order.  You’ll still have to simulate that yourself, which could be difficult.

Thanks for reading,

 

 

Variant Configuration – IPC Class Items

In my latest project, I’m getting back into the IPC, and finding all things that don’t quite work the way I expect.  ha ha.  Today’s lesson for me has to to do with IPC Class items.  More specifically, using a class type item on your BOM in conjunction with a multiple value characteristic.

So, let me set the stage of what’s happening within my models.  We have two multiple value characteristics that get set with a bunch of keys.  Then we have multiple class type 200’s that use the same two characteristics to uniquely determine a material.  Pretty straightforward, and works great in ERP.  The problem comes when we moved to IPC.  As soon as we started configuring some test orders, we found that most of our class type 200’s were not resolving, more to the point, they weren’t getting the value.

SAP has OSS Note: 1564395 – Class node specialization with multi-valued characteristics.

The basics of the note state:  values of a multi-valued characteristic will be considered for class node specialization in IPC as follows:

Let {v1, .., vN} be the values assigned to the multi-valued characteristic at runtime and let D be the local domain of classification values maintained for a certain material M in the class node, then this material is considered as a possible (consistent) specialization iff all values v1,…, vN are contained in the set D.

Well, this doesn’t work for our purposes.  The multiple value characteristic contain values for many different materials, M, so specialization won’t occur.

In our case, we’re going to go down the path of a P-Function to handle passing the values explicitly to the class type 200’s.  Otherwise, we were looking at revamping our constraints in a significant way to attempt to pass the values directly to each class type 200.  And this is an option I haven’t even tested, so there’s no guarantee it would even work.  If anyone else has encountered something close to this, I’d love to hear your solution.

As always, thanks for reading,

Variant Configuration – IPC – Hidden Characteristics

Seems I’m on a roll with the IPC stuff, so here’s another interesting thing I just learned.  It seems that SAP has changed the way that the IPC will handle hidden characteristics.  Originally, you had the option to make a selection within the configurator to show the hidden characteristics to not show them, much like CU50 can do with the hidden characteristic button.  Well, the IPC has changed it’s logic, and now within the XCM, you only get the option of always showing the hidden characteristics, or never showing the hidden characteristics.

Well, I gotta say, it always confuses me when functionality is taken away within a program.  I can only hope that this buys back a lot of performance or make the maintenance easier for the engine, because from a user perspective, this really kind of sucks.  Alright, this is just another short one for today.  Thanks for reading,

Variant Configuration – IPC Reference Characteristic MARA-MATNR

I just learned something new today with the latest and “greatest” version of the IPC.  In our models we were using a reference characteristic MARA-MATNR to find the material number and help us determine what transaction we are currently executing within.  The idea behind this was that we could drive different behavior if the model was being executed inside of a Sales order or CU50 (MARA-MATNR wouldn’t  be specified) and in the material master (MARA-MATNR would  be specified).

Well, it turns out the IPC outsmarted me.  It is over ambitious and goes and find a value for MARA-MATNR within the sales order (and probably CU50 as well).  So now, that reference characteristic is never blank within the IPC.

There was an easy fix, we now need to include a statement to check if the material number (MATNR) is equal to the KMAT name.  Not the end of the world, but it’s a rather funny little trick to be aware of.  I’m waiting to see if it “helps” me with any other reference characteristics too.

Anyway, something to be aware.  Thanks for reading,

Variant Configuration – IPC in ERP – CFG_ERP_REQUEST_DB

Well, this being my first time back in the IPC in a while, I’m learning some new tricks.  This particular project I’m working on is setting up to use the IPC within ERP exclusively (no CRM or third party).  So this is uncharted territory, and from what I’ve been digging around online, not many places are doing this…  at least not that they are posting about.  So, like always, as I start new adventures, why not keep y’all in the loop 🙂

The first thing I learned is that whenever you need to generate a new KB or a new runtime version, you also need to run the program CFG_ERP_REQUEST_DB.  My understanding is that this takes the place of the upload to CRM, so the ERP side can see the latest changes.

This is a short one, but it’s something I needed in my digital notebook anyway 🙂

Thanks for reading,

Variant Configuration – Multiple Classification of the Same Material

In my current project, I’ve become reacquainted with the trials and tribulations of material classification.  Now in the past, I’ve found ways around the situation to simplify my life.  But I’ve found there are always new headaches to contend with.  My latest adventure has to do with multiple classification of the same material.  Now at first glance, sounds pretty standard.  Now my dilemma comes from the fact that the initial design called for different classes, with the same characteristics in the same class type.  Now here’s a couple of lesson’s learned that might help you decide the best course of action if you use BOM classification (that’s the idea for this approach).

1.  Remember, you can only assign one value to a characteristic within a material/class type combination.  This requires a lot of forethought in the event of the same material have multiple classes that share characteristics.
a.  My particular scenario had issues with this because we had multiple modelers.  We were each working on different products.  I was using some automation to load the CL24N, and didn’t even notice that there was overlap in the materials.  This instantly caused issues in some of the other product lines.  b.  Make sure you really need to use the same characteristic.  This was the big thing we found upon closer inspection.  The use of a common characteristic was more for convenience than for specific needs.

2.  Performance can become an issue.  Remember, if you haven’t noticed already the tables AUSP, KSSK and INOB can quickly become large and unwieldy.  This causes major performance issues.  So you may need to index these tables in order to improve performance.

3.  Remember, if you classify too many materials with the same class, your performance can also become impacted.  However, if you keep the number manageable, it works just as well (sometimes better) than standard selection conditions.

There are some of the things I’ve encountered.  In general, I’m a big fan of classification (also called class type 200), as long as you think through your approach carefully.  I just had to spend a few days reworking a bunch of models in order to improve our overall design.  I hope my mistakes can help you be successful.

Thanks for reading,

Variant Configuration – Commenting Dependency Code

Well, for any of you that have been modeling for a while, I’m sure you’ve encountered a constraint that seems like it should be working, but you keep getting a syntax error.  I run into this often enough that I came up with my own method of dealing with it, commenting dependency code.  I comment out almost everything, and see if one of the statements work.  At least this narrows down my issue 🙂

Well, another really nice thing i found when using the PMEVC to edit my dependencies is that I can work with the code in the same way you can within an ABAP program.  So no more selecting one line at a time, or adding cryptic codes in the line numbers to add or delete a line.  You can simply highlight everything you want (like you were in a word document).

My favorite new trick in ABAP or VC dependencies is quickly commenting or un-commenting out a big chunk of code.

The hot key:  <ctrl> < will add a comment.  <ctrl> > will remove the comment.  This is really useful when you have a long dependency.  Now I know you hard core CU02 programmers will remind me that you can do this in the old school editor.  But for my money, the PMEVC really made this cleaner and more user friendly than the original.  Believe me, I held out a long time before I became a convert to the PMEVC, but it really has become my go to place for VC.
Anyway, there’s your trick of the day,  Thanks for reading.

Variant Configuration – Block QtRq in the requirements

You know, I get this question about every 3 to 6 months, so it seems like  a good thing to blog about…  So here’s the deal.  Like everything in life, it’s a trade off.  When you DON’T check the Block QtRq you want the material blocked to ensure the most accurate availability of items.  When I say that, it means that the material will get locked instantly, so if inventory is going to be consumed, no one else can consume at the same time.  Now the drawback of this is that everyone else will get an error if they attempt to configure the item.  If you check Block QtRq, you open up the item so multiple people can be configuring the item at the same time, but you run the risk of inaccurate availability dates.

image001

If you look at the configuration screen it seems like such a simple little check box.  But there is always to much confusion that goes along with it.  Just to be thorough, here’s what SAP says about this field:

image002
Both of these methods work and are acceptable.  What you need to determine is the business risk of “possible” availability snafus.  By that I mean, you could try to configure 2 similar items at the same time.  Both will see available stock and capacity, but for example, let’s say one major component has 1 item left in stock, and it is 2 weeks before more stock arrives.  If you don’t lock the material, then you could run into the case where both configurations attempt to consume the part, and both will give you a promise date of Friday.  When in reality, one could be done on Friday, the other will take 3 weeks.  Now you may have to go back to your customer and explain that you can’t deliver on Friday.  In some industries, this is no big deal because they have additional lead times built in or 98% of the time have plenty of inventory to turn these types of items around, in other industries, if the inventory situation isn’t strong enough, or the lead times aren’t adequate this could lead to unhappy customers.
Everyone asks, what should I set the Block QtRq to?  I always have to apologize and explain I can’t answer the question because it all depends on your customers and your business processes.  There is risk in unlocking the material, but only your business organization can determine if the risk is worth the reward.

Hope this makes senses and thanks for reading,

Variant Configuration – Stock Transfer Order

Recently, a friend of mine came to me with a question about using a configurable material on a stock transfer order.  Now I’ve never actually tried to do this, so I had to do a little research of my own.  In my experience, the only way to accomplish this was always using a material variant.  I was going through my head, thinking of my past projects and trying to remember if I’ve encountered this before.  The closest I came to is very first job.  But there EVERYTHING was a material variant.  So that didn’t help me =)

However, when I’ve played with this at previous projects, the result always ended up the same.  Anytime you attempt to “stock” a configurable item there are always issues.  The concept of an STO is similar to a purchase order between 2 plants, only you get to skip the sales order.  The problem occurs because there is no linkage between a purchase order and supplying plant (MRP) even though you use special procurement keys.  So even though you might generate demand, you’ll have issues pulling the BOM and Routing because the configuration doesn’t get passed.

So, in general, the only way to accomplish the “stock transfer order” concept using a configurable material is to either 1.  use a material variant 2.  Create a purchase order for the configurable item in the “requesting” plant and a sales order for the same configuration in the manufacturing plant.  Neither of these options are ideal due to the amount of data that must be created on both plants.

I guess that’s the price of VC.  If anyone has a better approach, I’d love to hear it.  This certainly doesn’t seem like the best option.
Thanks for reading,