DATA: lv_cond TYPE string,
lv_ecmas TYPE char6,
lv_kola TYPE char4,
lv_matmas TYPE char6,
lv_docmas TYPE char6.
REFRESH p_idoc.
IF cb_bom EQ gc_o.
MOVE 'KOLA' TO lv_kola.
********ECMMAS,MATMAS,DOCMAS****************************************
IF cb_ecm EQ gc_x AND cb_mat NE gc_x AND cb_doc NE gc_x.
MOVE 'ECMMAS' TO lv_ecmas.
CONCATENATE 'mestyp = lv_ecmas'
'AND sndprn =' 'lv_kola' 'AND credat IN s_odays'
INTO lv_cond SEPARATED BY space.
ELSEIF cb_ecm EQ gc_x AND cb_mat EQ gc_x AND cb_doc NE gc_x.
MOVE 'ECMMAS' TO lv_ecmas.
MOVE 'MATMAS' TO lv_matmas.
CONCATENATE 'mestyp = lv_ecmas OR mestyp = lv_matmas'
'AND sndprn =' 'lv_kola' 'AND credat IN s_odays'
INTO lv_cond SEPARATED BY space.
ELSEIF cb_ecm EQ gc_x AND cb_mat EQ gc_x AND cb_doc EQ gc_x.
MOVE 'ECMMAS' TO lv_ecmas.
MOVE 'MATMAS' TO lv_matmas.
MOVE 'DOCMAS' TO lv_docmas.
CONCATENATE
'mestyp = lv_ecmas OR mestyp = lv_matmas OR mestyp = lv_docmas'
'AND sndprn =' 'lv_kola' 'AND credat IN s_odays'
INTO lv_cond SEPARATED BY space.
ELSEIF cb_ecm NE gc_x AND cb_mat EQ gc_x AND cb_doc EQ gc_x.
MOVE 'DOCMAS' TO lv_docmas.
MOVE 'MATMAS' TO lv_matmas.
CONCATENATE 'mestyp = lv_docmas OR mestyp = lv_matmas'
'AND sndprn =' 'lv_kola' 'AND credat IN s_odays'
INTO lv_cond SEPARATED BY space.
ELSEIF cb_ecm NE gc_x AND cb_mat NE gc_x AND cb_doc EQ gc_x.
MOVE 'DOCMAS' TO lv_docmas.
CONCATENATE 'mestyp = lv_docmas'
'AND sndprn =' 'lv_kola' 'AND credat IN s_odays'
INTO lv_cond SEPARATED BY space.
ELSEIF cb_ecm NE gc_x AND cb_mat EQ gc_x AND cb_doc NE gc_x.
MOVE 'MATMAS' TO lv_matmas.
CONCATENATE 'mestyp = lv_matmas'
'AND sndprn =' 'lv_kola' 'AND credat IN s_odays'
INTO lv_cond SEPARATED BY space.
ENDIF.
IF NOT lv_cond IS INITIAL.
SELECT docnum status credat cretim mestyp
mescod mesfct upddat updtim
INTO CORRESPONDING FIELDS OF TABLE p_idoc
FROM edidc
WHERE (lv_cond).
ENDIF.
********CHRMAS,CLSMAS,ECMREV****************************************
No comments:
Post a Comment