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: 

Validating Profit Center in CJ20N Transaction

Former Member
0 Kudos

Hi All,

My requirement is to lock the Profit Center field(Make it grayed out) in the project using CJ20n transaction once it is created.

Also when ever the user is trying to change the profit center by entering the project details, it should give an Error message saying that "the profit center value cannot be changed", when trying to save the project details with the new value.

I have tried using almost all the userexits(CNEX0001,CNEX0002,CNEX0003,CNEX0004,CNEX0005,CNEX0006,CNEX0007,CNEX0008,CNEX0038,CNEX0033,CNEX0028,CNEX0029) for the transaction CJ20n and even searched for the BADIs, but none of them was not suitable for my requirement.

Can any body suggest the suitable User exit or a BADI to implement for this requirement.

Thanks

1 REPLY 1

Former Member
0 Kudos

Hello,

Try following....

Use BAdi BUS2054.

In that write an implementation

Two scenarios

1) Creating new project. (Values in PRPS table will get updated after save.)

2) Opening existing project in change mode. ( Already values corresponding to that WBSE are available in PRPS table).

Pre-Requisite:

1) If possible make Profit center field madatory.

Scenario 1:

In Implementation write

At_save

IF PRPS-PRCTR = initial or zero. Then no error. Because he is creating Project, so no values will be available in PRPS. Once he saves PRPS will get updated and from next it will be delt as per scenario 2 below.

Scenario 2:

At_save

If PRPS-PRCTR <> the value entered by the user (i.e. user trying to enter something different which is already there in PRPS table against that WBSE (PRPS-POSID)) throw an error "Profit center can not be changed".

Please try along with ur abaper.

Post ur findings.

Thanks & Regards

Saikishore.Ganga