WeproposethevariationaldescriptionofgeneratingfunctionapproachoffirstkindforHamil-tonianODEs,andextendtheapproachtothesemi-linearwaveequations.Inthisway,wecanconstructanyfiniteorderaccuracyscheme,andshowthattheresultingnumericalschemeismultisymplectic.Atlast,wepresentsomenumericalexperimentsbyusingderivednewscheme.