日期期间 DATA ls_date LIKE LINE OF ra_date. ls_bwart-low = '201'. ls_bwart-sign = 'I'. ls_bwart-option = 'EQ'. APPEND ls_bwart TO ra_bwart. ls_bwart-low = '202'. ls_bwart-sign = 'I'. ls_bwart-option = 'EQ'. APPEND ls_bwart TO ra_bwart. CONCATENATE p_lfgja p_lfmon '01' INTO ls_date-low."该月第一天 CALL FUNCTION 'BKK_GET_MONTH_LASTDAY' EXPORTING i_date = ls_date-low IMPORTING e_date = ls_date-high."该月最后一天 ls_date-sign = 'I'. ls_date-option = 'BT'. APPEND ls_date TO ra_date."ra_date为当月期间 SELECT SUM( a~erfmg ) AS erfmg SUM( a~dmbtr ) AS dmbtr INTO CORRESPONDING FIELDS OF wa_data FROM mseg AS a INNER JOIN mkpf AS b ON a~mblnr = b~mblnr AND a~mjahr = b~mjahr WHERE a~matnr = wa_data-matnr AND a~werks = wa_data-werks AND a~bwart IN ra_bwart AND a~sobkz IN ra_sobkz AND b~budat IN ra_date.