‎2012 Mar 14 10:26 AM
Hi,
in order to modify automatically the content of valuation class (MBEW-BKLAS) at save command of transactions MM41/42, we are using BADI_ARTICLE_REF_RT, methods REFERENZ_BEFORE-REFERENZ_AFTE.
The solution is ok but it has a problem: for a particular group of plants (MBEW-BWKEY), all the ones starting with 'IT', the BAdI is jumped and than the content of valuation class is not modified.
We cannot understand whey this happens: any idea?
Thanks in advance.
‎2012 Mar 14 10:35 AM
i understand your sceneraio but i am not able to gain what code you wrote in BADI impl, send ur code once to better understand it clearly
‎2012 Mar 14 10:48 AM
Well,
the code is the following:
SELECT SINGLE valfrom INTO l_bwkey
FROM setleaf
WHERE setname EQ 'ZPS_VALAREA'
AND valfrom EQ badi_mbew-bwkey.
IF sy-subrc IS INITIAL.
badi_mbew-bklas = 'PS01'.
ELSE.
SELECT SINGLE bklas INTO badi_mbew-bklas
FROM mbew
WHERE matnr EQ badi_mbew-matnr
AND bwkey EQ badi_mbew-bwkey
AND bwtar EQ badi_mbew-bwtar.
ENDIF.
In other words: for the plants contained in the set defined, the valuation class should be set with a costant value, for the others the valuation class should be set with the existing value (if found). Now, we have n plants, say 'XXX1', 'XXX2', ...,'IT01', 'IT02',..., 'ITNN', ...'XXXN': if I put a breakpoint in the methods, the transaction stops for every 'XXXY' plant (and the code work properly), but not for the plants starting with 'IT'. I'm wondering if, for these plants, I should use another BAdI or exit (and which one...).
‎2012 Mar 14 10:50 AM
I forgot to write that for the plants contained in the set and not starting with 'IT', and for the plants not contanined in the set and not starting with 'IT' the code, of course, works correctly.
‎2012 Mar 14 11:24 AM
Hi,
Can you check first the plants which starts are in final variale and also check if any validations are there for that plant.
Regards,
Gurunath Kumar D
‎2012 Mar 14 4:09 PM
I hope it's clear that the problem is: for certain plants ('ITXX'') the bapi appears to be skipped because, putting a break point in the method, the transaction doesn't stop at it (the contrary for the other plants).