Upgrade the function "LOOKUP_INST" for it's search on multi level of table. Exemple :
lookup_inst("bepi000199-generic.prt",0, "SMT_THICKNESS", 4, "MATIERE_BE", "ACIER")
For the first setting search on the first level this.
if the second setting are not in the first level search it on the second level.