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 Do I Know the classnum of the material for BAPI_OBJCL_CREATE

Former Member
0 Kudos

Hello,

Someone Knows How to get the classnum of the material? I don't know what value should I put for the parameter of the BAPI  BAPI_OBJCL_CREATE

 
            CALL FUNCTION 'BAPI_OBJCL_CREATE'
              EXPORTING
                OBJECTKEYNEW    = class-object
                OBJECTTABLENEW  = class-objecttable
                CLASSNUMNEW     = ????

                CLASSTYPENEW    = class-classtype
              TABLES
                RETURN          = returnmessages.

Thank you so much

11 REPLIES 11

Flavio
Active Contributor
0 Kudos

Hi Enrique,

Table KLAH, field CLINT, should be the answer.

Thank you and bye,

Flavio

Former Member
0 Kudos

Hello,

I know the matnr, only with this data, how i can get the classnum in the tabla klah

thank you so much

Flavio
Active Contributor
0 Kudos

Hi Enrique,

Then try with table KSSK, field OBJEK is the material number, and CLINT the class(es) internal number.

Hope it will solve the issue.

Thank you and bye,

Flavio

Former Member
0 Kudos

Hello Flavio,

I got the classnum, which is the field CLINT of the table KLAH.

             "Classification
            CLEAR class.
            class-object = bapi_head-material.
            class-objecttable = 'MARA'.
            class-classnum = '5034'.
            class-classtype = '001'.

            CALL FUNCTION 'BAPI_OBJCL_CREATE'
              EXPORTING
                OBJECTKEYNEW    = class-object
                OBJECTTABLENEW  = class-objecttable
                CLASSNUMNEW     = class-classnum
                CLASSTYPENEW    = class-classtype
              TABLES
                RETURN          = returnmessages.

But I got the following message, could you help me please?

Former Member
0 Kudos

this the clint value

Former Member
0 Kudos

The bapi_objcl_create functions OK at last.

The problem is that doesn't appear the view for this material, what else do I have to do?

Thanks

Former Member
0 Kudos

do you know how can I assign material to class and char values at material level use with the bapi

                CALL FUNCTION 'BAPI_OBJCL_CHANGE'
                EXPORTING
                  OBJECTKEY                = class-object
                  OBJECTTABLE              = class-objecttable
                  CLASSNUM                 = class-classnum
                  CLASSTYPE                = class-classtype
                  STATUS                   = '1'
*                 STANDARDCLASS            =
*                 CHANGENUMBER             =
                  KEYDATE                  = SY-DATUM
*                 NO_DEFAULT_VALUES        = ' '
*               IMPORTING
*                 CLASSIF_STATUS           =
                TABLES
                  ALLOCVALUESNUMNEW        =
                  ALLOCVALUESCHARNEW       =
                  ALLOCVALUESCURRNEW       =
                  RETURN                   =

thanks

Flavio
Active Contributor
0 Kudos

Hi Enrique,

I think you should try to pass the class-classnum with the leading zeroes, that is:

class-classnum = '000000000000005034'.

being type BAPI1003_KEY-CLASSNUM    C(18)

Hope it will work.

Bye,

Flavio

Former Member
0 Kudos

Hi,

My classnum is    class-classnum = 'ZPERU_TIPO_ARTÍCUL'.

Flavio
Active Contributor
0 Kudos

Hi Enrique,

Well, no, I don't think so: 'ZPERU_TIPO_ARTÍCUL' is the class name (CLASS), class internal number is 5034 (CLINT), to be rendered with leading zeroes.


Give it a try and let me know.


Thank you and bye,


Flavio

Former Member
0 Kudos

it doesnt work, only works when i write 'ZPERU_TIPO_ARTÍCUL' , it says the class doesnt exist.


do you know what bapi do i have to use to enhance the material to other societies?

Thanks