Technical Articles
Variant Configuration : Another way to hide characterstic
Purpose:
In this write up I am trying to define how to use structure SCREEN_DEP in reference characteristic to influence display options for other
characteristics.
Scenario:
While settings up your VC model you may come across one of below scenarios
- Hide few characteristic based upon value selected for another characteristic
- Make a characteristic not ready for input (just display)
- Make characteristic “Ready for input” which is originally created as not ready for input
- Reset previously setup value using an dependency
Solutions:
There are different approaches possible to work around this scenarios and one of the possible option is we can use structure SCREEN_DEP
to achieve same. This structure basically controlled 4 display option for characteristic INVISIBLE, INPUT, NO_INPUT, RESET
Scenario
1 : Hide few characteristic based upon value selected for another characteristic
It’s a common scenario and use reference characteristic along with object dependency (procedure ) to controlled it.
Example :
There are 2 characteristic in VC Model which are interdependent , characteristic & there possible values are like below
Characteristic |
Possible Values |
CHAR_A |
1 |
CHAR_A |
2 |
CHAR_A |
3 |
CHAR_A |
4 |
CHAR_B |
XL |
CHAR_B |
XXL |
Condition :
CHAR_B should be only available only if characteristic CHAR_A have value 2 or 3
Building Masterdata :
Create your VC model
Create a characteristic
CHAR_A , CHAR_B using transaction CT04 along with possible values as shown in above table.
Create characteristic
HIDE_CHAR using transaction CT04,
Go to additional data tab and input the structure SCREEN_DEP & field INVISIBLE, press
enter
You will get pop up confirming data type and other details will be copied to characteristic ,
Go back to basic data screen and change the description as per your need
save this new characteristic.
Create object dependency using transaction CU01
Give name of dependency,
Give description and select dependency type Procedure using radio button as shown above
Click on
Write syntax code like below
$self.HIDE_CHAR = ‘CHAR_B’ if $self.CHAR_A = ‘1’ or
$self.CHAR_A = ‘4’
Click on syntax check as highlighted above.
Click on save icon it will take you back to first screen.
Make sure you change dependency status to 1 (Release) or your dependency will not work.
Save the dependency.
You can assign this dependency in configuration profile of the model or you can assign it to characteristic CHAR_B.
Result:
Now all the settings are done and our model is ready to be test.We can either create a sales order (VA01) to test or we can use configuration simulation (CU50)
Enter material number
Push configuration button as highlighted above,
You will get pop-up to input characteristic values
If you assign value 2 or 3 to characteristic A , system will allow you to assign values to characteristic B too.
If you assign value 1 or 4 to characteristic A, Characteristic B will become invisible.
- You can add reference characteristic in same class if you want it to appear in classification screen, in one way it showscharacteristic B got invisible as picked by HIDEN reference characteristic.
- You can assign dependency to either characteristic you want to hide or to configurationprofile of the material
- Changes made with structure SCREEN_DEP only apply to variant configuration, not to classification
.
Thanks for reading it till end , I will cover related topics of how to reset, make no-input or allowed input in next document. I will try to post it soon. if you like the document please post your comments and ratings, please also suggest if you find any thing missing in flow, I try to cover all possible details.
If you have any question or facing any issue , please create a separate thread and use a link to this document if you want to give reference of any steps. It will help forum members to reply and can be useful for other members facing same issue in future.
References:
- Help.sap.com
- Screen shots are from SAP IDES system, data created by me.
Very useful document ....... Thanks for sharing.
Thanks Ajay.
Thanks a lot Dube ji, writing a nice doc on variant configuration and sharing it.
Thanks D SINGH.
Hi Ritesh
Another good one from you.
There are also ohter fields in SCREEN_DEP which can be well leveraged fo rvarious uses of VC.
Thanks for comment Navaneetha Krishnan & Rakesh M Choudhary , Ya i already mention it in document too thats work is in process and soon i will add other control through SCREEN_DEP.
Hi Ritesh,
Very good explanation. Helped a lot in further understanding of the topic. Like Navaneetha Krishnan has mentioned, if you can also elaborate on the usage of other fields in SCREEN_DEP, it would be very helpful for us.
Thanks
Rakesh
Hi Ritesh
Very nice explanation!
Thx
Br
Kevin
Thanks Kevin Yang.
Informative document.
Great document, so much information , thanks for sharing it.
Can we hide multiple characteristics using this approach in S4HANA AVC? Tried the same but only one Characteristic is hidden .
Hiding the entire characteristics or a characteristic value does not work properly in aVC. The characteristics doesn't gets hidden (as it functions in classical VC) instead becomes disables for editing.
Nice document. Thanks.
Nice explanation with screen shots. Thanks for sharing.
Hello Ditesh,
I have been looking into replacing preconditions with procedures to hide characteristics and values. I appreciate your post. I have a few questions. With preconditions there is automatic error handling when a condition is violated when hiding or presenting characteristics or values. There are a few issues I see with the method you present, let me know if you agree.
Your reply would be much appreciated.