cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

how to display error message for choosing incorrect CR type?

Chandra_S
Explorer
0 Kudos
849

Hi Team,

I am working on some task.

When user selects a material, clicks on copy , Change request pop will come. If an incorrect CR type is selected , how to display error message on the screen?

Kindly provide some inputs on how this can be achieved.

 

Chandra_S_0-1730893729544.png

Chandra_S_0-1730953751422.png

 

error message (incorrect CR type)to be displayed here in yellow section?

Chandra_S_1-1730953802951.png

 

 

 

regards

Chandra.

Accepted Solutions (0)

Answers (2)

Answers (2)

0012anirban
Contributor

Hi Chandra,

The right approach should be to control the CR types which are available in popup using Security roles.

There should be only certain set of users who should be able to access a certain CR type.

In your use case what is the criteria for the incorrect CR type?

Regards

Anirban

Chandra_S
Explorer
0 Kudos
@ Anirban Authorization added for relevant users and when one tries to create CR which is not supposed to , error is shown (no authorization)
Chandra_S
Explorer
0 Kudos
however, there will be some users who will have full authorization and they can see all CR types and can create a incorrect CR type.
Chandra_S
Explorer
0 Kudos
Ex : material type is FERT and if Create Service CR type is chosen(instead of Create Tradable Commodity Material ), error should be displayed(Incorrect CR type).
0012anirban
Contributor

Hi Chandra,

The authorization will only show the relevant CR type for which user has access to. The CR type which shouldn't be chosen will not be displayed.

Coming to users who have full access, they are generally power users, and they will obviously know which CR to choose, it's more of a best practice.

I would not suggest enhancing the system just for users who have full access, instead it should be controlled by SOP.

Regards

Anirban

 

adityaIngale66
Active Participant
0 Kudos

Hi @Chandra_S ,

I'm not sure about the error message, but you can use the BADI 'USMD_CREQUEST_INTEGRATION' to filter out the incorrect CRs from the popup box. 

Obviously, you can display the error message after the CR is created for a particular CR type. However, I think you're looking to show the error message in the popup itself before the CR is created. Achieving this would require modifying the WebDynpro, which I'm not entirely sure how to do.

Chandra_S
Explorer
0 Kudos
@adityaIngale66 Hi Aditya, This is what we are trying to accomplish here. User trying to copy the existing material and create a new material. In this case ,material type is FERT and if Create Service CR type is chosen, error should be displayed(Incorrect CR type) in below screen 2??
Chandra_S
Explorer
0 Kudos
@adityaIngale66 Please check the screenshots in my first question.
adityaIngale66
Active Participant
0 Kudos
You can use BADI USMD_RULE_SERVICE to display error message. Read the CR type and display error message in check entity method, if it is incorrect. Let me know if you want more details on this.
Chandra_S
Explorer
0 Kudos
Hi Aditya, I have implemented the BADI 'USMD_CREQUEST_INTEGRATION' , can get the current CR type but not able to get the material type. So implemented the enhancement in feeder class CL_MDG_BS_MAT_FEEDER_FORM_MAT( IF_FPM_GUIBB_FORM~GET_DATA) of basic data CR section and can display the error message.