I depends on what gun you have. Some models only have a single port at the bottom of the receiver ued for both loading new shells and ejecting spent shells. An example is the one pictured above in which case you simply run the cable in one port and out the other. You may have to push the shell elevator up out of the way, as in the case of a Reminton 870 pump. Of course you have to have the forend racked back so as to open the ejection port.
If you have one with a single port, such as an Ithaca 37, I don't believe a cable lock will work.
These are pumps. I have only shot semis a few times, but think the cable lock on most will work similar on a two port gun if you lock the bolt back.