cancel
Showing results for 
Search instead for 
Did you mean: 

Automatically set a default value to a characteristic if it is empty

nunzio_cassano
Explorer
0 Kudos

Hello everyone,

can you tell me the rules necessary to automatically set a defualt value on a characteristic if it is left blank?

I tried to use procedures on the same characteristic and procedures on the value of the characteristic that I want to set as the automatic default value without success. I'm probably doing something wrong.

Thanks and best regards.

Accepted Solutions (1)

Accepted Solutions (1)

Ritz
Active Contributor

nunzio.cassano,

it was necessary to manage this value through dedicated procedures inserted on the class of the characteristic itself.

This is what i written in my very first reply. 🙂

Option 1: You can set default on characteristic it self, in CT04 just go to tab for values and put a tick mark for default. Now this value is defaulted every where this characteristic will be used.
Option 2: $SET_DEFAULT ($SELF, <characteristic>, <string>) using this dependency to choose and set value. Refer below link for more details
https://help.sap.com/viewer/501c6c6a471b4d42b5dae2b0f4dbc9cf/6.00.31/en-US/2663b6531de6b64ce10000000...
This default will be available always, you have option to replace it by another value. Once user specified a vale that value will replace the default.

Thanks

RD

nunzio_cassano
Explorer

Dear Ritesh Dube,

Thanks! I solved the issue.

Nunzio

Answers (8)

Answers (8)

Ritz
Active Contributor

nunzio.cassano,

I assigned the procedure to the characteristic S24800_0050. This characteristic allows the following values: S (description SI) and N (description NO)

Thats why its not bringing result.

Please delete it from there and assign to configuration profile (CU42). It will work.

As i mention earlier if you want this default set at every place where ever this characteristic is used, you dont need dependency just use below tick mark and it will do the work.

If your default is getting changes or you want it just for few materials, use the dependency.

$SET_DEFAULT ($SELF, <characteristic>, <string>)

Hope it will work for you now.

Thanks

RD

nunzio_cassano
Explorer
0 Kudos

Dear Ritesh Dube,

my characteristic is referred to functional location and i don't see functional location configuration profile in CU42.
Also entering the default value flag on S does not report on the functional locations when I access edit (IL02 transaction).

Default value in characteristic:

Empty value

Thanks,

Nunzio

Ritz
Active Contributor

nunzio.cassano,

It's easy not sure what exact issue you encountered.

Option 1: You can set default on characteristic it self, in CT04 just go to tab for values and put a tick mark for default. Now this value is defaulted every where this characteristic will be used.

Option 2: $SET_DEFAULT ($SELF, <characteristic>, <string>) using this dependency to choose and set value. Refer below link for more details

https://help.sap.com/viewer/501c6c6a471b4d42b5dae2b0f4dbc9cf/6.00.31/en-US/2663b6531de6b64ce10000000...

This default will be available always, you have option to replace it by another value. Once user specified a vale that value will replace the default.

Thanks

RD

nunzio_cassano
Explorer
0 Kudos

Hello Ritesh Dube,

I had tried to use the dependency indicated $SET_DEFAULT: this is the code

$set_default($self,S24800_0050,'S')

However after creating the dependency and attributed to the characteristics (S24800_0050) of interest going to edit of the object of my interest the feature is still empty even after saving: is there any error?

Thanks
Ritz
Active Contributor
0 Kudos

nunzio.cassano,

As you got the answer to your issue , you can close the thread by selecting one of the the reply which help you.

Thanks

RD

Ritz
Active Contributor
0 Kudos

nunzio.cassano,

it was necessary to manage this value through dedicated procedures inserted on the class of the characteristic itself.

If its working for you by setting procedure so you got the answer to your original question. Please close the thread and up vote the replies if it helped you.

Also i see your added a reply and marked it "accepted", i guess its not the way you appreciate others help and time. 🙂

Thanks

RD

Ritz
Active Contributor
0 Kudos

nunzio.cassano,,

This week end i got tp chance to run a test for setting default for functional location and it works exactly as i mention previously. I setup a value in characteristic (CT04) using a tick mark for default.

after this when i created a functional location using (IL01) and added class in classification view it bring the default value setup previously.

Its also showing how the value is delivered.

Hope it this time it will clear your doubt and help you.

Please close the thread if you got the answer you are looking for.

Thanks

Ritesh

nunzio_cassano
Explorer
0 Kudos

Dear Ritesh,

thank you for your feedback and dedication.

Unfortunately in our systems, the management of the default value does not work with the use of the 'default value' flag in the characteristic's master data. In fact, as I mentioned earlier, it was necessary to manage this value through dedicated procedures inserted on the class of the characteristic itself.

Thanks and best regards,

Nunzio

88olga88
Discoverer
0 Kudos

Hi, Ritesh Dube

I did as you described 1st way, but the value does not appear. img-20231114-183038-076.jpg

And 2nd way I'm trying to set Default Values characteristic with Procedures, so I enter source code:

$SET_DEFAULT ($SELF, ZTZ_CATEG_SUBSTITUTION, 'SUBSTITUTION1')

It doesn't pass the syntax check, errors occur

E28063 - Reference to object $ROOT, $PARENT or $SELF required;

E28051 - Reference to characteristic required;

E28037 - Logical expression required.

Thanks in advance for your time and responses.

nunzio_cassano
Explorer
0 Kudos

Hi,

I solved the problem this way:

1. Setting the default value flag to the value of the characteristic;

2. Creating the procedure $SET_DEFAULT ($SELF, <characteristic>, <string>);

3. Assigning the procedure to the class containing the desired characteristic.

Thanks.

former_member27
Community Manager
Community Manager
0 Kudos

Hi,

Please mark one of the answers you got as best answers as an appreciation of their effort to help you.

Regards,

Dedi

Ritz
Active Contributor
0 Kudos

nunzio.cassano,

I do not have any experience dealing with functional location , why dont you try to create a new object and see if it works , s now you have setup default at Characterstic value level , i guess it should be defaulted to object this characterstic will be call.

Thanks

RD

Ritz
Active Contributor
0 Kudos

nunzio.cassano,

Where did you assign that dependency , characteristic , class or configuration profile?

I believe your characteristic S24800_0050 allowed character's and S is acceptable value for it. Please check that.

Please dependency to configuration profile level (CU42).

Thanks

RD

nunzio_cassano
Explorer
0 Kudos

Dear Ritesh Dube,

I assigned the procedure to the characteristic S24800_0050. This characteristic allows the following values: S (description SI) and N (description NO).

Thanks.

Nunzio