cancel
Showing results for 
Search instead for 
Did you mean: 

Need Badi for CRMD_ORDER transaction.............

Former Member
0 Kudos

hello all,

My requirement is to make External ref no and Subject field mandatory in CRMD_ORDER transaction if the user saves without entering the values.......

i need a BADI for the same please help me out in this............

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hey Shiva,

You can use BADI ORDER_SAVE and implement interface CHECK_BEFORE_SAVE.

Revert for ny clartifications..

Reward points for usefull post..

Regards,

Anand..

Former Member
0 Kudos

hello anand ,

thanks for the reply.........

I have checked this badi in the interface CHECK_BEFORE_SAVE the fields which i need to validate (Subject and external field numbers) are not there. it contains only a parameter. but i need to have a structure which holds. please help me out in this.............

Former Member
0 Kudos

Hey Shiva,

Fields are never present there..

You need to use following function modules to suit your requirement..

1)FM CRM_SUBJECT_READ_OW for Getting the subject assigned to the Support Message

2)FM CRM_SALES_READ_OW to used to get the External ref nos..

Use these FM in BADI implementation..

The iv_guid parameter of the badi Implementation should be appropiatately passed to the FM..

Reward points for usefull posts..

Regards,

Anand..

Former Member
0 Kudos

Thank u v much anand the problem is solved....................

Former Member
0 Kudos

Hi Shiva,

I have done similar things to make "Message processor" and "Category" fields mandatory in tcode crmd_order for service tickets with transaction type SLFN.

But the problem is that, messages are not getting created from R/3! The interface CHECK_BEFORE_SAVE of badi ORDER_SAVE in solution manager is getting triggered even when a message is created from the R/3 system. Do you know of some way to stop triggering of this interface when User is creating a message from R/3?

Just have a look at my code below and let me know if anything is wrong in this code!

  • Check whether Message processor is maintained or not

CALL FUNCTION 'CRM_PARTNER_READ_OW'

EXPORTING

iv_ref_guid = iv_guid

iv_ref_kind = 'A'

IMPORTING

et_partner_wrk = i_partner.

i_partnerc = i_partner.

  • Chech whether "Message processor" is entered

LOOP AT i_partnerc INTO w_partnerc.

IF w_partnerc-kind_of_entry = 'C'

AND w_partnerc-partner_pft = '0008'.

flag = 'X'.

ELSE.

  • do nothing

ENDIF.

ENDLOOP.

IF flag IS INITIAL.

  • MESSAGE 'Enter Message Processor' Type 'E'.

CALL FUNCTION 'CRM_MESSAGES_DELETE'

EXPORTING

iv_ref_object = iv_guid

iv_ref_kind = 'A'

iv_caller_name = lc_object_name

EXCEPTIONS

appl_log_error = 1

OTHERS = 2.

IF sy-subrc <> 0.

  • do nothing

ENDIF.

CALL FUNCTION 'CRM_MESSAGE_COLLECT'

EXPORTING

iv_caller_name = lc_object_name

iv_ref_object = iv_guid

iv_ref_kind = 'A'

iv_msgno = lv_msgno

iv_msgid = lv_msgid

iv_msgty = lv_msgty

iv_cumulate = 'X'

EXCEPTIONS

not_found = 1

appl_log_error = 2

OTHERS = 3.

MESSAGE s002(zcat) RAISING do_not_save.

ENDIF.

  • Check whether Category is maintained or not

CALL FUNCTION 'CRM_ACTIVITY_H_READ_OW'

EXPORTING

iv_activity_h_guid = iv_guid

IMPORTING

es_activity_h_wrk = i_category

EXCEPTIONS

activity_h_not_found = 1

OTHERS = 2.

  • Check whether category is maintained

IF i_category-category IS INITIAL.

*Raise the message based on the conditon

CALL FUNCTION 'CRM_MESSAGE_COLLECT'

EXPORTING

iv_caller_name = lc_object_name

iv_ref_object = iv_guid

iv_ref_kind = 'A'

iv_msgno = lv_msgno

iv_msgid = lv_msgid

iv_msgty = lv_msgty

iv_cumulate = 'X'

EXCEPTIONS

not_found = 1

appl_log_error = 2

OTHERS = 3.

MESSAGE s001(zcat) RAISING do_not_save.

ENDIF.

Answers (0)