You need to remove most if not all of the constants in a getpivotdata statement, if you want to copy/paste the formula to other cells.
Typically, I would change yours to read
=GETPIVOTDATA("Material",$B$2,$B$3,B4) - 6
The first parameter is the fieldname of the total column whose value you are returning, the 2nd is a constant that identifies the pivottable to use, 3rd and 4th are the attributes you are filtering on.
You can use INDIRECT($F$1) in place of $B$2 to have an additional criteria to choose from among several pivottables, instead of hardcoding to just one. The cell F1 must evaluate to an address that falls within a pivottable or an error results.
If you substitute a formula for the first parameter, the formula must evaluate to the name of a column in the data area (check the Wizard,Layout to see what columns can be used).