VC

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

Variant Configuration – SSC find_or_create to instantiate automatically

As you’ve probably noticed, I’ve been spending a lot of time with the SSC and trying to create my first major model.  Needless to say, I keep learning new tricks, so I don’t want to lose them.  Today I want to talk about using the find_or_create statement to perform automatic instantiation for a material or a class.

find_or_create ((300) CLASS_NAME,
with
CHAR1 = 1;
CHAR_PARENT = ?S;
CHAR2 = ’48’ )
or

find_or_create ((material)(300)(nr=material_number) )

You can see that there are 2 distinct approaches.  The first is instantiating a class, the second a material.  Let’s start with the class, just like in any constraint based syntax, the find_or_create statement requires a class type (normally, 300), followed by the class name.  Now, to keep things fun, you can add the with statement, and it will pass values automatically to the instance.  Often, you will use an ADT (abstract data type) to signify who the parent is (notice CHAR_PARENT) listed above.  You can pass as many or as few values as needed.

The second version is the easiest…  combining the (material) and (nr=material_number), and bingo… you’ve instantiated a material (with no classification).

Now, if you’re familiar with the advanced mode modeling, the find_or_create statement appears to replace the has_part statement (at least I couldn’t make that syntax work in the SCC editor).

Now, here’s a tip with some power.

Variant Configuration – SSC Restricting characteristic domain using a variant table

I know…  the title was long winded, but there are just so many variations that I needed all those key words to make sure you know what the hell I’m talking about =)  Restricting characteristic domain in the SSC is of course a great trick, and if you can use a variant table, that makes it even more powerful.  So I wanted to talk about restricting characteristic domain inside of the SSC Eclipse editor.

So, this again, all starts with a constraint net, and a constraint.  The net I’ve already talked about in my post SSC Syntax of Constraints.

So here is a sample of a constraint that restricts characteristic domain using a variant table.

constraint RSTR_STUFF_CSTR {
name “Restrict Cstic Values”
objects:
?S is_a (300)CLASS_NAME
restrictions:
table STUFF_TYPE (
DATA1_QTY = ?S.domain DATA1_QTY,
DATA2_QTY = ?S.domain DATA2_QTY
)
inferences:
?S.domain DATA1_QTY,
?S.domain DATA2_QTY
}

Now, I’m sure you’ll notice that using constraints is the same as in the original ERP modeling environment for Variant Configuration.  The big addition is in the domain statement.  Now, one of the tricks to remember is that you don’t appear to be able to use the domain and straight assignment within the same constraint (I tried, and couldn’t make it work.  so if there’s a way, let me know).  In this example, I have 2 characteristics, and I want to restrict them against each other using the table STUFF_TYPE.  everything is normal, except the domain statement.  Also, be sure to include the domain statement in the inferences as well, and you’ll be good to go.  Another thing I’ve used all the time in standard ERP, moved to the new world of the SSC.  Don’t worry…  I’m sure I’ll be covering more enhanced behavior as I figure out exactly how to use it.

Thanks for coming along on my journey,

 

Variant Configuration – SSC Type_of Statement

In my recent experiments with Eclipse and the SSC, I’ve discovered the Type_of statement.  Maybe this existed in the standard advanced modeling, but since it’s all new to me, I wanted to make sure that I capture what this means and how it can be used.

constraint RACK_MTLS {
name “Add Materials to the Rack”
objects:
?C is_a (300)CLASS_NAME
restrictions:
type_of(?C,(material)(300)(nr=material_name))
}

Now the thing with the type_of statement is that it allows you to instantiate a material.  So for example, I was playing with a configurable material, call it a rack.  Now the rack has some components that are required for part of the system, but they are contained at the rack level.  Well, the component could have multiple iterations.  So I add the type_of statement above, and now from the rack, I have the ability to instantiate material_name.  material_name can be configurable, or just a component you want to add to the system multiple times.  The next thing I plan to tackle is how to automatically add it to the configuration based on some rules.  In the meantime, type_of is another trick I’ll keep in my back pocket.

Thanks for learning with me,

 

Variant Configuration – Activating the IPC

Once again, I have to give special thanks to my good friend Jeremy.  He pointed out something in my previous post that I didn’t even realize.  It turns out that I don’t need to install anything special for activating the IPC.  Jer pointed me toward OSS Note:  854170 which points out that the IPC needs to be activated, rather than any additional installations.

