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: 

BAPI to change Equipment class and characteristics for the serial number in TCode: IQ02

former_member311223
Participant
0 Kudos

Dear Experts,

I have a requirement to change the Equipment class and characteristics for the serial number in Tcode !Q02. I found a BAPI BAPI_OBJCL_CHANGE, in which the exporting parameter is :Classification Status and the Tables all the data are related to Characteristic. So will this BAPI create or change the Equipment Class(class type & class Desc.) Properties?

If not can anyone please suggest me a proper BAPI for the same.

Thank in advance.

3 REPLIES 3

raymond_giuseppi
Active Contributor

gayathri_sunil1
Explorer
0 Kudos

Hi,

I have used the BAPI BAPI_OBJCL_CHANGE, BAPI_TRANSACTION_COMMIT in sequence and got the classification updated. I have tried the following coding. Please try the same.

data : lt_val_num  type TABLE OF BAPI1003_ALLOC_VALUES_NUM,

        lt_val_char type TABLE OF BAPI1003_ALLOC_VALUES_CHAR,

        lt_val_curr type TABLE OF BAPI1003_ALLOC_VALUES_CURR,

        lt_return   type TABLE OF BAPIRET2,

        ls_val_char type          BAPIRET2.

ls_val_char-CHARACT = 'KONDM'.

ls_val_char-VALUE_CHAR = '01'.

APPEND ls_val_char to lt_val_char.

ls_val_char-CHARACT = 'EXTWG'.

ls_val_char-VALUE_CHAR = '1001 COLORS'.

APPEND ls_val_char to lt_val_char.

       

CALL FUNCTION 'BAPI_OBJCL_CHANGE'

   EXPORTING

     objectkey                 = '000000000011049924'

     objecttable               = 'EQUI'

     classnum                 'ZCOUP'

     classtype                 '002'

     STATUS                  = '1'

   TABLES

     allocvaluesnumnew        = lt_val_num

     allocvaluescharnew       = lt_val_char

     allocvaluescurrnew       = lt_val_Curr

     RETURN                   = lt_ret.

read table lt_ret to ls_ret with key type = 'E'.

if sy-subrc ne 0.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

endif.

SharathSYM
Contributor
0 Kudos

Please have a look at this:-