cancel
Showing results for 
Search instead for 
Did you mean: 

Update Opportunity Status: CRM_STATUS_MAINTAIN_OW

Former Member
0 Kudos

Did any one use this fm to update the Status field of an Opportunity in CRM ? If yes, could you help me please. Is this the right function module? I tried to run a test in se37, but I cannot put in any value in the import parameter? Can you help? I have only value of the GUI of an Opportunity and its status. Where do I put these values based on the import structure below:

Import parameters:

IT_STATUS_COM

IT_STATUS_COMINT

IV_CHECK_ONLY

IV_TRACE

IV_NO_1O_MAINTAIN

Changing parameters:

CT_INPUT_FIELD_NAMES

Jennifer.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Jennifer,

I think for your requorement the simplest FM would be "CRM_ORDER_CHANGE_STATUS". Inside the function module you have to pass the following:

Import parameters:

-


1. GUID of the opportunity to IV_REF_GUID

2. Target Status code to IV_STATUS

3. Value 'X' to IV_ACTIVATE

That is all you have to do to update the status in the opportunity transaction.

Sample Code:

CALL FUNCTION 'CRM_ORDER_CHANGE_STATUS'

EXPORTING

IV_REF_GUID = IS_HEADER_GUID

IV_STATUS = 'E0002'

IV_ACTIVATE = LC_X

EXCEPTIONS

PARAMETER_ERROR = 1

NOT_ALLOWED = 2

ERROR_OCCURRED = 3

OTHERS = 4.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Let me know if this helps!

Jash.

Former Member
0 Kudos

Hi Jennifer,

Other way of status update can be done using FM CRM_ORDER_MAINTAIN. Insert a break point in this FM, goto oppurtunity and manually change status and you can see how interface tables are populated in CRM_ORDER_MAINTAIN.

Thanks

Kamal

Former Member
0 Kudos

Hi Kamal,

Thank you. I will try it out.

Jennifer.

Former Member
0 Kudos

Hi Jennifer,

The easier way to set the status is to use:

1. FM CRM_STATUS_CHANGE_EXTERN_OW if you want to change user status

2. Fm CRM_STATUS_SET_INTERN_OW if you want to change system status.

Pass GUID in parameter objnr

However, both of them internally call CRM_STATUS_MAINTAIN_OW.

And one more thing: you wónt be able to change status from SE37 as this requires transaction commit.

Regards

Kaushal

Former Member
0 Kudos

Hi Kaushal,

I need to update the status of an Opportunity in CRM. Is that consider User or System status? I call this function module within a BAdi to validate the business requirements.

Jennifer.

Former Member
0 Kudos

Hi Jennifer,

We generally deal with user status.

I bet it should be user status.

Regards

Kaushal