Sawsan311, the confusion stems from your indirect and unclear question. As I understand it, you're effectively asking: when is it practical to fabricate according to pipe code (e.g. ASME B31.3) rather than vessel code (e.g. ASME Sec VIII). Is that a correct understanding?
In most cases, this question is only relevant for the design of small containers/vessels - those which can easily and inexpensively be built from readily available pipe and piping components (off-the-shelf schedule pipe and pipe caps). If standard readily available piping components are not suitable, because of the vessel's size or pressure rating, then these incentives (practicality and cost) don't exist.
In some cases, the vessel's service is an additional factor in choosing ASME B31.3 rather than ASME Sec VIII. For example, pump seal pots are generally designed and built according to B31.3 (rather than Sec VIII) in order to avoid the Sec VIII requirement for pressure protection, which is an unnecessary expense of time and money for a seal pot application.
Obviously, it doesn't make sense to consider designing a vessel according to pipe code if the vessel can't be assembled from standard readily-available pipe components.