Application Development and Automation 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: 
Read only

Validation in CJ02 while SAVE

former_member190178
Participant
0 Likes
2,335

Hi Techie's,

My requirement is like when user gives a new WBS in CJ02 and clicks on account assignment

and SAVE then system should as wether it should go in ASSETS or in AUS (in construstion).

Please tell if any way out of it ?

13 REPLIES 13
Read only

Former Member
0 Likes
1,939

Hi,

Check is there any BADI/User exit get triggering after clicking the SAVE button.

In that u can do the code what u want to do.

Hope this helps u,.

Thanks.

Read only

former_member585060
Active Contributor
0 Likes
1,939

Hi Soni,

Try this BADI

WBS_FIELDS_FOR_ASSET -- Transfer Further Master Data from WBS Elements to Assets

It is getting triggered while Save button is clicked.

Regards

Bala Krishna

Read only

0 Likes
1,939

Hi Bala,

Could you please help me in some more detail. I have implemented the defination WBS_FIELDS_FOR_ASSET. I found 2 methods in it:

SET_ANLA_ANLZ

ANL_SWITCH_PSPNR

I am still confused how to use it ??

Requiement goes like....when user gives a new WBS in CJ02 for a particular project and clicks on the Account Assignment (PRPS-BELKZ) check box. A pop up should come asking transferring that WBS into Asset or in AUC (Asset under Construction).

Not getting now to implement in proper way ? Please help.

Read only

0 Likes
1,939

Dear Experts,

Now the requirement is changed and user wants that when ever he uses CJ02 and puts new WBS element in that and clicks SAVE , a pop up should prompt saying "AMR needs to be created".

I found a method (ANL_SWITCH_PSPNR) in defination (WBS_FIELDS_FOR_ASSET) where its hitting and I have tried to give Information message also...How to keep track of this message I mean, how to track wether he has clicked on YES or NO. if he clicks on NO that he should not go ahead.

Please suggest me something.

Read only

0 Likes
1,939

Hi Soni,

If you assign Investment profile to WBS, AUC gets created automatically in background when you save the newly created WBS. This is standard SAP. Have a word with ur PS functional consultant.

Regards

Read only

0 Likes
1,939

Thats right Shrikant.

But here user wants to give a pop up for creating the asset (CJ01) after being asked for AUC things and the time till he is not creating the asset using AS01 he should not be able to SAVE that. This is the requiememnt. Pleaes suggest something.

Read only

0 Likes
1,939

Hi Raymond,

Can you please tell something about the OPSI transaction. What can we use it for ? I have never used such stuff indeed ? Getting from you will understand that wether can I use this for my requirement.

Read only

0 Likes
1,939

Hi,

Goto SPRO>PS>Structures>Operative Structures>WBS>Enhancements for PD & WBS>BADI: WBS Elements

This BADI executes when you change WBS structure. Activate it and write your code. Logic can be checking newly created WBS with a/c assignment tick and then calling tcode AS01.

I dont think validation will help in ur case. Have a word with functional.

Regards

Read only

0 Likes
1,939

Hi Srikant,

Thanks for the reply. Its not the matter of changing the WBS element I am not changing any WBS. What here I am doing is say already a WBS at line number 1 is given under some project X in Cj01. I am adding one more WBS after it. When I enter I have been asked many things, I keeep on giving one after one. Now its again on the original screen. Here if I push SAVE, I need to give a pop up screen mentioning "Asset needs to be created" and AS01 is called. If I dont create the asst for it, I should not be allowed to save that new WBS in Cj02. Now need a BADI for this.

PROJECTDEF_UPDATE is not of my use.

WORKBREAKDOWN_UPDATE is also not useful

WBS_FIELDS_FOR_ASSET is also not stopping anywhere.

Read only

0 Likes
1,939

Hi,

I understand you are not changing WBS. What I have written is: you are changing strucuture by adding new WBS. The BADI I have suggested allows you to write code before saving. In the mean while I have thought of another logic which you can implement.

When you create asset in CJ01, settlement rule gets created automatically for the WBS. Now you can check whether settlement rule is created for new WBS.

There is lot of functional involvement in the development so repeatedly suggesting you to refer to functional person. I am PS functional consultant so dont understand technicality beyond a certain point.

Regards

[Shrikant Rakate|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=h7qeup6ghg4%3d]

Read only

0 Likes
1,939

Yes Shrikant.

You are right that it involves ths PS consultant involment. I thought I will get something might somebody has done it in case. But now it seems its quite though or impossible. I still need to decide.

Read only

GauthamV
Active Contributor
0 Likes
1,939

Did you check this [user exit for cj02 save|https://forums.sdn.sap.com/click.jspa?searchID=21195985&messageID=6409950] ?

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,939

Some BADIs that may fulfil your requirement :

- [WBS_FIELDS_FOR_ASSET|https://www.sdn.sap.com/irj/scn/advancedsearch?query=wbs_fields_for_asset&cat=sdn_all]

- [WORKBREAKDOWN_UPDATE|https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_all&query=workbreakdown_update&adv=false&sortby=cm_rnd_rankvalue]

There are also some Customer exits that may be used

- Enhancement [CNEX0007|https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_all&query=cnex0007&adv=false&sortby=cm_rnd_rankvalue]

And validation rules

- Transaction OPSI ([Note 440186 - FAQ 2: Validation and substitution in the project|https://service.sap.com/sap/support/notes/440186])

Also dont' hesitate to

- [perform some search at sdn|https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_all&query=cj02+&adv=false&sortby=cm_rnd_rankvalue]

Regards