‎2008 Apr 08 1:56 PM
HI all
I have the following problem:
Selection: Material (Component)
I can find the next BOM level with the FM "CS_WHERE_USED_MAT". But I need the TOP level.
Is there a better FM/BAPI that I can use to find the last material number (final assembly)?
Thanks
Alex
‎2008 Apr 08 4:21 PM
Hi,
I know functions that get the structure to the deepest level but on the opposite way not ... and it would interesting to learn.
I might suggest that you work with a loop in order to get the top-level in the structure:
DO WHILE SUBRC = 0.
Call function CS_WHERE_USED_MAT
exporting
MATNR = MYMATNR
importing
exceptions.
if sy-subrc = 0.
read table MATCAT where ....
move MATCAT-MATNR to MYMATNR.
else.
subrc = 4.
endif.
ENDDO.
‎2008 Apr 08 4:21 PM
Hi,
I know functions that get the structure to the deepest level but on the opposite way not ... and it would interesting to learn.
I might suggest that you work with a loop in order to get the top-level in the structure:
DO WHILE SUBRC = 0.
Call function CS_WHERE_USED_MAT
exporting
MATNR = MYMATNR
importing
exceptions.
if sy-subrc = 0.
read table MATCAT where ....
move MATCAT-MATNR to MYMATNR.
else.
subrc = 4.
endif.
ENDDO.