Skip to Content
author's profile photo Former Member
Former Member

Function module to update the classification of each of the devices 'IQ02'

Can any one please tell me if there is any Function module or BAPI that can be used to update the device classification details. I am referring to the classification details that are updated for each of the device serial numbers using Transaction 'IQ02'

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 28, 2006 at 02:21 PM

    Use the BAPI - <b>BAPI_OBJCL_CHANGE</b>

    Pass

    object = '111139103',

    object table = 'EQUI'.

    classnum = 'ZES_PARAMETERS_SPA'.

    classtype = 'IS2'.

    Pass the value in the internal table i_numc_values, i_char_values or i_curr_values. Based on the classification in CL02.

    CALL FUNCTION 'BAPI_OBJCL_CHANGE'

    EXPORTING

    objectkey = object

    objecttable = objecttable

    classnum = classnum

    classtype = classtype

    status = '1'

    TABLES

    allocvaluesnumnew = i_numc_values

    allocvaluescharnew = i_char_values

    allocvaluescurrnew = i_curr_values

    return = return.

    IF sy-subrc <> 0.

    RAISE error_while_update.

    EXIT.

    ELSE.

    Regards,

    Prakash.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 28, 2006 at 03:56 PM

    Please see the following code

    • log initialization

    CALL FUNCTION 'BAPI_LOG_INIT'.

    • do some initializations

    CLEAR db_update.

    • create classification data

    CALL FUNCTION 'CACL_OBJECT_ALLOCATION_MAINT'

    EXPORTING

    object_type = x_auto-header-object_type

    class = x_auto-header-class

    class_type = x_auto-header-class_type

    • STATUS =

    • STANDARD_CLASS =

    • DELETE_ALLOCATION =

    • CHANGE_NO =

    • I_OBJ_NOT_CHK = ' '

    • I_DATUV =

    • I_NO_DEFAULTS = ' '

    TABLES

    object_identification = x_auto-data

    EXCEPTIONS

    error = 1

    warning = 2

    OTHERS = 3.

    IF sy-subrc NE 0.

    CALL FUNCTION 'BAPI_LOG_CLOSE'

    TABLES

    return = lt_return.

    LOOP AT lt_return INTO wa_return WHERE type = 'E'.

    mac_msg_putx co_msg_error wa_return-number

    wa_return-id

    wa_return-message_v1

    wa_return-message_v2

    wa_return-message_v3

    wa_return-message_v4

    space.

    ENDLOOP.

    RAISE input_error.

    ENDIF.

    • * transfer validation data

    CALL FUNCTION 'CACL_OBJECT_VALIDATION_MAINT'

    EXPORTING

    object_type = x_auto-header-object_type

    class = x_auto-header-class

    class_type = x_auto-header-class_type

    • CHANGE_NO =

    • I_OBJ_NOT_CHK = ' '

    • I_DATUV =

    • I_NO_DEFAULTS = ' '

    TABLES

    object_identification = x_auto-data

    validation_maint = x_auto-value

    EXCEPTIONS

    error = 1

    warning = 2

    OTHERS = 3.

    IF sy-subrc <> 0.

    CALL FUNCTION 'BAPI_LOG_CLOSE'

    TABLES

    return = lt_return.

    LOOP AT lt_return INTO wa_return WHERE type = 'E'.

    mac_msg_putx co_msg_error wa_return-number

    wa_return-id

    wa_return-message_v1

    wa_return-message_v2

    wa_return-message_v3

    wa_return-message_v4

    space.

    ENDLOOP.

    RAISE input_error.

    ENDIF.

    • * transfer to data base without commit

    CALL FUNCTION 'CACL_CLASSIFICATION_SAVE'

    EXPORTING

    i_commit = ' '

    i_no_upd_task = 'X'.

    • close internal log

    CALL FUNCTION 'BAPI_LOG_CLOSE'

    TABLES

    return = lt_return.

    • set update flag if everything went well

    db_update = 'X'.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.