Skip to main content
Solved

Hi Everyone, I'm trying to get the number of PO line items that didn't change, this is the formula that I'm using but it is giving me a number which is greater than the total number of PO line items. Any idea how to get that.

  • April 25, 2024
  • 1 reply
  • 7 views

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

)

Best answer by stephanie.parra

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

1 reply

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