on 12-26-2014 9:15 AM
Dear All,
I need to have check in maintenance order based on system status. If status equal 'iwa05' then order must be non editiable in tcode w32. Badi iwo1_screen_modify does not work correctly. How I can to open order in iw32 like in iw33?
Thanks in advance.
Hello Pavel Lazhbanov,
You can use the following code in the user-exit IWO10009 (include ZXWOCU07). What it does is: When you are in IW32 and trying to Save an Order with RIPR status (IWA05), it simply does not allow you to Save. It throws the following error. It is as good as IW33.
Error pop-up
The code
DATA : I_STAT LIKE JSTAT OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'STATUS_READ'
EXPORTING
OBJNR = CAUFVD_IMP-OBJNR
ONLY_ACTIVE = 'X'
TABLES
STATUS = I_STAT.
IF SY-TCODE = 'IW32'.
LOOP AT I_STAT.
IF I_STAT-STAT = 'IWA05'.
MESSAGE: 'You can not make changes in Order with ''RIPR'' status'
TYPE 'E' DISPLAY LIKE 'I'.
ENDIF.
ENDLOOP.
ENDIF.
Hope this suits to you.
KJogeswaraRao
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This message was moderated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
A have implemented enhancement in functiom group COIH :
enhancement 122 zpm_mvob_stat. "active version
data: ls_jest type jest,
lt_status type standard table of jstat.
field-symbols : <wa_status> like line of lt_status,
<fs_tc10> type any.
if caufvd-auart = 'INSP' and sy-tcode = 'IW32'.
call function 'STATUS_READ'
exporting
* CLIENT = SY-MANDT
objnr = caufvd-objnr
only_active = 'X'
* IMPORTING
* OBTYP =
* STSMA =
* STONR =
tables
status = lt_status
exceptions
object_not_found = 1
others = 2
.
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
loop at lt_status assigning <wa_status> where stat = 'IWA05'.
assign 'TC10' to <fs_tc10>.
check sy-subrc = 0.
tc10-trtyp = 'A'. " replace 'V' by 'A'
message s122(zpm).
endloop.
endif.
endenhancement.
*$*$-End: (1 )--------------------------------------------------------------------------------$*$*
endform. " ABLAUF
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Pavel,
Thank you for sharing your Solution. I tried this and working OK. There is an observation: If you have an Integrated Notification for this Order type, then the Notification fields in Order can not be greyed out with this method. Above mentioned user-exit could be made use in such case. Just a view.
Regards
KJogeswaraRao
Pavel Lazhbanov,
Replace the above code as given under. Above code might give problem at the Save event when RIPR attains for the fisrt time. Code below takes care of that.
DATA:I_STAT LIKE JSTAT OCCURS 0 WITH HEADER LINE,
L_OBJNR TYPE J_OBJNR.
SELECT SINGLE OBJNR FROM AUFK INTO L_OBJNR
WHERE AUFNR = CAUFVD_IMP-AUFNR.
CALL FUNCTION 'STATUS_READ'
EXPORTING
OBJNR = L_OBJNR
ONLY_ACTIVE = 'X'
TABLES
STATUS = I_STAT.
IF SY-TCODE = 'IW32'.
LOOP AT I_STAT.
IF I_STAT-STAT = 'IWA05'.
MESSAGE: 'You can not make changes in Order with ''RIPR'' status'
TYPE 'E' DISPLAY LIKE 'I'.
ENDIF.
ENDLOOP.
ENDIF.
KJogeswaraRao
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
7 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.