Application Development and Automation 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: 
Read only

function modules concerning batch classification

rob_smeets2
Participant
0 Likes
13,309

Hi experts,

I'm looking for 2 function modules to do the following:

- search for an object with specific characteristic values of a specific class, as you can do in Txn CL30N

- (if none found) classify an object (a batch) with specific values

As far as I can tell, the BAPI_CHARACT* functions don't do these two things, or do they?

I also know of function module CLAF_OBJECTS_OF_CLASS but this function module returns all objects, and in our implementation there will soon be thousands of objects. I need to be able to specify which objects I get, using specific values.

Thanks,

Rob

1 ACCEPTED SOLUTION
Read only

dhirendra_pandit
Active Participant
0 Likes
5,948

Use the following function module

  • Create classification

call function 'CLVF_VB_INSERT_CLASSIFICATION' "IN UPDATE TASK

exporting

  • called_from_cl = c_x

  • object = wa_kssk-objek

table = c_table

date_of_change = wa_batch-datab

tables

ausptab = t_ausp

kssktab = t_kssk

i_mdcp = t_clmdcp.

Regards

D. Pandit

9 REPLIES 9
Read only

Former Member
0 Likes
5,948

Hi,

Please check if the following FMs are useful for you.

BAPI_OBJCL_GETCLASSES

BAPI_OBJCL_CREATE

BAPI_OBJCL_CHANGE

Regards,

Ankur Parab

Read only

0 Likes
5,948

Thanks, I checked them out.

BAPI_OBJCL_CREATE and ~CHANGE I can use, but I still haven't found a function module that will allow me to find all objects (batches, for instance) that have specific characteristic values of a given class.

Just like I would enter class 'COATING' type '023' in transaction CL30N, and then enter (for example) viscosity 400 and density 1000, and that would find me exactly one batch for one material.

There must be a function module that does just this, without returning all other objects with different characteristic values...

I haven't found one yet, though.

Read only

0 Likes
5,948

Hi ,

check this function module to get the batch characteristics names and values for particlar class like CL30N ..



CALL FUNCTION 'CLAF_CLASSIFICATION_OF_OBJECTS'
    EXPORTING
      classtype          = '023'
      features           = 'X'
      language           = 'E'
      object             = w_l_object        "material number with leading zeros..
      objecttable        = 'MCH1'            "MARA,MARC,MCH1 or any table relevent
    TABLES
      t_class            = t_lclass            "THis stores Batch class
      t_objectdata       = t_objectdata    "This stores batch characteristics names and values for particular class.
    EXCEPTIONS
      no_classification  = 1
      no_classtypes      = 2
      invalid_class_type = 3
      OTHERS             = 4.
  IF sy-subrc = 0.
  endif.

Regards,

Prabhudas

Read only

rob_smeets2
Participant
0 Likes
5,948

Sorry, for that function module I need to know the batch beforehand (since it's part of the object name).

Read only

0 Likes
5,948

Hello Rob,

How have you solve it?

Bere Tiffner

Read only

0 Likes
5,948

Hi,

check in the Table..

CABN,CAWN,CAWNT..



      SELECT SINGLE * FROM cabn
          WHERE atnam = wa_zcxref_classes-characteristic.               "Pass Batch characteristic name..
      IF sy-subrc  = 0.
        SELECT  * FROM cawn into table t_cawn            "All the characteristic values available for batch characteristci is stored here
                        WHERE atinn = cabn-atinn
                                   AND adzhl  = cabn-adzhl.
        IF sy-subrc = 0.
    ENDIF.

Prabhudas

Read only

dhirendra_pandit
Active Participant
0 Likes
5,949

Use the following function module

  • Create classification

call function 'CLVF_VB_INSERT_CLASSIFICATION' "IN UPDATE TASK

exporting

  • called_from_cl = c_x

  • object = wa_kssk-objek

table = c_table

date_of_change = wa_batch-datab

tables

ausptab = t_ausp

kssktab = t_kssk

i_mdcp = t_clmdcp.

Regards

D. Pandit

Read only

Former Member
0 Likes
5,948

Hello Rob,

- search for an object with specific characteristic values of a specific class, as you can do in Txn CL30N

The functions you are looking for are CLSD_CALL_SEARCH and CLSD_START_SELECTION. I guess better late than ever

Regards

Read only

Former Member
0 Likes
5,948

use the fm VB_BATCH_GET_DETAIL