Q:

Summing the values from the 2nd table based on ID of the 1st table and inserting values in first table

How to in first table where it says UkupnaCena insert sum value of column Cena where RacunID in first table is equal to RacunID in other table. For example if RacunID is equal to 1 in first table, I want its UkupnaCena to be equal to sum of all values in column Cena where RacunID is 1.
Tables:

My procedure so far:
Create procedure sp_RacunUpdate(
    @pRacunID int,
    @pStatusRacuna nvarchar(50),
    @pDatum nvarchar(20),
    @pOpis nvarchar(200),
    @pMesto nvarchar(50),
    @pKupacID int
)
as begin
Declare @pUkupnaCena decimal(20,2)
select @pUkupnaCena=sum(Cena) from Stavka
inner join Racun
on Racun.RacunID=Stavka.RacunID
Where Racun.RacunID=Stavka.RacunID
group by Stavka.RacunID    
begin transaction
UPDATE Racun
SET StatusRacuna=@pStatusRacuna, Datum=@pDatum, Opis=@pOpis,Mesto=@pMesto,UkupnaCena=@pUkupnaCena,KupacID=@pKupacID
WHERE RacunID=@pRacunID
IF @@ERROR <> 0
BEGIN
ROLLBACK
END
ELSE
BEGIN
COMMIT
END
END
GO

A:

You can modify the  update query to something like this 
UPDATE Racun from Racun
SET UkupnaCena=(select sum(Cena) from Stavka s where s.RacunID= Racun.RacunID), Datum=@pDatum, Opis=@pOpis,Mesto=@pMesto,KupacID=@pKupacID 
WHERE RacunID=@pRacunID

