This should work, but please make sure you understand what it does before dropping it into production code. You might want to surround the SaveRelationshipInfo call with a try/catch to be on the safe side. As for anything posted on these forums, we make no guarantees in terms of support, you're on your own.
' coordinates
Dim myScenarioID As Integer = brapi.Finance.Members.GetMemberId(si, DimType.Scenario.Id, "Actual")
Dim myScenarioType As ScenarioType = BRApi.Finance.Scenario.GetScenarioType(si, myScenarioID)
Dim myTimeID As Integer = BRApi.Finance.Time.GetIdFromName(si, "2020M3")
Dim myEntityID As Integer = BRApi.Finance.Members.GetMemberId(si, DimType.Entity.Id, "Frankfurt")
Dim myParentID As Integer = BRApi.Finance.Members.GetMemberId(si, DimType.Entity.Id, "Europe")
' fetch relationship.
Dim relationship As Relationship = BRApi.Finance.members.ReadRelationshipNoCache(si, _
DimType.Entity.Id, myEntityID, myParentID)
' create new properties
' this should leave other properties alone and just merge with existing values, but check; worst case, repro other props before saving
Dim newProperties As New VaryingMemberProperties( DimType.Entity.Id, myEntityID, myParentID )
newProperties.GetEntityRelationshipProperties().PercentOwnership.SetStoredValue( _
myScenarioType.Id, myTimeID, 40.0)
' we only save properties in this case
brapi.Finance.MemberAdmin.SaveRelationshipInfo(si, _
False, relationship, _
True, newProperties, _
Nothing)