cancel
Showing results for 
Search instead for 
Did you mean: 

IW41-Restrict confirmation without goods issue

Former Member
0 Kudos

Dear Expert,

How to restrict confirmation for tcode IW41 if manual goods issue (MB1A) is not done against maintenance order.There are so many threads against goods issue check for confirmation against production order but not for maintenance order.Please let me know if we can do this my any user exit or user status.If possible please share the steps or logic for the same.

Thanks in advance.

Regards.

Swapnil

Accepted Solutions (1)

Accepted Solutions (1)

jogeswararao_kavala
Active Contributor
0 Kudos

Hello swapnil,

The following code in include ZXCOFU05 (user-exit CONFPM05), would suffice the requirement you have stated in your question.

IF CAUFVD_TAB-AUART = 'ZM03'.
   DATA: IT_GM TYPE TABLE OF AUFM.
   SELECT * FROM AUFM INTO TABLE IT_GM WHERE AUFNR = CAUFVD_TAB-AUFNR.

   IF IT_GM[] IS INITIAL.
     MESSAGE: 'Goods Movement not found for this Order !' TYPE 'E' DISPLAY LIKE 'I'.
   ENDIF.
ENDIF.

This code while saving confirmation (IW41, IW44), gives rise to the error popup below, if no Goods movement is done against  an Order   of type  'ZM03'.

Few points to be noted while using user-exits

1. User-exits will function when they are assigned to a project created through CMOD.

2. The code should always specify the limits like the 1st line here which confines the application of the code to only ZM03 type orders. Like wise you can limit this code to a particular Tcode (IW41) or list of Tcodes IW41, IW44. (by using syntax like IF SY-TCODE = 'IW41' OR SY-TCODE = 'IW44'.)

3. You should test well in Dev100 and Dev220 and quality clients before taking it to Prodn server.

4. You can further refine your code, incorporating more IFs as per your situation (Take help of your ABAPer).

4. In my view user-exits are very convenient and more flexible way of defining our checks to the standard programs.

KJogeswaraRao

Former Member
0 Kudos

Dear Mr Jogeswara,

Thanks a lot for the reply.I will try it and get back to you.

Regards.

Swapnil

Former Member
0 Kudos

Dear Mr Jogeswara,


The user exit and logic given by you is working and solved my issue.But for some preventive maintenance order where goods issue is not required but confirmation required,in this case could you please help me out what logic shall be derived which could be work for both  scenarios.


Regards.


Swapnil

jogeswararao_kavala
Active Contributor
0 Kudos

I had already touched upon this aspect, by suggesting to  'add more IFs as per your situation'. It depends on how you distinguish these two Orders within an Order type, and incorporate this into your logic. If you want to distinguish this by entries in Components tab, then the logic can be like:

IF CAUFVD_TAB-AUART = 'ZM03'.
DATA: IT_RESB TYPE TABLE OF RESB,
       IT_GM TYPE TABLE OF AUFM.

SELECT * FROM RESB INTO TABLE IT_RESB
   WHERE AUFNR = CAUFVD_TAB-AUFNR AND XLOEK <> 'X'.

IF IT_RESB[] IS NOT INITIAL.

   SELECT * FROM AUFM INTO TABLE IT_GM
     WHERE AUFNR = CAUFVD_TAB-AUFNR.

   IF IT_GM[] IS INITIAL.
     MESSAGE: 'Goods Movement not found for this Order !'
     TYPE 'E' DISPLAY LIKE 'I'.
   ENDIF.

ENDIF.

ENDIF.

Means: You are distinguishing these ZM03 Orders by having entries in Components tab or not. The confirmations for the Orders which do not have any entries in Components tab will not be any problem. But those having entries in Components tab,this user-exit will check whether Goods issue was done or not. If not then it would throw the error popup. Lines 5 and 6 of the code check whether this Order has any entries in Components tab. Accordingly an IF has been added in line 8.

The above is an example how you differentiate the kinds of Orders to undergo this check during confirmation. Another case can be the Activity Type is different for these Orders. Possible that your case is different. So, first you need to know the difference and tell the system through an IF.

KJogeswaraRao

Former Member
0 Kudos

Dear Mr Jogeswara,

Thanks a lot for your expert help....now its working fine for all my scenarios.

Regards.

Swapnil

jogeswararao_kavala
Active Contributor
0 Kudos

These feedbacks are very important. Thank you swapnil.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Swapnil

My first thought was that User Status could control this. Setup with something like an Initial Status that has "Confirm Order" as a Forbidden transaction. Then, when a Goods Movement is posted, this sets the next status automatically via the "Set" in config. And this next status has "Confirm Order" as Allowed.

However Goods Movement isn't an action that can be used to influence the next status.

So I think you would need some code written. Either as a user exit (see Terence's suggestions above, or an exit on MIGO/MB1A), or a custom program which runs periodically and sets the "Confirmation Allowed" User Status, if the order has a System Status of GMPS (Goods Movement Posted). This GMPS method doesn't differentiate between Issues and Receipts, however most EAM processes (outside of Refurbishment) only have Issues anyway.

You may need a workaround if an order doesn't require any Goods Issues. Many EAM orders are labour only, so no issue required or expected.

Regards

MTerence
Active Contributor
0 Kudos

Hi Swapnil,

I dont think there is any standard way to achieve it.

1. I guess you can use user status and part of code to achieve it.

2. Check with user exit

CONF0001 Enhancements in order confirmation

CONFPM05 PM/SM order conf.: Cust. specific enhancements when saving

Regards

Terence