Another approach (Variant Table in Constraints) to hide characteristics values, When precondition is not reasonable.
Here I am going to discuss and show the functionality on, how to hide or restrict the characteristics value without using precondition. We will see use of precondition and in which situation precondition is not reasonable to use.
In simple word precondition is use to hide the characteristics and characteristics values, which are not allow to user in certain situation.
Note: Make ensure that the configuration of object is consistent.
Where Precondition can be assign.
- Characteristics value.
We can use precondition in overwrite features at class level too. Overwrite will restrict the result to that class only. We can say local effect to that class.
Precondition works under the restrictable features of the characteristics too, when you want to restrict the characteristics value.
Example of Precondition:
I have product called “K_MOBILE”. Which has following characteristics.
- CT_M_MEMORY_CARD – Yes , No
- CT_M_EXPANDABLE_MEMORY – 4GB, 8GB, 16GB, 32GB, 60GB, 128GB.
In above case I want to keep the condition >>> if characteristics CT_M_MEMORY_CARD option YES, then only CT_M_EXPANDABLE_MEMORY should be available in product configuration.
The first option is to use precondition to achieve the same. Write the syntax as given below screen short and assign the same.
Assign above object dependency to characteristics called – CT_M_EXPANDABLE_MEMORY
Open characteristics (I am always following assignment at class level to restrict the change impact).
Save the changes and test the result in CU50 transaction.
We can observe the result in above image.
Same for the characteristics value hide. Just difference is go to the characteristics value and select that value. Their we have down option to assign the object dependency at characteristics value.
Above approach is not reasonable when you want to hide multiple value of the characteristics. When dependent characteristics has 50 – 60 values or more.
Let me take here one similar case here.
Suppose mine is rubber manufacturing company. We are manufacturing 5 category of rubber (A, B, C, D, E). To manufacture the rubber we have some technical specification. There are almost 500 specifications are their.
When we are selecting the rubber A it will filter the other characteristics rubber specification and show only 90 relevant specification only. Same for
Rubber type B – 200 specification,
Rubber type C – 120 specification.
Rubber type D – 100 Specification,
Rubber type E – 100 Specification.
Is Above scenario resonable approach with the help of selection condition? Do you think 500 assignment of object dependency is reasonable?
I will say “NO”. Don’t try to increase the master data of dependency and it’s assignment. The very good and preferable solution is create variant table and use it in constrain and achieve the required restriction.
Lets see in SAP system with one dummy example.
I have 3 characteristics.
CT_RUBBER_TYPE = (A, B, C, D, E)
CT_RUBBER_SPEC = (A1, A2, A3……, B1, B2, B3…….., C1, C2, C3…….., D1, D2, D3………,E1, E2, E3……..)
CT_RUBBER_APL = (Domestic, Industrial)
Note: Either you can maintain characteristics value at characteristics level or at class overwrite. When too many characteristics value are their. ignore to maintain at characteristics or class overwrite level. Maintain value in tables so new master data entry for that characteristics handle at table. Not required to maintain characteristics value at too many place.
CU61 – Create table
CU60 – Maintain table
T_REST_RUBBER_SPEC = Rubber specification restriction table
Note: Its not mandatory to use key characteristics functionality.
Table value infer with the help of procedure required the key characteristics concept, where as constrain has non mandatory to use key field.
In above image CT_RUBBER_SPEC has 20 different value but while order entry if rubber type is ‘A’, I just want to allow user to choose only one value out of 6 values (A1, A2, A3, A4, A5) against to rubber type A.
We can say restrict the value by giving only relevant possible options.
Now create constrain to restrict table to infer the limited value to select.
In above image I have commented ( * ) the condition part to say do not use condition part.
Now Go to Transaction – CU50 and see the result.
This is simplest and easy way to restrict the value, when precondition is not reasonable.
I using same concept for class type 017 (Document Management). My scenario is as follows,
I have a Characteristics as BusinessUNIT values (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) and BusinessFUNTION values (SALES,MARKETING, HR, PURCHASE, LOGISTICS, IT, DEISGN)
Based on user selection of Business Unit, say 2, i want to show only SALES, MARKETING and LOGISTICS. For another value of BusinessUnit, say 1, businessfunction would be HR and DESIGN
can you help me out
Thanks in Advance
Yes this is possible.
Not to follow above concept - By using variant table. You can directly write constraint for the same.
you can create simple Constrain to achieve the same.
CT_BU = (1 to 15)
CT_BF = (SALES,MARKETING, HR, PURCHASE, LOGISTICS, IT, DEISGN)
Suppose class name - CL_BUBF
Make Cstics: CT_BF Restrictable at CT04
If Cstics is numeric, while writing syntax ignore to use inverted coma.
Following Constrain Example for you.
Contrain name - REST_BUSINESS_FUN
B IS_A (017) CL_BUBF
B.CT_BF IN ('SALES', 'MARKETING', 'LOGISTICS') IF
B.CT_BU = '2',
B.CT_BF IN ('HR', 'DESIGN') IF
B.CT_BU = '1',
Inform me if you face any problem.
I'm having the same problem at the moment. I try to restrict document classification with the mentioned suggestion above, (Class type 017) But I'm alredy struggling in creating a constraint for my characteristic...
I am getting error "E: Constraint C_1355_00_2900 is violated" and below is the code in constraint, I want to understand how the constraint in below works and what needs to maintain in variant table so that this error will go away.
TC is_a (300) T_1355_00,
SC is_a (300) S_1355_00.
SC.SC_1355_00_0000 = '005'.
(SC_1355_00_1100 = SC.SC_1355_00_1100,
SC_1355_00_6200 = SC.SC_1355_00_6200,
TC_1355_00_2900 = TC.TC_1355_00_2900).