The OSS Note tells you to activate the parameter in RZ10 (remember, you will need to restart your server in order to implement the change).

vmcj/enable = on

In addition, Jer also gave me this screenshot to show the installation instructions (but honestly, it’s barely needed).

I confess that I haven’t had a chance to go very far with this yet, and I have yet to find out if I can use the advanced mode functionality inside of ECC, but as soon as I get a little time, I’ll let you all know.

Thanks for reading,

Variant Configuration – PLM_PMEVC_1 the new PMEVC in EHP5

Well, for my latest engagement, one of my homework assignments was to find out if the ERP 6.0 enhancement packs did anything for SAP Variant Configuration (VC).  After digging through the documentation, I was able to find one new piece that is worthwhile, if you have EHP5 in your SAP system.  There is now a new version of the PMEVC called PLM_PMEVC_1 that includes some additional functions, including the following:

New functions with respect to Bill of Materials:
o Display of BOM header data on detail screen
o Display of BOM items on detail screen
o Assign and create global and local dependencies to BOM items in the Product Modeling Environment
o Create selection conditions for BOM items with Drag&Drop functionality for characteristic values

New functions with respect to Characteristics:
o Add new values for characteristics
o Change the descriptions and long texts for characteristics and values
o Assign document info records to characteristics and values

New functions with respect to overwritten characteristics
You can copy changes from the global characteristics to the overwritten characteristic by the function Adapt to global characteristic which you access by a right mouse click on a characteristic in the model tree.

New functions with respect to Simulation:
o Assign values to reference characteristics
When starting the simulation, you can assign values to reference characteristics according to the selected scenario. This improves the quality of simulating configuration models because reference characteristics can have the same values as in sales order or material variants.
o Assignment of a Configurator
You have a new option, IPC in Production/VC Optional in Simulation, for selecting the configurator in the basic data for the header material.
With this setting, you can use variant configuration for the simulation although you use IPC in your productive system.
In the Product Modeling Environment, under Extras -> Settings, depending on the settings on the header material you can define if you want to use IPC or VC for the simulation or if you want to select the configurator when starting the simulation.

These are some cool new additions…  so give it a shot if your system has this package (if you don’t have the txn yet, talk to your IT/Basis person and ask them to activate it for you).  Happy configuring.

 

Variant Configuration SSC Syntax of KnowledgeBase

Finally, we have enough pieces that we can start playing with Variant Configuration SSC model.  But in order to play with the model, we need to have a knowledge base, so today we will go over the SSC syntax required to create one.  If you haven’t checked out the previous posts, they will help you catch up:

Variant Configuration – SSC Stand Alone Installation
Variant Configuration SSC – tricks to installing the local database

Variant Configuration SSC – using the Modeling Environment
Variant Configuration SSC – Syntax for Classification
Variant Configuration SSC – Syntax for Materials
Variant Configuration SSC – Syntax of Contraints and Constraint Nets

First off, if you follow a standard approach, go to the knowledgebase.ssc file (or whatever you named it).  The syntax will look something like this:

knowledgeBase AM_TUTORIAL_KB {
version “01.00” logsys “PSECLNT001” status released /*validFrom 2013-05-01*/
validFrom 2013-05-01
profiles
name ‘AM_LIBRARY_PRF’ material AM_MAT_LIBRARY,
name ‘AM_BOOK_PRF’ material AM_MAT_BOOK,
name ‘AM_SHELF_PRF’ material AM_MAT_SHELF,
name ‘AM_END_SUPPORT_PRF’ material AM_MAT_END_SUPPORT,
name ‘AM_BOOKCASE_PRF’ material AM_MAT_BOOKCASE
tasks
AM_LIBRARY_TASK
}

Step one, is to create the KB.  There are all the standard pieces, and since we’re in a playground, most of these don’t mean much.  the version & logsys can be whatever you like.  set the status to be released and give it a validFrom date…  Then enter in the profiles you want to attach to this KB.  You’ll notice that I have 5 materials assigned as part of this KB.  Finally, you need to define a Task.  Which we’ll define in a second.  If you remember CU31/32/33, CU35 & CU36, this is how you do it in the SSC.

task AM_LIBRARY_TASK {
constraintNets
LIBRARY_CNET,
BOOK_CNET,
END_SUPPORT_CNET,
SHELF_CNET,
BOOKCASE_CNET
ruleNets
SHELF_RNET
}

