Hi,
Then again you will have to take a common variable,
say if V_A is initial, pass MHND-BELNR to V_VALUE1
else pass BKPF-XBLNR to V_VALUE1 where V_VALUE1 is of character field.
Similarly if V_B is initial, pass MHND-BLDAT to V_VALUE2.
else pass BSEG-ZUONR to V_VALUE2.
Then print V_VALUE1 and V_VALUE2 using '=' as mentioned above.
Always try and take a common variable, write logic into that common variable and finally print it.
Hope this helps!