SAP Message AZ004 - Incorrect plant number was transferred

Diagnosis
Im parameter INOUT_NEXT_WERKS, plant number &V1& was transferred as thestarting point. This plant number, however, is not contained in tableINOUT_WERKS_TAB. Normally, this inconsistency should not occur if thevalues are transferred to INOUT_NEXT_WERKS and INOUT_WERKS_TAB insubsequent calls as they were returned in previous calls of thefunction module.

Procedure
Find out how an incorrect plant number was saved in parameterINOUT_NEXT_WERKS. During the first call, the function module waspossibly called without using the initial parameter INOUT_NEXT_WERKS ina sequence of blocked calls.