Part approval workflow fails after custom BAdI implementation in SE19

I implemented a custom BAdI for part classification validation using SE19 in our SAP PLM 2021 system. The BAdI implementation (ZCL_PART_CLASS_VALIDATE) is supposed to check material group assignments before allowing part creation. After activation, the standard part approval workflow completely fails with error ‘Workflow template not found’.

Here’s the BAdI filter assignment I configured:


IF_EX_PART_APPROVAL~CHECK_CLASSIFICATION
Filter: MATNR = 'FERT'
Class: ZCL_PART_CLASS_VALIDATE

The implementation status in SE19 shows as ‘Active’ and I can see it in the BAdI definition. However, when users try to create finished goods parts, the workflow doesn’t trigger at all. The workflow template linkage was working fine before the BAdI deployment. What’s causing this disconnect between the BAdI and the workflow?

This is a classic issue with BAdI implementations that interrupt the standard call stack. Your BAdI is probably throwing an exception or returning without proper completion, which terminates the entire part creation process before it reaches the workflow trigger point. Check your BAdI implementation class for any RETURN statements or exception handling that might be exiting prematurely. Also verify that your method implementation calls the super method if it’s supposed to. The workflow template linkage is fine - the problem is your BAdI is blocking execution from reaching that point.

I’ve debugged this exact scenario multiple times. The problem is a combination of BAdI filter assignment issues and workflow template linkage interruption. Let me explain the complete solution addressing all three critical areas.

First, fix your BAdI filter assignment. The filter you configured is too restrictive and doesn’t match the actual material type values passed during part creation. The correct filter assignment should be:


Filter Field: MTART (not MATNR)
Filter Value: FERT
Implementation: ZCL_PART_CLASS_VALIDATE

The MATNR field isn’t available at the BAdI execution point - you need to filter on MTART (material type) instead.

Second, verify the workflow template linkage hasn’t been overridden. Go to transaction SWDD and open your part approval workflow template. Check the triggering event definition - it should still reference ‘BO.PART.CREATED’. Then go to SE19, open your BAdI implementation, and ensure your class doesn’t have any code that suppresses the standard workflow event. Your CHECK_CLASSIFICATION method should look like this:


METHOD if_ex_part_approval~check_classification.
  " Your validation logic here
  IF classification_valid = abap_false.
    RAISE EXCEPTION TYPE zcx_part_validation.
  ENDIF.
  " Critical: Call super to continue standard processing
  super->if_ex_part_approval~check_classification( ).
ENDMETHOD.

The key is calling the super method at the end - this ensures the standard workflow trigger executes after your custom validation.

Third, check the SE19 implementation status more carefully. ‘Active’ status isn’t enough - you need to verify the implementation is actually being called. Go to SE19, select your BAdI implementation, and use ‘Test’ mode. Create a test part and watch the execution flow. You’ll likely see that the BAdI executes but then terminates without calling the super method, which breaks the workflow chain.

Additionally, verify your BAdI implementation is in the correct enhancement spot. The IF_EX_PART_APPROVAL BAdI should be in enhancement spot ‘PLM_PART_CREATION_CHECKS’. If it’s in a different spot, it won’t be called at the right time in the process flow.

After making these corrections, you need to reactivate both the BAdI implementation and the workflow template. Deactivate your BAdI in SE19, make the code changes, then reactivate. Then go to SWDD, open your workflow template, and use ‘Workflow > Activate’ even though it appears active - this refreshes the event linkage with the corrected BAdI.

The workflow should now trigger correctly after your BAdI validation completes. Test with a new part creation to confirm the entire chain works: part creation → BAdI validation → workflow trigger → approval process.

I think the issue is with how the BAdI is positioned in the call sequence. Check the BAdI definition in SE18 and look at the execution point - if it’s set to run BEFORE the standard part creation logic, it will prevent the workflow from being triggered. You need to either change the execution point to AFTER or explicitly call the workflow trigger from your BAdI implementation.