Hi Hayasaka,
For edit screen you need to pass shopId and smallShopId (I don't think mainId is correct one). Then in save you need to assign shopId and smallShopId to the editing record. I also updated filter in the listing page "
Main.Date <=Session.EndFromDate or Session.EndFromDate= NullDate()
"
I updated your .oml file, please take a look for more detail.