Pass SalesHeader parameter to MyProcedure.
procedure MyProcedure(SalesHeader: Record "Sales Header") responsetext: text
make it global by removing local infront of the procudure
you dont need lines 31 to 42 in the MyProcedure
You can use SalesHeader parameter that is passed to function in your code.
call the procedure from your page action
Storetext := FlowTest.MyProcedure(Rec);
Storetext is text variable to store the responsetext