Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

exit to check equipment after selecting enter button in IW31

former_member185116
Active Participant
0 Kudos

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....

1 ACCEPTED SOLUTION

rajkumarnarasimman
Active Contributor
0 Kudos

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

22 REPLIES 22

pranay570708
Active Contributor
0 Kudos

Hi Vinay,

You can achieve this through User-Exit IWO10009. You need to provide the code in the include of this exit. ZXWOCU07.

And you can also achieve it through implicit enhancement. Refer below:

0 Kudos

hi pranay,

i want the check immediately after selecting the ENTER not at the time of saving..

i.e before displaying header data tab....

0 Kudos

Then pls try the implicit enhancement option. Refer the link i have provided in above post.

Ashg1402
Contributor
0 Kudos

Hi,

Check this enhancement - IWO10018 and its components in SMOD.

This might help you.

Regards

Ashish

0 Kudos

hi ashish,

no the exit IWO10018 is not triggering after entering the enter button in IW31

0 Kudos

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

rajkumarnarasimman
Active Contributor
0 Kudos

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

0 Kudos

hi rajkumar,

no the said exit is not triggering after selecting the ENTER button...

0 Kudos

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.

0 Kudos

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....

0 Kudos

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..

0 Kudos

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

jogeswararao_kavala
Active Contributor
0 Kudos

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

0 Kudos

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....

0 Kudos

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.

0 Kudos

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 ..

0 Kudos

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

0 Kudos

rao sir,

thank u for u r neat explanation.

0 Kudos

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'.

0 Kudos

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...

0 Kudos

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.

0 Kudos

Yes

This is working.

Regards

KJogeswaraRao