The first thing you have to know about the product group is that a not existing product group occures in an error if transfer such a material.
If you like to exclude a material from transfer you have to assign a product group which is not assigned to any organizational unit.
For adapting the assignment of a product group, there is a BAdI /AEB/TA_PROD_GRP_01. The BAdI has one method chg_product_group_for_material.
The following code example shows how to set the product group in case of the material has a deletion indicator.
METHOD /aeb/if_ex_ta_prod_grp_01~chg_product_group_for_material. IF im_mara-LVORM = 'X' * NOT_TO_TRANSFER has to be defined as product group ch_product_group = 'NOT_TO_TRANSFER'. ENDIF. ENDMETHOD.
You see that we only change it in this case, if the material has the deletion indicator. All other situations will be covered by configuration.
If you like to have context data for example of the material (MARA, MARC..) or if you like to have the relevant org. units use the parameter "IM_MATERIAL_CONTEXT". This parameter has some methods for example get_mara with which you can the actual content of the table mara (include the content which is not yet persistent).
Updated 10 months ago