Let $\mathcal{R}$ and $\mathcal{R}^{ \prime}$ be two unital rings such that $\mathcal{R}$ contains a non-trivial idempotent $P_1$. If $\mathcal{R}$ is a prime ring, we characterize the form of bijective map $\varphi:\mathcal{R} \rightarrow \mathcal{R}^{ \prime}$ which satisfies $\varphi (ABP)= \varphi (A)\varphi (B)\varphi (P)$, for every $A,B\in \mathcal{R}$ and $P \in \{P_1,P_2\}$, where $P_2:=I-P_1$ and $I$ is the unit member of $\mathcal{R}$. It is shown that $ \varphi$ is an isomorphism multiplied by a central element. Finally, we characterize the form of $\varphi:\mathcal{R} \rightarrow \mathcal{R}$ which satisfies $\varphi (P) \varphi (A) \varphi (P)= PAP$, for every $A\in \mathcal{R}$ and $P \in \{P_1,P_2\} $.