cancel
Showing results for 
Search instead for 
Did you mean: 

Another question about CRM_ORDERADM_H_BADI

Former Member
0 Kudos

Hello everybody.

I have a little problem with BADI crm_orderadm_h_badi. In our company we have several types of complaints. Each complaint can have a specific follow up task (meaning complaint type A can only be follow by task type A and so on).

I wrote a code in the BADI that checks the transaction type of the task (during the creation of the task) against the transaction code of the predecessor (all the matched are detailed in a special customizing table I wrote). If there is no match - I raise an error msg. using function CRM_MESSAGE_COLLECT.

The problem is that I can not set the error as a popup message - it goes stright into the message table that is generated automatically.

If I don't use the function CRM_MESSAGE_COLLECT and use the RAISING option I get a general error in the message table.

Worse - I don't want the new task to be saved - and at the moment I can save the task even if the message is an "error" or "about" type.

Is there a way to stop the processing of the new task the moment I figure that the transaction types are wrong? Is there a way to make the error a popup message (only this error and not the other messages).

Thanks.

Jacob.

Accepted Solutions (1)

Accepted Solutions (1)

former_member187400
Active Contributor
0 Kudos

Hi jacob,

Perhaps, u can try use this message to show the error:

MESSAGE I300(eu) WITH 'Save is failured'..

And perhaps, to go out from the transaction, u can state "exit" in your program.

Hope it help u.

Regards.

Daniel N.

Don't forget to give the point if u satisfy with the answer _.

Answers (2)

Answers (2)

Former Member
0 Kudos

OK, I used 2 BADIes:

1. ORDER_NAME

2. CRM_ORDERADM_H_BADI

In the CRM_ORDERADM_H_BADI I used method crm_orderadm_h_check to check what action the user is doing - and if he tries to create a follow-up task, the code checks the transaction type of the predecessor against the current task and issues a message if the worng task is chosen. To issue the messages I used the functions described in the BADI's help.

In BADI ORDER_NAME under method check_before_save I'm checking the messages list using functions crm_messages_search to get the message logs and function crm_messages_get_msg_info for the messages details. If the message I issued in step 1 is there - I'm raising the DO_NOT_SAVE exception.

P000636
Active Contributor
0 Kudos

Hi Jacok

Look the post:

You can search your message in the general table of errors and mark documet not_saved in the prepare method of ORDER_SAVE ( By example )

Regards.

Manuel