05-26-2016 8:11 AM
hello all,
in IW31
after entering order type and equipment ,
when the end user selects enter , i want to check the equipment category
if equipment category is not equal to 'U'
i want through an error...
is there any exit available to achieve this,
thanks in advance....
05-26-2016 8:31 AM
Hi Vinay,
Can you check the exit EXIT_SAPLCOIH_020.
Variable CAUFVD_IMP-AUART holds the Order type and CAUFVD_IMP-EQUNR holds the Equipment number.
Using Equipment number(CAUFVD_IMP-EQUNR), get the Equipment category(EQUI-EQTYP) and after validatation, throw the error message.
Hope it will work.
Regards
Rajkumar Narasimman
05-26-2016 8:22 AM
05-26-2016 8:25 AM
hi pranay,
i want the check immediately after selecting the ENTER not at the time of saving..
i.e before displaying header data tab....
05-26-2016 8:30 AM
Then pls try the implicit enhancement option. Refer the link i have provided in above post.
05-26-2016 8:25 AM
Hi,
Check this enhancement - IWO10018 and its components in SMOD.
This might help you.
Regards
Ashish
05-26-2016 8:29 AM
hi ashish,
no the exit IWO10018 is not triggering after entering the enter button in IW31
05-26-2016 8:37 AM
Hi,
Is it necessary to use an EXIT.?
There is a BADI fo this INST_AUTHORITY_CHECK.
Check in SE18 under BADI Definition, it triggers when we hit ENTER button.
Regards
Ashish
05-26-2016 8:31 AM
Hi Vinay,
Can you check the exit EXIT_SAPLCOIH_020.
Variable CAUFVD_IMP-AUART holds the Order type and CAUFVD_IMP-EQUNR holds the Equipment number.
Using Equipment number(CAUFVD_IMP-EQUNR), get the Equipment category(EQUI-EQTYP) and after validatation, throw the error message.
Hope it will work.
Regards
Rajkumar Narasimman
05-26-2016 8:36 AM
hi rajkumar,
no the said exit is not triggering after selecting the ENTER button...
05-26-2016 8:45 AM
Hi Vinay,
Create the custom project in CMOD and assign the component IWO10020 in the project, then activate it.
Once custom project activated, execute IW31, place breakpoint inside EXIT_SAPLCOIH_020, then system will stop inside EXIT_SAPLCOIH_020 in debugging screen.
Regards
Rajkumar Narasimman.
05-26-2016 9:06 AM
it's great rajkumar,
its triggering now,
why its not triggering directly , is there any specific reason for this,
is this the standard procedure to check all exits like this..
please can you clarify on this....
05-26-2016 9:13 AM
It is fundamental requirement for any user-exit to work. It needs to be assigned to a project created through CMOD. You might not have so far encountered this situation because someone else already did this for the user-exits you were working on so far..
05-26-2016 11:31 AM
Hi Vinay,
As Jogeswara explained, we need to assign/map the enhancement component to the custom project and activation should be done. By doing so, the statements written inside the Exit will get executed.
Regards
Rajkumar Narasimman
05-26-2016 9:56 AM
VINAY
In the exit IWO10020 suggested by Rajkumar , use the following code in the include ZXWO1U06 to have your check and see it working.
DATA: v_eqtyp TYPE eqtyp.
CLEAR v_eqtyp.
SELECT SINGLE eqtyp FROM equi INTO v_eqtyp WHERE equnr = caufvd_imp-equnr.
IF v_eqtyp <> 'U'.
MESSAGE: 'You can not create Orders on Equipment types other than ''U''' TYPE 'E' DISPLAY LIKE 'I'.
ENDIF.
This throws the following error when the equipment is not of type 'U'.
Note:
If you want this to apply to certain Order types say 'PM02' and 'PM03, then put the above code between these two lines.
IF caufvd_imp-auart = 'PM02' OR caufvd_imp-auart = 'PM03' .
<above code>
ENDIF.
Good luck
KJogeswaraRao
05-26-2016 12:03 PM
sir,
after throwing the error message the equipment field is getting disabled,
its not allowing the user to re enter the data.
how do i avoid this....
05-26-2016 12:25 PM
Hi Vinay,
Try this:
MESSAGE: 'You can not create Orders on Equipment types other than ''U''' TYPE 'W' DISPLAY LIKE 'E'.
It will allow to edit fields.
05-26-2016 12:29 PM
hi pranay,
no , after error message if i press ENTER its going to (header data) next screen,
which should not happen,
our aim is to prevent the user from entering wrong equipment , if it goes to next screen there
user can save it ..
05-26-2016 12:35 PM
This issue will remain if you want 'Error' message. IF you change it to 'W' Control will be lost.
Also this is not an issue at all. Very insignificant inconvenience. You need to use /NIW31 in the command bar. That's it.
You already had a similar discussions in the part one of which is this. Take lesson from this: module poll getting disabled after error message | SCN
05-26-2016 12:48 PM
05-26-2016 1:27 PM
Hi Vinay,
Can you please try this code instead of normal error message display. And confirm if it is allowing you to edit fields after error message.
Replace
MESSAGE: 'You can not create Orders on Equipment types other than ''U''' TYPE 'E' DISPLAY LIKE'I'.
with below code:
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
TITEL = 'Change Equipment types'
TXT1 = 'You can not create Orders on Equipment types other than ''U''.'
TXT2 = ' '.
SET PARAMETER ID 'AAI' FIELD CAUFVD-AUART.
SET PARAMETER ID 'PRIOK' FIELD CAUFVD-PRIOK.
SET PARAMETER ID 'IFL' FIELD CAUFVD-TPLNR.
SET PARAMETER ID 'EQN' FIELD CAUFVD-EQUNR.
SET PARAMETER ID 'MAT' FIELD CAUFVD-BAUTL.
SET PARAMETER ID 'IWK' FIELD CAUFVD-IWERK.
SET PARAMETER ID 'GSB' FIELD CAUFVD-GSBER.
*if you are gonna use reference order, then get it using GET or FM 'DYNP_VALUES_READ'
DATA: L_REFNR TYPE RC62C-REFNR.
GET PARAMETER ID 'ANV' FIELD L_REFNR.
SET PARAMETER ID 'ANV' FIELD L_REFNR.
CALL TRANSACTION 'IW31'.
05-26-2016 1:28 PM
sir,
for developers , its not an issue,
but some end users insist on such things...
just i wanted to check is there any possibility to edit the field...
05-26-2016 3:17 PM
Hi Vinay,
Instead of Error message statement, Can you please try the below code and check whether field edit is possible after the message statement.
MESSAGE 'Can't create Orders on Equipment types other than ''U''' TYPE 'W' DISPLAY LIKE 'E'.
SET SCREEN 100 .
LEAVE SCREEN.
Regards
Rajkumar Narasimman.
05-26-2016 3:40 PM