cancel
Showing results for 
Search instead for 
Did you mean: 

Compliant status not updating

Former Member
0 Kudos

Hi All,

I am trying to update complaint status in ORDER_SAVE BADI in CHECK_BEFORE_SAVE method. I am facing below Issue with this.

I am reading the complaint status using CRM_STATUS_READ_OW. If the status of complaint is closed I am doing some validation on custom field if the validation fails..I need to set the status of complaint back to previous one instead of complaint closed.

I am changing the status using  CRM_STATUS_MAINTAIN_OW function module.

But issue is if the previous status is approved it's changing the status back from Complaint closed to approved. If it has any other previous status Like 'Complaint assessment' or 'Open' it's not setting the status back to those values from complaint closed and getting the error message saying 'Not Allowed'.

I am not sure How can I achieve this.

Is there any configuration I have to do to allow the status back to open or Compliant Assessments to change it from Complaint closed..?

Is there any dependency with system status...?

Currently I am not passing any user_stat_proc in the FM do i have to pass this always..?

                   ls_status-ref_guid       = iv_guid.

                   ls_status-ref_kind       = lc_a.

                   ls_status-status         = ls_status_wrk-status.

*              ls_status-user_stat_proc = iv_user_stat_proc.

                   ls_status-activate       = abap_true.

                   APPEND ls_status TO lt_status.

                   ls_field_name-fieldname    = 'ACTIVATE'.  "#EC NOTEXT

                   APPEND ls_field_name TO lt_field_names.

                   CALL FUNCTION 'CRM_STATUS_MAINTAIN_OW'

                     EXPORTING

                       it_status_com        = lt_status

                     CHANGING

                       ct_input_field_names = lt_field_names

                     EXCEPTIONS

                       not_allowed          = 1

                       error_occurred       = 2

                       warning_occurred     = 3

                       OTHERS               = 4.

                   IF sy-subrc EQ 0.

                   ENDIF.

I appreciate your help on this.

Thanks,

Sanjana.

Accepted Solutions (1)

Accepted Solutions (1)

GopalakrishnanS
Participant
0 Kudos

Hi Sanjana,

Please check which business transaction assigned to the status 'Approved'. Apply the same to the other status also.

SPRO->IMG->Transactions->Basic Settings->status Management->Define Status profile for user status.

Hope this help you.

Regards,

Gopalakrishnan S.

Former Member
0 Kudos

Hi Gopalkrishna,

Unfortunately I cannot use this option because it will show the user all the option which is not supposed to display in user status.

What I am planning to do is to raise hard error if my validation fails in EH_ONSAVE Event. Which is working fine.But Issue is if we use IC Agent role even though we have hard error when user clicks on save and end interaction button it will save the data.

this is also fine in my case. But When the user reopen the complaint or if we open from other role I should display my own custom message same as like standard message as soon as we open complaint.

But currently it's not displaying custom message do we have to write any special code to add the custom error message to standard ones..?

Could you please suggest how I can achieve this..?

I do not want to use DO_NOT_SAVE exception it should allow IC agent to go out even though if they have errors.

I am using below code to raise error message.

lr_message_srv = cl_bsp_wd_message_service=>get_instance( ).

           lr_message_srv->add_message( iv_msg_type   = 'E'

                                        iv_msg_id     = 'ZDEV'

                                        iv_msg_number = '999'

                                        iv_msg_v1     = text-002 ).

EXIT.

Thanks,

Sanjana SAP.

Former Member
0 Kudos

Hi Sanjana

Most likely the Status Profile is configured such that the status cannot be lowered beyond "Approved" once "Closed" is reached.

I do not believe you can code around this. Instead adjust the configuration such that the values can be lowered to those that you require.

Then as per your other comment, you will need to adjust (via code) the visibility (filter) of those Status's which you do not want the users to have access to.

Hope this helps

Regards

Arden

Answers (0)