cancel
Showing results for 
Search instead for 
Did you mean: 

Change user status of CRM Order

Former Member
0 Kudos

Hello,

I need to change programmatically the user status of an Urgent Correction. I tried several FMs, like CRM_STATUS_MAINTAIN_OW, but it kept giving me the message "Status 'E0009' cannot be set".

I managed to do what I want by directly manipulating table CRM_JEST, but I'd much rather manage to use a standard FM, because I don't know if using table CRM_JEST is safe / is enough.

So can someone tell me what FM I should use, or how I the FM I tried should be used ?

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

do not change the status via order_maintain etc. in change management! No ChaRM actions or conditions will be performed!

Use report CRM_SOCM_SERVICE_REPORT (in your code via SUBMIT....) or create your own program to change the status and do it the same way the report CRM_SOCM_SERVICE_REPORT does it.

regards

Andreas

Former Member
0 Kudos

Hello,

The only problem with this report is that it only move a CRM order to the next status, and what I need is to move to a status further in the list (skipping the status in between).

Former Member
0 Kudos

Hey Thomas,

This should solve your problem..

CALL FUNCTION 'CRM_STATUS_CHANGE_EXTERN'

EXPORTING

client = sy-mandt

objnr = wa_new_user_status-guid

user_status = wa_new_user_status-status

no_check = 'X'

  • SET_INACT = ' '

  • SET_CHGKZ =

  • XNOAUTO =

EXCEPTIONS

object_not_found = 1

status_inconsistent = 2

status_not_allowed = 3

OTHERS = 4.

In this FM NO_CHECK parmeter must be set to True, else u wil not be able to set the Status.....

Sample is given above...

Reward points for usefull answer...

Regards,

Anand...

Former Member
0 Kudos

Hello Anand,

I had already tried that FM, but although I don't receive any "Status not allowed" message when I put the NO_CHECK parameter to true, the FM does not do anything.

The status is not change in my urgent correction. The FM send back the exporting parameter STONR with value 60, but I don't have any idea of what that means.

Thanks,

Thomas

Former Member
0 Kudos

Hey Thomas,

I believe you are trying to set this status in the Program ..

Now within this prog u cal the function module and then follow it up with " COMMIT WORK" Statement...

This should work..

Reward for usefull answer..

Regards,

Anand

Former Member
0 Kudos

Silly me, I did not think of that. It works quite well with a simple COMMIT WORK right behind it.

Thanks a lot, you sure deserved some points.

Former Member
0 Kudos

That certainly does the trick Anand. I appreciate your timely response,

Answers (2)

Answers (2)

Former Member
0 Kudos

Hey Thomas,

Try using this FM....

CRM_STATUS_CHANGE_EXTERN

This will definately solve your problem...

Reward for useful post..

Regards,

Anand..

Former Member
0 Kudos

Thanks for your response Anand. It didn't solve our problem. The way i understand it, these status can only be changed via the business transactions but not programatically. I maybe wrong but at this time i don't have enough information to think otherwise

Former Member
0 Kudos

Hey Swami,

These statues can also be changed programatically...

I have done it successfully many times myself....

If the obove FM does not work well with you...

Go for FM CRM_ORDER_MAINTAIN followed by CRM_ORDER_SAVE

Reward for usefull answer..

Regards,

Anand Rangarajan

Former Member
0 Kudos

Hello both,

The way I managed to change this status is very messy, involving manually handling of some tables that are behind all that.

So I will not give that code unless we really don't find any other (cleaner) way. I will try these various FMs, although the first one I have already tried in the past without success.

Best regards,

Thomas

Former Member
0 Kudos

Hello Anand,

I have taken a look at FM CRM_ORDER_MAINTAIN, and I must admit I'm a little lost. It's quite complex, and I can't see how it must be used.

Could you give some example of its usage ?

Thanks in advance,

Thomas

0 Kudos

Hello,

you already tried the Utility Report for Change Transactions (Change Request Management) CRM_SOCM_SERVICE_REPORT?

Best regards

Thomas Hiesener

Former Member
0 Kudos

Thanks, I will try that, I did not know this report.

Former Member
0 Kudos

Thomas,

I have the same requirements as you to change the status programatically instead of running the utility report. Were you able to resolve your issue ? If so, can you share your thoughts and experience ?

Thanks,

Swami