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

update equipment master

Former Member
0 Likes
3,293

Hi Experts,

I have a requirement to update the equipment master data and used BAPI_EQUI_CHANGE

but most of the sites that i have searched only shows an update for maintplant and planplant.

I need to update the functional location, asset location and cost center. Please help. thanks.

In my code im having a dump error : The function module interface allows you to specify only   fields of a particular type under "EQUIPMENT".   The field "GT_EQUIPMENT" specified here is a different   The field "GT_EQUIPMENT" specified here is a different.

Here is my code:

DATA: gt_data_general TYPE BAPI_ITOB,

       gt_data_generalx TYPE BAPI_ITOBX,

       gt_specific TYPE BAPI_ITOB_EQ_ONLY,

       gt_specificx TYPE BAPI_ITOB_EQ_ONLYX,

       lv_return LIKE bapiret2,

       gt_equipment TYPE bapi_itob_parms.

       gt_equipment-equipment = p_equnr.

       gt_equipment-funcloc_int = p_tplnr.

       gt_data_general-costcenter = p_koslt.

*      gt_data_general-maintloc = p_tplnr.

       IF r_emp = 'X'.

         SELECT kostl

           INTO gt_data_generalx-maintloc

           FROM pa0001

           WHERE pernr EQ p_kunnr.

         ENDSELECT.

       ELSEIF r_third = 'X'.

          gt_data_generalx-maintloc = 'THIRDPARTY'.

       ENDIF.

       gt_data_generalx-costcenter = 'X'.

       gt_data_generalx-maintloc = 'X'.

      CALL FUNCTION 'BAPI_EQUI_CHANGE'

           EXPORTING

             equipment      = gt_equipment-equipment

             data_general   = gt_data_general

             data_generalx  = gt_data_generalx

             data_specific = gt_specific

             data_specificx = gt_specificx

           IMPORTING

             return = lv_return.

        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

         EXPORTING

           wait   = 'X'

         IMPORTING

           return = lv_return.

Hi Experts,

I have a requirement to update the equipment master data and used BAPI_EQUI_CHANGE

but most of the sites that i have searched only shows an update for maintplant and planplant.

I need to update the functional location, asset location and cost center. Please help. thanks.

In my code im having a dump error : The function module interface allows you to specify only   fields of a particular type under "EQUIPMENT".   The field "GT_EQUIPMENT" specified here is a different   The field "GT_EQUIPMENT" specified here is a different.

Here is my code:

DATA: gt_data_general TYPE BAPI_ITOB,

       gt_data_generalx TYPE BAPI_ITOBX,

       gt_specific TYPE BAPI_ITOB_EQ_ONLY,

       gt_specificx TYPE BAPI_ITOB_EQ_ONLYX,

       lv_return LIKE bapiret2,

       gt_equipment TYPE bapi_itob_parms.

       gt_equipment-equipment = p_equnr.

       gt_equipment-funcloc_int = p_tplnr.

       gt_data_general-costcenter = p_koslt.

*      gt_data_general-maintloc = p_tplnr.

       IF r_emp = 'X'.

         SELECT kostl

           INTO gt_data_generalx-maintloc

           FROM pa0001

           WHERE pernr EQ p_kunnr.

         ENDSELECT.

       ELSEIF r_third = 'X'.

          gt_data_generalx-maintloc = 'THIRDPARTY'.

       ENDIF.

       gt_data_generalx-costcenter = 'X'.

       gt_data_generalx-maintloc = 'X'.

      CALL FUNCTION 'BAPI_EQUI_CHANGE'

           EXPORTING

             equipment      = gt_equipment-equipment

             data_general   = gt_data_general

             data_generalx  = gt_data_generalx

             data_specific = gt_specific

             data_specificx = gt_specificx

           IMPORTING

             return = lv_return.

        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

         EXPORTING

           wait   = 'X'

         IMPORTING

           return = lv_return.

6 REPLIES 6
Read only

Former Member
0 Likes
2,583

hi Jepoy

Check the lenght or type of field gt_equipment-equipment same with parameter 'equipment', or Maybe you need add leading zero to this equipment.

regards

Archer

Read only

Former Member
0 Likes
2,583

Hi ,

Use the equipment number as leading with zero's using "CONVERSION_EXIT_ALPHA_INPUT" 

Replace the above selected code with below .. then check .

Note : "EQUNRDomain level  "Convers. Routine" is assigned  , check with below structure

Regard's

-SRM

Read only

0 Likes
2,583

Hi Smruti Ranjan Mohanty

Thanks for the repsponse

I've done what you said and still got the same error.

Then Ive tried to change

equipment      = p_equnr


this line work but I still have to update the funcloc_int with the given parameter.

Read only

custodio_deoliveira
Active Contributor
0 Likes
2,583

Hi Jepoy,

Other than making sure you have the leading zeroes, as already pointed out, in your code it seems you are moving maintloc to the wrong structure:

*      gt_data_general-maintloc = p_tplnr.

       IF r_emp = 'X'.

         SELECT kostl

           INTO gt_data_generalx-maintloc

           FROM pa0001

           WHERE pernr EQ p_kunnr.

         ENDSELECT.

       ELSEIF r_third = 'X'.

          gt_data_generalx-maintloc = 'THIRDPARTY'.

       ENDIF.



shouldn't it be as below?:


       IF r_emp = 'X'.

         SELECT kostl

           INTO gt_data_general-maintloc

           FROM pa0001

           WHERE pernr EQ p_kunnr.

         ENDSELECT.

       ELSEIF r_third = 'X'.

          gt_data_general-maintloc = 'THIRDPARTY'.

       ENDIF.


Also, are you sure you need to move a kostl (costcenter) to a maintenance location field? Sounds a bit weird to me, but if this is your process...


Cheers,

Custodio

Read only

0 Likes
2,583

Thanks Custodio de Oliveirafor that.

Read only

Former Member
0 Likes
2,583

I've also wanted to know what are the changes when I use this BAPI.

what table and fields will be changed? Thanks