diff --git a/pkg/control/registry.go b/pkg/control/registry.go
index e00062b..c9abdb8 100644
--- a/pkg/control/registry.go
+++ b/pkg/control/registry.go
@@ -112,8 +112,27 @@
 	r.mutex.Lock()
 	defer r.mutex.Unlock()
 
-	subs := r.findExistingSubs(trans, subReqMsg)
+	//
+	// Check validity of subscription action types
+	//
+	actionType, err := r.CheckActionTypes(subReqMsg)
+	if err != nil {
+		xapp.Logger.Debug("CREATE %s", err)
+		return nil, err
+	}
 
+	//
+	// Find possible existing Policy subscription
+	//
+	if actionType == e2ap.E2AP_ActionTypePolicy {
+		if subs, ok := r.register[subReqMsg.RequestId.Seq]; ok {
+			xapp.Logger.Debug("CREATE %s. Existing subscription for Policy found", subs.String())
+			subs.SetCachedResponse(nil, true)
+			return subs, nil
+		}
+	}
+
+	subs := r.findExistingSubs(trans, subReqMsg)
 	if subs == nil {
 		subs, err = r.allocateSubs(trans, subReqMsg)
 		if err != nil {
@@ -158,6 +177,30 @@
 	return subs, nil
 }
 
+func (r *Registry) CheckActionTypes(subReqMsg *e2ap.E2APSubscriptionRequest) (uint64, error) {
+	var reportFound bool = false
+	var policyFound bool = false
+
+	for _, acts := range subReqMsg.ActionSetups {
+		if acts.ActionType == e2ap.E2AP_ActionTypeReport {
+			reportFound = true
+		}
+		if acts.ActionType == e2ap.E2AP_ActionTypePolicy {
+			policyFound = true
+		}
+	}
+	if reportFound == true && policyFound == true {
+		return e2ap.E2AP_ActionTypeInvalid, fmt.Errorf("Report and Policy in same RICactions-ToBeSetup-List")
+	}
+	if reportFound == true {
+		return e2ap.E2AP_ActionTypeReport, nil
+	}
+	if policyFound == true {
+		return e2ap.E2AP_ActionTypePolicy, nil
+	}
+	return e2ap.E2AP_ActionTypeInvalid, fmt.Errorf("Invalid action type in RICactions-ToBeSetup-List")
+}
+
 // TODO: Works with concurrent calls, but check if can be improved
 func (r *Registry) RemoveFromSubscription(subs *Subscription, trans *TransactionXapp, waitRouteClean time.Duration) error {
 
diff --git a/pkg/control/ut_messaging_test.go b/pkg/control/ut_messaging_test.go
index 3054999..de2458a 100644
--- a/pkg/control/ut_messaging_test.go
+++ b/pkg/control/ut_messaging_test.go
@@ -20,6 +20,7 @@
 package control
 
 import (
+	"gerrit.o-ran-sc.org/r/ric-plt/e2ap/pkg/e2ap"
 	"gerrit.o-ran-sc.org/r/ric-plt/submgr/pkg/teststube2ap"
 	"testing"
 )
@@ -1163,3 +1164,151 @@
 	e2termConn.TestMsgChanEmpty(t)
 	mainCtrl.wait_registry_empty(t, 15)
 }
+
+//-----------------------------  Policy cases ---------------------------------
+//-----------------------------------------------------------------------------
+// TestSubReqPolicyAndSubDelOk
+//
+//   stub                          stub
+// +-------+     +---------+    +---------+
+// | xapp  |     | submgr  |    | e2term  |
+// +-------+     +---------+    +---------+
+//     |              |              |
+//     | SubReq       |              |
+//     |------------->|              |
+//     |              |              |
+//     |              | SubReq       |
+//     |              |------------->|
+//     |              |              |
+//     |              |      SubResp |
+//     |              |<-------------|
+//     |              |              |
+//     |      SubResp |              |
+//     |<-------------|              |
+//     |              |              |
+//     |              |              |
+//     | SubDelReq    |              |
+//     |------------->|              |
+//     |              |              |
+//     |              | SubDelReq    |
+//     |              |------------->|
+//     |              |              |
+//     |              |   SubDelResp |
+//     |              |<-------------|
+//     |              |              |
+//     |   SubDelResp |              |
+//     |<-------------|              |
+//
+//-----------------------------------------------------------------------------
+func TestSubReqPolicyAndSubDelOk(t *testing.T) {
+	CaseBegin("TestSubReqAndSubDelOk")
+
+	rparams1 := &teststube2ap.E2StubSubsReqParams{}
+	rparams1.Init()
+	rparams1.Req.ActionSetups[0].ActionType = e2ap.E2AP_ActionTypePolicy
+	cretrans := xappConn1.SendSubsReq(t, rparams1, nil)
+
+	crereq, cremsg := e2termConn.RecvSubsReq(t)
+	e2termConn.SendSubsResp(t, crereq, cremsg)
+	e2SubsId := xappConn1.RecvSubsResp(t, cretrans)
+	deltrans := xappConn1.SendSubsDelReq(t, nil, e2SubsId)
+	delreq, delmsg := e2termConn.RecvSubsDelReq(t)
+
+	waiter := rtmgrHttp.AllocNextEvent(true)
+	e2termConn.SendSubsDelResp(t, delreq, delmsg)
+	xappConn1.RecvSubsDelResp(t, deltrans)
+	waiter.WaitResult(t)
+
+	//Wait that subs is cleaned
+	mainCtrl.wait_subs_clean(t, e2SubsId, 10)
+
+	xappConn1.TestMsgChanEmpty(t)
+	xappConn2.TestMsgChanEmpty(t)
+	e2termConn.TestMsgChanEmpty(t)
+	mainCtrl.wait_registry_empty(t, 10)
+}
+
+//-----------------------------------------------------------------------------
+// TestSubReqPolicyChangeAndSubDelOk
+//
+//   stub                          stub
+// +-------+     +---------+    +---------+
+// | xapp  |     | submgr  |    | e2term  |
+// +-------+     +---------+    +---------+
+//     |              |              |
+//     | SubReq       |              |
+//     |------------->|              |
+//     |              |              |
+//     |              | SubReq       |
+//     |              |------------->|
+//     |              |              |
+//     |              |      SubResp |
+//     |              |<-------------|
+//     |              |              |
+//     |      SubResp |              |
+//     |<-------------|              |
+//     |              |              |
+//     | SubReq       |              |
+//     |------------->|              |
+//     |              |              |
+//     |              | SubReq       |
+//     |              |------------->|
+//     |              |              |
+//     |              |      SubResp |
+//     |              |<-------------|
+//     |              |              |
+//     |      SubResp |              |
+//     |<-------------|              |
+//     |              |              |
+//     | SubDelReq    |              |
+//     |------------->|              |
+//     |              |              |
+//     |              | SubDelReq    |
+//     |              |------------->|
+//     |              |              |
+//     |              |   SubDelResp |
+//     |              |<-------------|
+//     |              |              |
+//     |   SubDelResp |              |
+//     |<-------------|              |
+//
+//-----------------------------------------------------------------------------
+
+func TestSubReqPolicyChangeAndSubDelOk(t *testing.T) {
+	CaseBegin("TestSubReqAndSubDelOk")
+
+	waiter := rtmgrHttp.AllocNextEvent(true)
+	rparams1 := &teststube2ap.E2StubSubsReqParams{}
+	rparams1.Init()
+	rparams1.Req.ActionSetups[0].ActionType = e2ap.E2AP_ActionTypePolicy
+	cretrans := xappConn1.SendSubsReq(t, rparams1, nil)
+	waiter.WaitResult(t)
+
+	crereq, cremsg := e2termConn.RecvSubsReq(t)
+	e2termConn.SendSubsResp(t, crereq, cremsg)
+	e2SubsId := xappConn1.RecvSubsResp(t, cretrans)
+
+	//Policy change
+	rparams1.Req.RequestId.Seq = e2SubsId
+	rparams1.Req.ActionSetups[0].SubsequentAction.TimetoWait = e2ap.E2AP_TimeToWaitW200ms
+	xappConn1.SendSubsReq(t, rparams1, cretrans)
+
+	crereq, cremsg = e2termConn.RecvSubsReq(t)
+	e2termConn.SendSubsResp(t, crereq, cremsg)
+	e2SubsId = xappConn1.RecvSubsResp(t, cretrans)
+	deltrans := xappConn1.SendSubsDelReq(t, nil, e2SubsId)
+	delreq, delmsg := e2termConn.RecvSubsDelReq(t)
+
+	waiter = rtmgrHttp.AllocNextEvent(true)
+	e2termConn.SendSubsDelResp(t, delreq, delmsg)
+	xappConn1.RecvSubsDelResp(t, deltrans)
+	waiter.WaitResult(t)
+
+	//Wait that subs is cleaned
+	mainCtrl.wait_subs_clean(t, e2SubsId, 10)
+
+	xappConn1.TestMsgChanEmpty(t)
+	xappConn2.TestMsgChanEmpty(t)
+	e2termConn.TestMsgChanEmpty(t)
+	mainCtrl.wait_registry_empty(t, 10)
+}
