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: 

Introduce error message for a particular SAP standard function

Former Member
0 Kudos

Hi All,

In TCode CS02 - BOM Changes, for a particular BOM usuage [say D], whenever a user clicks on Material BOM- DELETE, I would like an error message to be displayed saying that they need a Change Number.

Could you please let me know how I go about acheiving this and in which module I have to build the code ?

Thank you,

Satish

1 ACCEPTED SOLUTION

I355602
Advisor
Advisor
0 Kudos

Hi,

You can go the concpet of enhancements, and include a code when user selects a row and clicks DELETE button.

So check for BOM usage as D for the selected row and display appropiate message.

Hope this helps you.

Regards,

Tarun

12 REPLIES 12

I355602
Advisor
Advisor
0 Kudos

Hi,

You can go the concpet of enhancements, and include a code when user selects a row and clicks DELETE button.

So check for BOM usage as D for the selected row and display appropiate message.

Hope this helps you.

Regards,

Tarun

Former Member
0 Kudos

Hi Tarun,

Thanks for your reply.

Could you please let me know how do I go about acheiving this, i.e. which PAI modules in SAP, etc I would be modifying and what kind of code goes where ?

Thanks,

Satish

Former Member
0 Kudos

It doesnt matter which line to delete. As soon as a user clicks on delete button, we would like to have the error message displayed.

0 Kudos

Hi,

To find the BAdi for CS02, follow steps:

Goto SE24 and enter CL_EXITHANDLER and click on display. Now double click on the method GET_INSTANCE. Set breakpoint on CL_EXITHANDLER=>GET_CLASS_NAME_ON_INTERFACE.

Now run the transaction for which you want to search the Badiu2019s. Now whenever the method is called, the program goes into debugging mode. Check the value of exit_name (changing parameter),this would give the name of the Badiu2019s. Run the entire transaction and note down all the Badiu2019s.

Now we have to implement the Badi. Go to SE18 to check the definition of the Badi and SE19 to implement the Badi. Enter the name of the Badi in the create implementation section (if you are creating a new implementation u2013 Radiobutton Classic Badi) and click on create implementation. Now enter the name of the implementation. Double click on the method name and add the code for the implementation.

Now, you need to check the parameter inside the BADI and figure out as per your requirement.

Use break-points (break <user_name>) and execute the transaction to check the flow and find the BAdi exectued when user click DELETE button.

Hope this helps you.

Regards,

Tarun

Former Member
0 Kudos

Hi Satish,

How about implmenting Exits or Implicit Enhancements.

Regards

Shital

Former Member
0 Kudos

I have thought about exits too, but would lilke to know how to acheive them. Details will be helpful

0 Kudos

Hi,

You can also refer:-

BADI implementation of particular transaction

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d0456c54-0901-0010-f0b3-cd765fb9...

If u want to find the user exit and badi use the below link

https://www.sdn.sap.com/irj/scn/wiki?path=/display/abap/find%252bapplication%252bclass%252bwith%252b...

Hope this helps you.

Regards,

Tarun

Former Member
0 Kudos

Thank you Tarun.

Wondering if this can be acheived through user exits instead of BADI's ?

Anyone else has other ideas ?

Satish

0 Kudos

Hi,

>

> Thank you Tarun.

>

> Wondering if this can be acheived through user exits instead of BADI's ?

>

> Anyone else has other ideas ?

>

> Satish

I guess it will be good to go for BAdi's instead of User-Exits coz multiple implementations can be done using BAdi's, but it cant be done using User-Exits.

Still you can open the program for transaction CS02 and in that program find string CALL CUSTOMER.

All result found are user-exits, now need to figure out the particular user-exit by using break-point.

Hope this helps you.

Regards,

Tarun

0 Kudos

Hi Satish,

Try implementing BADI, found out by putting break point in the class CL_EXITHANDLER.

If no proper BADIs are available you can go for the implicit enhancement options if you are in ECC 6.0.

Method to find implicit enhancemenrt option:

Display the std code which you want to enhance. Click on the 'Enhance(Shift + F4) button. Then got to Edit ->Enhancement Operations->Show implicit enhancement options.

The points where you can add your custom code will come in orange color. There you can plug in custom code .

Regards,

Soumya.

Former Member
0 Kudos

Alright, thank you. Let me give it a try..

0 Kudos

k