****拼接查询条件********************** data lv_where type string. if PEKORG is not initial. concatenate lv_where ' AND EKORG = ''' PEKORG '''' into lv_where. endif. if PWERKS is not initial. concatenate lv_where ' AND WERKS = ''' PWERKS '''' into lv_where. endif. if PDATUV is not initial. concatenate lv_where ' AND DATUV = ''' PDATUV '''' into lv_where. endif. if PDATUB is not initial. concatenate lv_where ' AND DATUB = ''' PDATUB '''' into lv_where. endif. if PSTLAN is not initial. concatenate lv_where ' AND STLAN = ''' PSTLAN '''' into lv_where. endif. if lv_where is not initial and lv_where+0(4) = ' AND'. lv_where = lv_where+5.