2014 Mar 06 2:00 AM
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.
2014 Mar 06 2:41 AM
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
2014 Mar 06 3:36 AM
2014 Mar 06 5:16 AM
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.
2014 Mar 06 3:42 AM
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
2014 Mar 06 5:17 AM
2014 Mar 07 12:30 AM
I've also wanted to know what are the changes when I use this BAPI.
what table and fields will be changed? Thanks