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: 

User Exit in system(ME51N) that until WBS is released, PR should not be created

former_member195427
Active Contributor
0 Kudos

Hi Experts,

               I am a functional Consultant.I need to put a User exit in the screen of ME51N (Manual PR) to check that if WBS or Network is not released system should not allow to create PR.

The logic which I have thought of is given below:

{ IF ‘EBAN-KNTTP” = P or Q or N

CHECK Field “PS_POSID” (IF EBAN-KNTTP=Q)

CHECK Field “NPLNR” (IF EBAN-KNTTP=N)

CHECK Field “NPLNR” & “PS_POSID”                                                         (IF EBAN-KNTTP=P)

GET “OBJNR”                                                                                        (from “PROJ” or “PRPS” or “AFVC”)

     AND CHECK

{IF “ISTAT”= I00002 (from “JCDS”)

         ALLOW PR Creation

(The above loop is to be checked if field ‘EBAN-KNTTP’ is either P or Q)

ELSE

      “Error Message” “WBS or Project is not Released”

AND

{IF “ISTAT”=I0002 (Check from “JEST”)

              ALLOW PR Creation

(The above loop is to be checked if field ‘EBAN-KNTTP’ is N)

ELSE “Error Message” “Network is not Released”

END IF

END IF

END IF

      }}}

Please suggest what other things do I need to discuss with our developer or how can I put this logic in the system, if I goes forward?

Please help.

Thanks & Regards

Ankur

9 REPLIES 9

raymond_giuseppi
Active Contributor
0 Kudos

Could you not get the same result by forbidding business transactions like RMBA "Material purchase requisition" when status is not released

Check via transaction BS33/BS23, the current Customizing may look like :
  

System statuses influencing the process:                     
I0001 CRTD Created                       permits            
I0002 REL Released                      permits            
I0013 DLT Deletion indicator            prohibited         
I0042 PREL Partially released            permits            
I0043 LKD Locked                        prohibited         
I0045 TECO Technically completed         prohibited         
I0046 CLSD Closed                        prohibited         
I0064 AALK Account assignment locked     prohibited         
I0076 DLFL Deletion Flag                 prohibited         
I0274 BLLS Boycott list                  prohibited         
I0275 EXLS Export control                prohibited         
I0310 FTC2 Control: Embargo              prohibited         
I0311 FTC3 Control: Missing master data  prohibited         
I0312 FTC4 Control: Permission           prohibited         
I0320 INAC Object Deactivated            prohibited         
I0352 SETT Settled                       prohibited         
I0541 OWNS Owner Settlement              prohibited         
I0599 LSPL Locked Through Splitting      prohibited         


Regards,

Raymond

0 Kudos

Hi Raymond,

               Thanks for your response.The business does not want to go through user status control and authorization check on them instead they prefer to go via User exit only. However,  I checked Transaction BS23 and the screen shown is as follows:

Please suggest which check box do I need to select here to address ny issue.

Thanks & Regards

Ankur

0 Kudos

Hi Ankur,

I wont advice to change BS22 settings. You need to convince business for user status option, why are they opposing? There can be a default user status which blocks PR assignment and this status will get reset when user releases WBS. You can achieve this via user status and users wont see any process change or additional steps. If standard SAP can provide good solution, why should we consider development?

Regards

Shrikant

0 Kudos

Shrikant,

             No one can negate the points you have mentioned and I have discussed it in detail in PS forum. But due to some unavoidable reasons I have to adopt a different path other than user status.And I can not think of a better option than user exit.

IF you can suggest any other way , please suggest.

Also, I seek help of developers to suggest me on the same.

Thanks & Regards,

Ankur

0 Kudos

Hi Ankur,

In that case you have following options:

1. As Raymond suggested, forbid business transaction RMBA in BS22. Open BS22, double click on CRTD status, then page down till RMBA or you can enter RMBA in the small window at left bottom of screen. Make this busniess transaction forbidden at CRTD status and test.

2. With the help of BADI 'ME_PROCESS_REQ_CUST', check during PR save whether WBS is released or not. You can issue custom warning or error message. Take OBJNR for WBS from PRPS table and get status from JEST table.

Any of the above options will solve your issue. I would still like to know why client doesnt want user status. Please share if possible, it will be interesting to know.

Regards

Shrikant

0 Kudos

Hi Shrikant,

                 Many thanks for your valuable response. I 'll check that in my system . Also, I think,better if I discuss the reasons for not going with User exit to you via gmail. As, I am connected to you via gmail with the name as saurabh tiwari.

I hope you'll understand and will discuss when found free.

Warm regards

Ankur

sushrut_sheth
Active Participant
0 Kudos

CNEX0026

use this user exit for transaction code ME51n

Former Member
0 Kudos

This message was moderated.

former_member374929
Active Participant
0 Kudos

Hi Saurabh,

Try with BADI ME_PROCESS_REQ_CUST.

Check method

    • Header data of purchase requisition
      BAdI method
      PROCESS_HEADER

    • Item data of purchase requisition
      BAdI method PROCESS_ITEM

    • Account assignments in der purchase requisition
      BAdI method
      PROCESS_ACCOUNT

Thanks.