Requirement: After downloading two equipment with parent and children relationship via the steps in Step by step to download equipments from ERP with hierarchy, customer needs to remove the relationship between parent equipment ( ZJERRY0903P1) from Object structure IBASE ( 112254 ).
The relationship between them are modeled and maintained via relationship type “PRDIB”. It could be removed via function module COM_IL_API_DELETE. Then a report could be developed to remove the relationship. The complete source code could be found from attachment.
When the report is executed, there is a runtime exception occurred:
The error is caused because the data type of <wa_db_h> is not compatible with the line type of internal table <il_db_h>:
Both <wa_db_h> and <il_db_h> are defined as general table type, and their dedicated data type are determined via the corresponding entries in configuration table comc_il_struc:
In this case, the data type for <wa_db_h> comes from the value of field BASE_H, in SAP standard delivery, the field for relationship type PRDIB is empty, so the fallback type ‘COMM_IL_PRDIB’ is used, which is not compatible to the line type of COMT_IL_PRDIB_H_TAB.
So the solution is to add the correct data type COMM_IL_PRDIB_H to field BASE_H:
After that the relationship could be removed successfully. The parent equipment ZJERRY0903P1 does not appear in the object structure IBASE any more.
Now it is free to be assigned to any other IBASE: