cancel
Showing results for 
Search instead for 
Did you mean: 

Restrict release of refurbishment order, if the planned cost is 60% or more than that of the cost of new equipment.

Former Member
0 Kudos
165

Hello Gurus,

                 My client requirement is Ex: if a new equipment cost is 100 rs and if my refurbishment cost of that equipment is 60 rs or more, then refurbishment order should not be saved/ released.

How can this be achieved?

Accepted Solutions (1)

Accepted Solutions (1)

jogeswararao_kavala
Active Contributor
0 Kudos

Harsh

  • Refer to my post  Release strategy for Work Orders based on Plan Cost.
  • Your requirement is similar, but your condition is 'Cost of New material'. So you do not need the Steps 1 and 2 of this document.
  • You need Steps 3 and 4
  • For Step3, put the following code in the said include and the Restriction you needed should be working.
  • Please note that I have assumed your Order type to be 'PM04' (Change it accordingly in the code, if yours is different)
  • Also note that I have taken the MvgAvgPrice of the material as Cost of new Material. This comes from VERPR field from table MBEW.
  • I tested it saw working OK throwing error pop-up given below.
  • I advise you to test thoroughly for all combinations of data in DEV server and ensure proper working of the same

IF caufvd_imp-auart = 'ZM04'.

   DATA: v_stat TYPE char1.

   SELECT SINGLE iphas FROM afih INTO v_stat WHERE aufnr = caufvd_imp-aufnr.

   IF v_stat = '0'.

     DATA:v_cost  TYPE verpr,

          v_mult  TYPE p DECIMALS 1,

          v_wrt   TYPE bp_wpl,

          v_wrt01 TYPE bp_wpl,

          v_wrt02 TYPE bp_wpl,

          v_wrt03 TYPE bp_wpl,

          v_wrt04 TYPE bp_wpl,

          v_wrt05 TYPE bp_wpl,

          v_wrt06 TYPE bp_wpl,

          v_wrt07 TYPE bp_wpl,

          v_wrt08 TYPE bp_wpl,

          v_wrt09 TYPE bp_wpl,

          v_wrt10 TYPE bp_wpl,

          v_wrt11 TYPE bp_wpl,

          v_wrt12 TYPE bp_wpl.

     SELECT SINGLE verpr FROM mbew INTO v_cost WHERE matnr = caufvd_imp-matnr.

     SELECT SINGLE wrt01 wrt02 wrt03 wrt04 wrt05 wrt06 wrt07 wrt08 wrt09 wrt10 wrt11 wrt12

     FROM pmco INTO ( v_wrt01, v_wrt02, v_wrt03, v_wrt04, v_wrt05, v_wrt06, v_wrt07,

     v_wrt08, v_wrt09, v_wrt10, v_wrt11, v_wrt12 ) WHERE  objnr = caufvd_imp-objnr AND wrttp = '01'.

     v_wrt = v_wrt01 + v_wrt02 + v_wrt03 + v_wrt04 + v_wrt05 + v_wrt06 + v_wrt07 + v_wrt08 + v_wrt09 +

     v_wrt10 + v_wrt11 + v_wrt12.

   ENDIF.

   v_mult = '0.6' .

   IF v_wrt >= v_cost * v_mult.

     MESSAGE: 'Plan costs exceed 60% of the MvgAvgPrice of new material, Order can not be released.' TYPE 'E' DISPLAY LIKE 'I'.

   ENDIF.

ENDIF.

This is the error pop-up which stops the Release under the conditions

Good luck

KJogeswaraRao

Answers (0)