Ja, warum bin ich nich selbst drauf gekommenblack_adept hat geschrieben: 2.) Zum Aufbau einer Equihierarchie nehm ich immer den FB "EQUI_HIERARCHY_READ" - der liefert mir alles was ich brauche.
Code: Alles auswählen.
FUNCTION z_get_equipment_structure.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(DATE) LIKE EQUZ-DATBI DEFAULT SY-DATUM
*" VALUE(EQUNR) LIKE EQUI-EQUNR
*" EXPORTING
*" VALUE(EQTXT) LIKE ITOB-SHTXT
*" TABLES
*" ZITEMS STRUCTURE ZITEMS
*"----------------------------------------------------------------------
DATA: itab_equi LIKE rihequi OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'EQUI_HIERARCHY_READ'
EXPORTING
equipment = equnr
level_down = '99'
* IMPORTING
* EQUI_COUNT =
TABLES
hier_tab = itab_equi
.
COMMIT WORK AND WAIT.
LOOP AT itab_equi.
zitems-idnrk = itab_equi-equnr.
zitems-ojtxp = itab_equi-eqktx.
zitems-zparent = itab_equi-hequi.
APPEND zitems.
ENDLOOP.
ENDFUNCTION.