MM60XF0I:
IF SY-SUBRC <> 0.
CLEAR MRP_LEV_FLG.
ENDIF.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""$"$\SE:(1) Form INIT_TRANSAKTION, End A
*$*$-Start: (1)---------------------------------------------------------------------------------$*$*
ENHANCEMENT 1 ZPIR_DEFAULT. "active version
CLEAR: AM60X-MATAW, AM60X-PGRAW, AM60X-PBDAW.
* if trtyp eq vstath and not sy-binpt is initial.
* move xflag to am60x-pbdaw.
* else.
MOVE XFLAG TO AM60X-pbdaw.
* endif.
ENDENHANCEMENT.
MM60XF0F:
*---------------------------------------------------------------------*
* Feldauswahl *
*---------------------------------------------------------------------*
FORM feldauswahl.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""$"$\SE:(1) Form FELDAUSWAHL, Start A
*$*$-Start: (1)---------------------------------------------------------------------------------$*$*
ENHANCEMENT 2 ZPIR_DEFAULT. "active version
clear:AM60X-VERAW, am60x-verak, am60x-verai.
am60x-veraw = 'X'.
ENDENHANCEMENT.
REQUIREMENTS_DIALOG:
FUNCTION REQUIREMENTS_DIALOG.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""$"$\SE:(1) Function Module REQUIREMENTS_DIALOG, Start A
*$*$-Start: (1)---------------------------------------------------------------------------------$*$*
ENHANCEMENT 1 ZPIR_WORKFLOW. "active version
DATA: L_OBJKEY TYPE SIBFBORIID.
data: wfstate type char1.
if sy-tcode = 'MD63'.
IF CM60A-PBDAW <> 'X'.
MESSAGE E031(ZWF).
ENDIF.
ENDIF.
IF SY-TCODE = 'MD62' OR SY-TCODE = 'MD61'.
IF CM60A-PBDAW <> 'X'.
MESSAGE E031(ZWF).
ENDIF.
IF CM60A-VERSB = '00'.
MESSAGE E008(ZWF).
ENDIF.
IF CM60A-VERAK = 'X' OR CM60A-VERAI = 'X'.
MESSAGE E016(ZWF).
ENDIF.
ENDIF.
*if sy-tcode = 'MD62'.
*IF CM60A-VERAK = 'X' OR CM60A-VERAI = 'X'.
* MESSAGE E016(ZWF).
*ENDIF.
*ENDIF.
L_OBJKEY+0(4) = CM60A-WERKS.
L_OBJKEY+4(2) = CM60A-VERSB.
L_OBJKEY+6(10) = CM60A-PBDNR.
CALL FUNCTION 'ZWF_GET_CURRENTSPSTEPID'
EXPORTING
WFID = 'WFSD0002'
INSTID = L_OBJKEY
IMPORTING
* NEXTSPID =
* NEXTSPTITLE =
* NEXTSPUSER =
* CURSPID =
* CURSPTITLE =
* INITSPID =
* ENDSPID =
WFSTATE = WFSTATE
* TABLES
* SPJB =
.
if ( sy-tcode = 'MD62' or sy-tcode eq 'MD61' ) AND WFSTATE = 2.
MESSAGE E007(ZWF).
ELSE.
CALL FUNCTION 'SWU_OBJECT_REFRESH'
EXPORTING
OBJTYPE = 'ZBO_PIR'.
CALL FUNCTION 'SWU_OBJECT_PUBLISH'
EXPORTING
OBJTYPE = 'ZBO_PIR'
OBJKEY = L_OBJKEY
* CREATOR = ' '
* METHOD = ' '
* MODE = 'E'
* TABLES
* CONTAINER =
* EXCEPTIONS
* OBJTYPE_NOT_FOUND = 1
* OTHERS = 2
.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
ENDIF.
ENDENHANCEMENT.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(WFID) TYPE ZWF001-WFID OPTIONAL
*" VALUE(INSTID) LIKE ZWF005-INSTID OPTIONAL
*" EXPORTING
*" VALUE(NEXTSPID) LIKE ZWF001-SPID
*" VALUE(NEXTSPTITLE) LIKE ZWF001-SPNAME
*" VALUE(NEXTSPUSER) LIKE WFSYST-AGENT
*" VALUE(CURSPID) LIKE ZWF001-SPID
*" VALUE(CURSPTITLE) LIKE ZWF001-SPNAME
*" VALUE(INITSPID) LIKE ZWF001-SPID
*" VALUE(ENDSPID) LIKE ZWF001-SPID
*" VALUE(WFSTATE) TYPE CHAR1
*" TABLES
*" SPJB STRUCTURE ZWF005 OPTIONAL
*"----------------------------------------------------------------------
data: it_wf001 type table of zwf001 with header line.
DATA: L_SPLX TYPE ZWF004-SPLX.
select single spid into initspid
from zwf001
where wfid = wfid
and spidlx = '1'.
SELECT * INTO CORRESPONDING FIELDS OF TABLE IT_wf004
FROM ZWF004
WHERE INSTID = INSTID
AND WFID = WFID.
sort it_wf004 by spcnt descending.
read table it_wf004 into it_wf004 index 1.
if sy-subrc = 0.
curspid = it_wf004-xjspid.
L_SPLX = IT_WF004-SPLX.
endif.
select * into corresponding fields of table it_wf005
from zwf005
where instid = instid
and wfid = wfid.
data: tmp_selid type zwf005-selid.
data: tmp_spid type zwf005-spid.
sort it_wf005 by spid descending.
loop at it_wf005 into it_wf005.
if tmp_spid <> space.
it_wf005-nstep = tmp_spid.
MODIFY IT_WF005 FROM IT_WF005 TRANSPORTING NSTEP.
clear tmp_spid.
endif.
if tmp_selid = it_wf005-selid or it_wf005-selid = space.
tmp_spid = it_wf005-NSTEP.
delete it_wf005.
continue.
endif.
tmp_selid = it_wf005-selid.
endloop.
READ TABLE IT_WF005 INTO IT_WF005 INDEX 1.
IF SY-SUBRC = 0.
ENDSPID = IT_WF005-SPID.
ENDIF.
READ TABLE IT_WF005 WITH KEY SPID = CURSPID.
IF SY-SUBRC = 0.
NEXTSPID = IT_WF005-NSTEP.
NEXTSPUSER+2 = IT_WF005-SELID.
NEXTSPUSER+0(2) = 'US'.
ENDIF.
SELECT SINGLE SPNAME INTO CURSPTITLE
FROM ZWF001
WHERE WFID = WFID
AND SPID = curSPID.
SELECT SINGLE SPNAME INTO NEXTSPTITLE
FROM ZWF001
WHERE WFID = WFID
AND SPID = NEXTSPID.
spjb[] = it_WF005[].
LOOP AT Spjb INTO SPJB.
SPJB-SELID+2 = SPJB-SELID.
SPJB-SELID+0(2) = 'US'.
MODIFY SPJB FROM SPJB TRANSPORTING SELID.
ENDLOOP.
SORT SPJB BY SPID.
IF L_SPLX = 'C'.
WFSTATE = '4'.
ELSEIF CURSPID = INITSPID OR CURSPID IS INITIAL.
WFSTATE = '1'.
ELSEIF CURSPID = 'APP'.
WFSTATE = '3'.
ELSE.
WFSTATE = '2'.
ENDIF.
ENDFUNCTION.