Skip to main content

SUM(CASE

  WHEN

      PU_COUNT ("EKPO","_CEL_P2P_ACTIVITIES"."ACTIVITY_EN", "_CEL_P2P_ACTIVITIES"."ACTIVITY_EN"

      IN (${VARIABLE_CHANGE_ACTIVITIES})) = 0

      AND ACTIVITY_COLUMN () NOT IN (${VARIABLE_EXCLUDED_ACTIVITIES})

    THEN 1.0

    ELSE 0.0

  END

)

HI,

by adding the ACTIVITY_COLUMN() in the SUM statement, you end up on the activity level. This means that the sum also runs over the activity table. Replace the SUM by a COUNT ( DISTINCT CASE WHEN ... THEN EKPO.MANDT||EKPO.EBELN||EKPO.EBELP ELSE NULL END) then you count the number of po items independent of the level you are on. Or rethink the ACTIVITY_COLUMN() statement and also put it in a PU function to keep it on EKPO level.

BR

Stephanie


Reply