Now in the task, we just need to list all the constraintNets & ruleNets that should be pulled into the KB.  It’s that easy.

Now, we just need to use Eclipse to Export Knowledgebase (this puts it into your db and allows you to execute it).

Now open the Knowledgebase (right click on the KB in the model view) and you can start playing.  I talked about this a few post ago.  Check out my post on using Eclipse for more details.  Thanks for reading.

 

Variant Configuration – SSC Syntax of Contraints and Constraint Nets

Alright, so if you look at my previous posts, you’ll see that we defined the initial building blocks of the SSC, we today we can start talking about some of the fun stuff.  Today I’ll tell you how to write the SSC syntax of constraint net with some constraints.  Don’t worry, soon we’ll actually have something you can play with, but like everything, gotta get the initial data in place first.  For more details on that, check out the previous posts, they will help you catch up:

Variant Configuration – SSC Stand Alone Installation
Variant Configuration SSC – tricks to installing the local database

Variant Configuration SSC – using the Modeling Environment
Variant Configuration SSC – Syntax for Classification
Variant Configuration SSC – Syntax for Materials

Constraint Nets:

constraintNet SHELF_CNET {
name “Shelf Constraints”
constraints
AM_SHELF_RESTRICT_VALS,
AM_SHELVES_HOLD_BOOKS,
AM_RESTRICT_SHELF_DIM,
AM_CHECK_SIZE,
AM_GET_LOAD
}

You’ll notice, these are very simple.  All they need is a name, a description and the list of constraints that it will include.  Please note, we’ll talk about Rules at a later date, and the syntax is similar, but the key words are different.

Now for the real fun…  Constraints.

First, here’s a nice easy one that just restricts the value set of a characteristic.

constraint AM_SHELF_RESTRICT_VALS {
name “Restrict Cstic Values”
objects:
?SH is_a (300)AM_SHELF
restrictions:
?SH.domain AM_THICKNESS in
(1.75, 2.50, 3.50)
inferences:
?SH.domain AM_THICKNESS
}

Now for me, the biggest change is the new keyword domain.  I’m still used to the old school world of VC, it used to be just enter in the cstic and tell it what values are acceptable.  In the SSC, you have to use the word domain to restrict the values (and you cstics still need to be restrictable).  Notice though that all the other pieces are the same.  Objects, restrictions & inferences (conditions are still available too).

Now, let’s step it up a level.  This next example will use some ADT’s and give you a peak at how those look.

constraint AM_SHELVES_HOLD_BOOKS {
name “Shelf Holds Books”
objects:
?SH is_a (300)AM_SHELF,
?BK is_a (300)AM_BOOK
condition:
?BK.AM_IS_HELD_BY = ?SH
restrictions:
?SH.AM_HOLDS_BOOKS = ?BK
inferences:
?SH.AM_HOLDS_BOOKS
}
In this example, we are relating the Shelf to the Book.  Notice that here we can start talking about the ?SH or ?BK as a whole, and even assign it to a characteristics.  In the VC world, you would have to assign characteristics, but now we are talking about “instances”.  In the SSC there is going to be a lot of talk about instances and instantiation.  Back to the code…  this rule says that if the book (?BK) is held by a shelf (AM_IS_HELD_BY is a characteristic with an ADT or Abstract Data Type).  Then we want to set the shelf ?SH to show that it holds the book.  The important thing to realize is that it’s not just any book, but it’s one specific book.  Using the ADT characteristics hold the instance number of a particular book.

How about one more example?

constraint AM_RESTRICT_SHELF_DIM {
name “Restrict Shelf dims by books”
objects:
?SH is_a (300)AM_SHELF
restrictions:
?SH.domain AM_DEPTH >= ?SH.AM_HOLDS_BOOKS.AM_WIDTH,
?SH.domain AM_HEIGHT >= ?SH.AM_HOLDS_BOOKS.AM_HEIGHT,
?SH.domain AM_WIDTH >= ?SH.AM_WIDTH_TOTAL
inferences:
?SH.domain AM_DEPTH,
?SH.domain AM_HEIGHT,
?SH.domain AM_WIDTH
}

This constraint restricts the shelf dimensions based on the books that have been assigned.  One other thing I didn’t mention before, AM_HOLDS_BOOKS is multiple value since a shelf can hold many books.  The restrictions in this constraint show a new syntax (at least it’s new to me in the VC world).  This is the ?SH.AM_HOLDS_BOOKS.AM_WIDTH.  What this syntax say is that the shelf (?SH) has an ADT (AM_HOLDS_BOOKS) and we are looking at the specific characteristic of the Book.  Now, since AM_HOLDS_BOOKS is multiple value, it is smart enough to look at all the books assigned to the shelf and check those values…  pretty cool, huh?

