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: 

problem while updating asset master using bapi

Former Member
0 Kudos

dear all

i trying to update asse master using FM  BAPI_FIXEDASSET_CHANGE,

i got an error :"W_EXTENSIONIN-VALUEPART1" and "L_BAPI_TE_ANLU" cannot be converted to each other in a Unicode system. Here, the conversion involves a conversion between a structure and a single field.'

please help.thanks for the help in advance.

this is a part of source code :

DATA L_BAPI_TE_ANLU type BAPI_TE_ANLU.

   DATA W_EXTENSIONIN TYPE BAPIPAREX.

   DATA LT_EXTENSIONIN LIKE BAPIPAREX OCCURS 0 WITH HEADER LINE.

   L_BAPI_TE_ANLU-ZCNENG = LT_ZCOJTCL-ZCNENG.

  L_BAPI_TE_ANLU-Zmein = LT_ZCOJTCL-Zmein.

    W_EXTENSIONIN-STRUCTURE = 'BAPI_TE_ANLU'.

    W_EXTENSIONIN-VALUEPART1 = L_BAPI_TE_ANLU.

APPEND W_EXTENSIONIN TO   LT_EXTENSIONIN.

`````````````````````````````

CALL FUNCTION 'BAPI_FIXEDASSET_CHANGE'

   EXPORTING

     COMPANYCODE                = '6000'

     ASSET                      = LT_ZCOJTCL-ZANLN1

    SUBNUMBER                  = '0000'

    GENERALDATA                = L_GENERALDATA

    GENERALDATAX               = L_GENERALDATAX

    TIMEDEPENDENTDATA          = L_TIMEDEPENDENTDATA

    TIMEDEPENDENTDATAX         = L_TIMEDEPENDENTDATAX

  IMPORTING

    RETURN                     = L_RETURN

  TABLES

    EXTENSIONIN                = LT_EXTENSIONIN .

1 ACCEPTED SOLUTION

former_member226225
Contributor
0 Kudos

Hi Lingbao,

From the BAPI BAPI_FIXEDASSET_CHANGE you can check the documentation

Customer Enhancements

Description

Using this parameter you can transfer user fields from the asset master record. However, it is not possible to transfer fields that are updated in user-defined tables. Only user fields that were defined using SAP enhancement AIST0002 and are automatically updated in table ANLU can be udpated in this way. This means you have to use table extension BAPI_TE_ANLU.

Enhancement AIST0002 contains function module EXIT_SAPL1022_001 as a component in which user fields can be implemented.

I hope this will be helpful.

Thanks & Regards,

Raghunadh Kodali

2 REPLIES 2

former_member226225
Contributor
0 Kudos

Hi Lingbao,

From the BAPI BAPI_FIXEDASSET_CHANGE you can check the documentation

Customer Enhancements

Description

Using this parameter you can transfer user fields from the asset master record. However, it is not possible to transfer fields that are updated in user-defined tables. Only user fields that were defined using SAP enhancement AIST0002 and are automatically updated in table ANLU can be udpated in this way. This means you have to use table extension BAPI_TE_ANLU.

Enhancement AIST0002 contains function module EXIT_SAPL1022_001 as a component in which user fields can be implemented.

I hope this will be helpful.

Thanks & Regards,

Raghunadh Kodali

0 Kudos

Thanks for your reply,Raghunadh.

This problem has been successfully  solved,finally i found it's need to add below source.

underline source is added logic.

DATA L_BAPI_TE_ANLU type BAPI_TE_ANLU.

   DATA W_EXTENSIONIN TYPE BAPIPAREX.

   DATA LT_EXTENSIONIN LIKE BAPIPAREX OCCURS 0 WITH HEADER LINE.

   L_BAPI_TE_ANLU-ZCNENG = LT_ZCOJTCL-ZCNENG.

  L_BAPI_TE_ANLU-Zmein = LT_ZCOJTCL-Zmein.

    W_EXTENSIONIN-STRUCTURE = 'BAPI_TE_ANLU'.

    W_EXTENSIONIN-VALUEPART1 = L_BAPI_TE_ANLU.

CALL METHOD CL_ABAP_CONTAINER_UTILITIES=>FILL_CONTAINER_C

      EXPORTING

        IM_VALUE               L_BAPI_TE_ANLU

      IMPORTING

        EX_CONTAINER           W_EXTENSIONIN-VALUEPART1

      EXCEPTIONS

        ILLEGAL_PARAMETER_TYPE = 1

        OTHERS                 = 2.

APPEND W_EXTENSIONIN TO   LT_EXTENSIONIN.

`````````````````````````````

CALL FUNCTION 'BAPI_FIXEDASSET_CHANGE'

   EXPORTING

     COMPANYCODE                = '6000'

     ASSET                      = LT_ZCOJTCL-ZANLN1

    SUBNUMBER                  = '0000'

    GENERALDATA                = L_GENERALDATA

    GENERALDATAX               = L_GENERALDATAX

    TIMEDEPENDENTDATA          = L_TIMEDEPENDENTDATA

    TIMEDEPENDENTDATAX         = L_TIMEDEPENDENTDATAX

  IMPORTING

    RETURN                     = L_RETURN

  TABLES

    EXTENSIONIN                = LT_EXTENSIONIN .