cancel
Showing results for 
Search instead for 
Did you mean: 

RE - Getting the User status in ChaRM

Former Member
0 Kudos

Hello SOLMAN Gurus,

We are implementing SOLMAN ChaRM and we have requirement to send email to the corresponding business partner assigned to the already defined status whenever a change happens in the change request document. I am using BADI ORDER_SAVE for this implementation. Inside this BADI, I am getting the existing status of the object using function module CRM_ORDER_READ. Now I need to compare the status changed(entered) by the user in the screen against the one lying in the database (which I get through CRM_ORDER_READ) and if there is any difference I'll have to send email. My problem is how to get the current status changed(entered) in the screen by the user. Is there any function module or any other way to achieve this.

Kindly please help me.

Thanks.

Regards,

Pan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Pan,

An easier way to do this is to work with Action Profiles.

Here you can define conditions when the mail needs to be send and to which Business Partner.

Actions can be defined through TA SPPFCADM. You can start from an existing SAP action or there also exists a SAP Tutor concerning this topic.

Roel

Answers (2)

Answers (2)

0 Kudos

Hello Pam,

Actually I´m searching for a similar information. I still haven´t found what I looking for, but I believe I found what you need.

There are two tables that, combined, have the information you´re asking for. The first one is CRMD_ORDERADM_H, wich stores the header of the SM documents. There you can search the document number (OBJECT_ID) and will find a lot of useful information. Then get the GUID, that is the internal key for documents in SM. After that, search this GUID in table CRM_JCDS, that stores the statuses of documents. If you want only user statuses, filter the STAT field with E*.

Notice the INACT field: it says that this status is inactive. If you order you search by date and time will find the last status.

There are two useful function modules that do this work for you. One is CRM_LEAD_GET_CHANGEDOCUMENTS. Here you can search the document number OR the GUID, but will need the object type (BUS* - see table CRMD_ORDERADM_H to get the ones your system uses). This function module will return all statuses. The other function module is CRM_STATUS_READ_OW, that returns the current system (I) and user (E) statuses. The key is GUID.

And one more (useful) table: TJ30T, that stores all possible user statuses. Good to quickly find out what a code E* means.

Hope this helps.

If you (or another reader here) a way to quickly get the last status of every document in SM (maybe filtering by status, for example) I´d appreciate. I can create some queries using the above tables, but the performance would decrease with the time.

Kind Regards,

Cristiano Canzone

Former Member
0 Kudos

Hi Roel,

Thanks for your input. Actually we are using ITS and providing the user with the transaction document link which will be sent to the user's outlook inbox. And moreover we might have to send email's to multiple users. That is the reason why we chose to go with custom email functionality development.

Going back to my question, could you please advise me of a way to get the status entered by the user in the screen. For example if the user changes the status from E0001 to E0002, I can the fetch the already saved status from the database table (CRM_JEST) and will have to compare that against the user entered status (E0002 in our case). Basically I need to read the user input status. Please help me with this.

Thanks.

Regards,

Pan