There is a lot more stuff that can go into a constraint, and I’m sure I’ll talk more about it in the future…  but this should give you a good place to start playing.  I’m still excited about this SSC stuff…  once you get past the hurdle of getting it installed, it really is pretty slick.  Thanks for reading.

 

Variant Configuration – SSC Syntax for Materials

Last time I talked about Classification in the SSC, so today I’m going to continue on the same theme and take a look at SSC syntax of material related pieces into the SSC (Solution Sales Configurator) modeling environment, also known as Eclipse 🙂  If you haven’t checked out the previous posts, they will help you catch up:

Variant Configuration – SSC Stand Alone Installation
Variant Configuration SSC – tricks to installing the local database

Variant Configuration SSC – using the Modeling Environment
Variant Configuration SSC – Syntax for Classification

Defining a material is pretty straightforward.  You don’t need to worry about plants or screen views, just a name, description and a class.

material AM_MAT_SHELF {
name “Shelf Material”
classes
AM_SHELF
}

The other piece, that you may actually determine is optional, is the bill of material.  I’ve been learning that having a BOM isn’t a requirement when you move into the advanced mode IPC or SSC.  Being a classical guy, that takes a little getting used to.  This example actually does have a simple BOM, so it’s still good to know the syntax:

bom AM_MAT_LIBRARY {
10 material AM_MAT_BOOKCASE min 1 max 999,
20 material AM_MAT_BOOK min 0 max 9999
}

Again, pretty simple.  You don’t need to worry about plants, or BOM types.  Just the material and what the BOM consists of.  You also need to define the min and max qty, rather than a set qty.  This is to set the limits of instantiation.

The other thing that is new for me is that configuration profiles are no longer needed (at least not for the front end).  All of the constraint nets and rule nets are assigned to the knowledge base (we’ll get to that in a future post).  Now also keep in mind…  many of these items I’m talking about will still be required for integration with manufacturing, but if you are talking purely about the front end (and this example is) then you don’t need to worry about these pieces.

more to come soon.  Thanks for reading.

 

Variant Configuration – SSC Syntax for Classification

Alright, now I’m starting to get the hang of this, and I have to confess, I like it.  If you’ve ever worked with me, you probably recognize that I was kinda old school when it came to the VC, and model creation.  I tended to always the old transactions rather than the cool new tools like PMEVC.  However, the SSC (Solution Sales Configurator if you forgot) has given me a cool new way to do things that really speeds things up.  Now, I’ll have to see if there’s anyway to import back into ECC easily, but for now, I’m just playing in the Eclipse tool.  Today I’m going to talk about the SSC syntax of classification.

If you haven’t checked out the previous posts, they will help you catch up:

Variant Configuration – SSC Stand Alone Installation
Variant Configuration SSC – tricks to installing the local database

Variant Configuration SSC – using the Modeling Environment

Now, here’s what I did to give myself a baseline.  I took an old presentation about advanced mode modeling from the CWG:  Advanced_Mode_Tutorial.pdf.  Hank Meeter wrote this nearly 10 years ago, but when it comes to what you can do with the SSC, it all still applies.  And since I really hadn’t done anything with advanced mode in well, I think I might have played around in a sandbox 9 years ago…  I figured I needed a refresher.  So I pulled up my own system, and I went through did all the exercises.  Now the part that sucks is that I can’t get the IPC on my systems (apparently all the money I pay SAP, and the fact that I’d use it to help them sell the stuff when I consult doesn’t warrant me getting the install files, but I”m not bitter 🙂 ).  So I could write all the rules in ECC, but I couldn’t test any of it.

Next, I did all the same exercises in Eclipse, and what’s really cool is that I could execute it there and see the instantiation, the rules firing, and even a bit of the debug functionality.  So, I’m going to break this into a few posts, and talk about the syntax in Eclipse and how to make it all work.

Now, the first thing you need is a project, so I made myself a new SSC project (see my previous posts if you need help installing).  And since this was a simple one, I got rid of a bunch of folders and just kept:
Classes
Knowledge-Bases.

