You need to declare the variable as extern -
extern domain dmpris stock.value
stock.value = dmoes001.stck * dmoes001.spri
Or, directly add the variable in Report Input Fields by selecting the report -> Specific -> Report Input Fields. Then, you don't need to declare it in your script.
Unless you try to do something beyond what you have already mastered, you will never grow!