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: 

Validation Data in IW31/ IW32 with user-exit or BADI

Former Member
0 Kudos

Hello Gurus,

I need your help to discovery one BAdI or User-Exit to validate data in T-Code IW31 and IW32.

My objective is to validate, before saving, the components in the maintenance order by the MRP type. Is it possible? What BAdI or user-exit should I say to the programmer to use?

I don't work with ABAP so I just found a thread with some BAdI's and user-exits taht can possibly be used:

Thank's in advanced.

Best Regards.

MB

1 ACCEPTED SOLUTION

jogeswararao_kavala
Active Contributor

You can achieve this through User-Exit IWO10009.

You need to provide the code in the include of this exit. ZXWOCU07. In fact this exit has no direct access to Components (RESB structure) so the coding has to use Field-symbols. I'm providing a code where the changes in Component Quantities are restricted after the Order release. You can modify this for your requirements.

Jogeswara Rao K

4 REPLIES 4

jogeswararao_kavala
Active Contributor

You can achieve this through User-Exit IWO10009.

You need to provide the code in the include of this exit. ZXWOCU07. In fact this exit has no direct access to Components (RESB structure) so the coding has to use Field-symbols. I'm providing a code where the changes in Component Quantities are restricted after the Order release. You can modify this for your requirements.

Jogeswara Rao K

0 Kudos

Thanks for the help Jogeswara Rao,

Can you try and help me on this thread:

Thanks,

MB

0 Kudos

Thank you.

jogeswararao_kavala
Active Contributor

Hello Manuel,

Regarding the present thread. Forget about the code attached. Here is the solution code for your requirement. It is tested.


TYPES: BEGIN OF TY_RESB,
        MATNR TYPE RESB-MATNR,
        RSPOS TYPE RESB-RSPOS,
   END OF TY_RESB.

DATA: IT_RESB TYPE TABLE OF TY_RESB,
       WA_RESB LIKE LINE OF IT_RESB,
       LV_DISMM TYPE MARC-DISMM.

FIELD-SYMBOLS: <FS_RESB> TYPE ANY.

DATA: BEGIN OF I_RESB OCCURS 100.
         INCLUDE STRUCTURE RESB.
DATA:END OF I_RESB.

ASSIGN ('(SAPLCOBC)resb_bt[]') TO <FS_RESB>.
I_RESB[] = <FS_RESB>.

SELECT MATNR RSPOS FROM RESB INTO TABLE IT_RESB

WHERE AUFNR = CAUFVD_IMP-AUFNR.
CLEAR LV_DISMM.
LOOP AT I_RESB.
   READ TABLE IT_RESB INTO WA_RESB WITH KEY RSPOS = I_RESB-RSPOS.
   IF SY-SUBRC = 0.
     SELECT SINGLE DISMM FROM MARC INTO LV_DISMM

WHERE MATNR = WA_RESB-MATNR.
     IF LV_DISMM = 'P1' OR LV_DISMM = 'P2' OR LV_DISMM = 'P3'.
       MESSAGE: 'Please check the MRP type of the component materials used' TYPE 'E'.
     ENDIF.
   ENDIF.
ENDLOOP.

According to this, the Order saving is refused in case the MRP types are  P1, P2, P3. This is as per Code line number 25. You can customise these types as per your requirement. In the the Order Components tab if any of the materials belong to these 3 MRP types, the following error is thrown in the status bar.

Hope this is of help to you.

Jogeswara Rao K