An electronic device comprising: a housing with a changeable form; a flexible display viewable through at least a portion of the housing; a plurality of antenna modules positioned inside the housing, each of the plurality of antenna modules including at least one antenna array; at least one processor operatively connected to the plurality of antenna modules and configured to perform beamforming using the at least one antenna array; and a memory connected to the at least one processor , wherein the memory stores one or more instructions that, when executed, cause the at least one processor to: perform communication based on a first beam of a first beam book including information on beams associated with at least some of the plurality of antenna modules, using the plurality of antenna modules; detect a change in a form of the housing or the flexible display during communication based on the first beam book, the change in the form includes folding or unfolding; and perform communication based on a second beam of a second beam book including information on beams associated with at least some of the plurality of antenna modules and including information on beams different from the at least a portion of the first beam book, in response to the change in the form, wherein the second beam of the second beam book is mapped to the first beam. a housing with a changeable form; a flexible display viewable through at least a portion of the housing; a plurality of antenna modules positioned inside the housing, each of the plurality of antenna modules including at least one antenna array; at least one processor operatively connected to the plurality of antenna modules and configured to perform beamforming using the at least one antenna array; and a memory connected to the at least one processor , wherein the memory stores one or more instructions that, when executed, cause the at least one processor to: perform communication based on a first beam of a first beam book including information on beams associated with at least some of the plurality of antenna modules, using the plurality of antenna modules; detect a change in a form of the housing or the flexible display during communication based on the first beam book, the change in the form includes folding or unfolding; and perform communication based on a second beam of a second beam book including information on beams associated with at least some of the plurality of antenna modules and including information on beams different from the at least a portion of the first beam book, in response to the change in the form, wherein the second beam of the second beam book is mapped to the first beam. perform communication based on a first beam of a first beam book including information on beams associated with at least some of the plurality of antenna modules, using the plurality of antenna modules; detect a change in a form of the housing or the flexible display during communication based on the first beam book, the change in the form includes folding or unfolding; and perform communication based on a second beam of a second beam book including information on beams associated with at least some of the plurality of antenna modules and including information on beams different from the at least a portion of the first beam book, in response to the change in the form, wherein the second beam of the second beam book is mapped to the first beam. <EOS>