on 05-10-2012 6:26 AM
Dear all,
I have written a particular code in User Exit named MV45AFZZ for SD module for sales order creation and change which is giving certain errors like updating error. and some times the sales order stops flowing in MRP and once i comment the code it starts flowing again in MRP. Is there any table getting missed to be updated in my user exit. I am pasting my code below.
Requirement:- To change the reason for rejection in sales order creation and change through VA01 and VA02 respectively as per the
Delivery block.
{code}
DATA: wa_vbap LIKE xvbap.
DATA: wa_yvbap LIKE yvbap.
IF t180-trtyp = 'H'. " "H" means Creation of Sales order
IF vbak-lifsk = 01.
LOOP AT xvbap[] INTO wa_vbap.
wa_vbap-abgru = 'ZZ'.
MODIFY xvbap[] FROM wa_vbap INDEX sy-tabix.
CLEAR wa_vbap.
ENDLOOP.
ELSE.
LOOP AT xvbap[] INTO wa_vbap.
wa_vbap-abgru = ' '.
MODIFY xvbap[] FROM wa_vbap INDEX sy-tabix.
COMMIT WORK.
CLEAR wa_vbap.
ENDLOOP.
ENDIF.
ELSEIF t180-trtyp EQ 'V'. " "V" means change of Sales order
IF vbak-lifsk = 01.
LOOP AT xvbap[] INTO wa_vbap.
wa_vbap-abgru = 'ZZ'.
wa_vbap-updkz = 'U'.
MODIFY xvbap[] FROM wa_vbap INDEX sy-tabix.
CLEAR wa_vbap.
ENDLOOP.
ELSE.
LOOP AT xvbap[] INTO wa_vbap.
wa_vbap-abgru = ' '.
wa_vbap-updkz = 'U'.
MODIFY xvbap[] FROM wa_vbap INDEX sy-tabix.
CLEAR wa_vbap.
ENDLOOP.
ENDIF.
ENDIF.
{code}
Remove
COMMIT WORK. in the code.. ithink then it should work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
100 | |
11 | |
11 | |
6 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.