Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to change value of characteristic which was defind (set as default ) in ct04 throw the code?

Former Member
0 Kudos
965

How to change value of characteristic which was defind (set as default ) in ct04 throw the code?

7 REPLIES 7

DominikTylczyn
Active Contributor
0 Kudos
850

Hello shiz0frenik

You can update an existing characteristic with the BAPI_CHARACT_CHANGE function. Your questions is not very precise, so let me know if that is not what you are looking for.

Based on your comment on batch classification in MIGO, I would say that you should not change a characteristic's default value. The default value is defined on characteristic level, but in your case the value you want is dependent on material number. MIGO can be processed concurrently by several users for different materials. If you start changing the characteristic's default value from MIGO, the users will compete for that change. It is perfectly possible that one user will change the default value according to their material and that will be shown to another user. This is not the way to implement your requirement. Instead you should use Variant Configuration Object Dependencies

Also I don't think changing a characteristic default value, even locally during MIGO call with an object dependency is correct:

  • either the dependent characteristic has to have always a specific value for a given material number. Then users should not enter the value at all at it should be derived automatically with Procedures
  • or the dependent characteristic possible value change depending on a material number and users need to pick from those values. Then the possible values can be restricted with Preconditions

You can even call your own function module from within a procedure and implement any logic you need there e.g. reading a custom field from MARA.

Have a look at SAP standard characteristics for batch classification - IMG: Logistics - General -> Batch Management -> Batch Valuation -> Update Standard Characteristics (see the documentation to the node) - to learn how it is done. The standard characteristics are also described on SAP Help: Classification with Standard Characteristics

The usage of function modules in procedures is described on SAP Help: User-Defined Functions

Look at the standard procedure LOBM_UBD in CS03. The procedure calls LOBM_UBD function module:

Best regards

Dominik Tylczynski

850

in migo there is a classification button, after clicking it opens a batch-class panel. One of parametrs is value i need to change ( it defind as a default in ct04). For example: default value is 1000 and i want if matnr starts with ' K* ' put another value.
Here's the batch-class view (after click classification button in migo ). In rectangle there is a value which equals 1000 as default.

0 Kudos
850

shiz0frenik Please see my updated answer

0 Kudos
850

Can i give me guide of how to use procedure in ct04? And matnr was just an example. actually I've got a additonal field in mara( let;s call it zbesk ) . And if it equals 'E' i need to change value of characteristic. So i thing i need to do select. Can i still do it with procedure?

here's mine characteristic

0 Kudos
850

shiz0frenik I guess I was not clear enough - you are still trying to change the default value of a characteristic. In my opinion this is not the way to go. Instead you should derive the value of the ZCH_BCH_BWMOD characteristic from the material number during batch classification. That can be done with procedure type object dependency. You can even call your own function module from within a procedure and implement any logic you need there e.g. reading a custom field from MARA.

Have a look at SAP standard characteristics for batch classification - IMG: Logistics - General -> Batch Management -> Batch Valuation -> Update Standard Characteristics (see the documentation to the node) - to learn how it is done. The standard characteristics are also described on SAP Help: Classification with Standard Characteristics

0 Kudos
850

3a9e4ce873a94034b33dc62b0ce600ee, are we talking about same procedures, how can i call fm here?

0 Kudos
850

shiz0frenik Yes, we are talking about the same procedures. You are in the right spot. See my updated answer - I've put a link to SAP Help on how to develop and use custom function modules in variant configurator procedures as well as an example of SAP standard procedure that uses a function module.