I created a file under each of these.  Under Classes, I created the file Library.ssc (because the example is about a library and books and bookcases).  Then I created a file under Knowledge-Bases called…  knowledgebases.ssc (original, I know)…

so great.  I have 2 empty files…  what the heck do I do with them.  One of the nice things about the Eclipse is that it has the helper functionality built into it.  so if you press <cntrl>-<space>, you’ll get the list of options.  Still, it’s daunting, so I cheated and used some of the starter projects I got to get me started.  So that’s what I’ll do for you 🙂

Now the building blocks of everything Variant Configuration related is Classification, so it’s the obvious place to start.

Characteristics:

/* here’s a few examples that should get you started */
/*Here’s  numeric cstic with a defined value range */

characteristic AM_THICKNESS {
name “Thickness” numericLength 4 decimalPlaces 2 restrictable unit “cm”
values
0.25, 0.50, 0.75, 1.00, 1.25, 1.50, 1.75, 2.00,
2.25, 2.50, 2.75, 3.00, 3.25, 3.50, 3.75, 4.00,
4.25, 4.50, 4.75, 5.00, 5.25, 5.50, 5.75, 6.00,
6.25, 6.50, 6.75, 7.00, 7.25, 7.50, 7.75, 8.00,
8.50, 9.00, 9.50, 10.00
}
/* here’s your char based */
characteristic AM_MATERIAL {
name “Material” textLength 6 restrictable
values
“CHIP” name “Chipboard”,
“PLY”  name “Plywood”,
“WOOD” name “Solid wood”,
“STEEL” name “Steel”
}
/* a numeric interval */
characteristic AM_WEIGHT {
name “Weight” numericLength 4 restrictable unit “g”
intervals 1-9999
}
/* my first Abstract Data type */
characteristic AM_HOLDS_BOOKS {
name “Holds Books” classType AM_BOOK multiValue
}
/* an aggregating characteristic */
characteristic AM_WIDTH_TOTAL {
name “Total Width” numericLength 6 decimalPlaces 2 unit “cm”
specialFunction aggregating
}

Next up, gotta do something with those characteristics.

Classes:
class AM_SHELF {
name “Shelf”
characteristics
AM_HEIGHT required,
AM_WIDTH required,
AM_DEPTH required,
AM_THICKNESS required,
AM_MATERIAL required,
AM_WEIGHTSUPPORT required,
AM_HOLDS_BOOKS required noinput,
AM_WIDTH_TOTAL noinput,
AM_GEOMETRIC_TYPE invisible,
AM_WEIGHT_TOTAL noinput
}

One of the big things to notice is that you don’t set the characteristic attributes like invisible or required at the cstic level.  You have to define it at the class.

Gotta keep you reading…  and I like to keep some ideas of what to write about next, so I’ll start the next round like materials and bills of materials tomorrow.  Hope you find this interesting.

 

Variant Configuration – Using the SSC Modeling Environment – Eclipse

As promised, I started playing with the SSC modeling environment today.  It’s an incredible hassle to get installed, but after playing with it for an hour, I have to say I love it.  The SSC Modeling Environment, Eclipse, is very different than the standard ECC method of maintaining a model, but it is pretty slick.

If you haven’t checked out the previous posts, they will help you catch up:

Variant Configuration – SSC Stand Alone Installation
Variant Configuration SSC – tricks to installing the local database

Now, the first thing I recommend (if you can) is to get a sample project.  It really helps.  I’ll start going over some of the things I’ve learned, like syntax, but let’s not get ahead of myself.  First, how the hell do you use the tool.

Now, once you have a project created, the first question I had was “How do I play with this thing?”  That being said, it was the first thing I sought to figure out.  I apologize for everyone without a ground zero, but be patient, the next thing I’m going to do is start building a simple project, and I’ll share all that info with you so you can build your own.

So, first you need to make sure you’re looking at the model view “Perspective.  You can tell which perspective you’re at by looking in the upper right corner.  If you don’t see the SAP Model, then you need to click the little button (arrows pointing above) to select the SAP Model.

Once there, double click into the knowledge base.

now right click and select Open Knowledge Base.

Now select the lower level item, and double click.  You’ll see the simulation characteristics shown on the right.  Now you can start playing with it like a CU50 type simulation.

Finally, you may or may not want to see the invisible characteristics, so you can use the menu shown above to turn on or off the invisible characteristics or localized names.

So that’s the first round of using the SSC Modeling environment.  There will be more to come as I learn more.  Thanks for reading.