BOM alv report / change number solution

In this document ; Bill of material list report developed with alv concept to run all of materials which are listed by users. The most important trick is a solution of dublicate records in BOM tables so change number records.

For example : In belowed printscreen that you can see STPO table.

If you read STPO table without a restriction , you will get 2 rows for PY200005 Bom item material.

If you do not benefit change number functionality , you can join tables like belowed and it can be used to list BOMs.

But , change number functionality cause additional records in STPO and other related PP tables.

To solve this problem , you can benefit belowed alv report.

This report provides last record of changing component with change number.

IF sy-subrc =0.MOVE: wa_mast-matnr TO gw_final-matnr, wa_mast-stlnr TO gw_final-stlnr, wa_mast-werks TO gw_final-werks, wa_mast-stlal TO gw_final-stlal, wa_mast-stlan TO gw_final-stlan, wa_mast-matkl TO gw_final-matkl, wa_mast-maktx TO gw_final-maktx2, wa_stpo-matkl TO gw_final-matkl2, wa_stpo-idnrk TO gw_final-idnrk, wa_stpo-menge TO gw_final-menge, wa_stpo-aennr TO gw_final-aennr, wa_stpo-andat TO gw_final-andat, wa_stpo-annam TO gw_final-annam, wa_stpo-aenam TO gw_final-aenam, wa_stpo-posnr TO gw_final-posnr, wa_stpo-meins TO gw_final-meins, wa_stpo-maktx TO gw_final-maktx, wa_stpo-datuv TO gw_final-datuv, wa_stpo-stlkn TO gw_final-stlkn, wa_stpo-vgknt TO gw_final-vgknt, wa_stpo-stvkn TO gw_final-stvkn2, wa_stpo-stpoz TO gw_final-stpoz, wa_stpo-vgpzl TO gw_final-vgpzl.