cancel
Showing results for 
Search instead for 
Did you mean: 

Refresh Business Object

Former Member
0 Kudos

Hi,

I am currently working in CHARM in solman. I am developing a work flow for it. I use the BO BUS2000116. I use the transactions CRMD_ORDER and CRM_DNO_MONITOR . I trigger mail when the user status changes in the BO. The status when changed in the transactions take some time (2 to 5 min) to reflect it in BO. Can any one suggest me the way to solve this...the status changes should reflect the BO immediately.....

Is there any way in work flow that i can refresh BO so that the status changes reflect the in the BO sooner...Please help me to solve this...........

Thank you.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello,

I see you are using CRM's transactions, so part of its functionality should be in your system.

Because this BO does not have an event like StatusChanged, I usually use BADI implementation inside CRM

to start workflow, like execute new event. I usually work with order_save or CRM_ORDER_STATUS badis (tcode se18).

They are executed immediately when saving document and changing document's status. This way there are no time lags

between change on document and workflow start.

Please check if they exist in SOLMAN too.

Regards

Radek

Former Member
0 Kudos

Hi stefaniak,

Thank you very much for your reply,

Actually you r speaking about the triggering the event of the BO....But my doubt is about the attribuite(user status) in the BO doesn't get changed immediately when the actually status(in the transaction CRMD_DNO_MONITOR) gets changed. There is a time delay for the status to get reflected in the BO. I use the wait for condition step in my work flow.So the condition to get satisfied has a time delay...this is my problem...i need to know whether is there any method r way to solve this...that is reduce the time that the BO takes .......

Thank you.....

Former Member
0 Kudos

HI

I no nothing about refreshing BOs

but when your workflow has started, and you are sure than that status has changed, you can add task

for reading current status of document using FM crm_order_read (hope this is also available in solman, it reads values from system buffer, not from DB). then you should have proper value of status.

Regards

Radek

former_member185167
Active Contributor
0 Kudos

Hello,

Try putting in a dummy wait step of 1 minute in the workflow. That is, a step that calls a task that calls a method that does nothing. Put a 1-minute requested start deadline on it.

In saying this I'm assuming that the BO is updated immediately, but not in the workflow.

regards

Rick Bakker

Hanabi Technology

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

You could also try to create a static method "RefreshObject" into your object. In this method you could just create /instantiate the object:

DATA <Object> TYPE SWC_OBJECT.

SWC_CREATE_OBJECT <Object> <ObjectType> <ObjectKey>.

Then return the object from this method to the task and finally to the WF container. This would refresh your object. You could try to use this instead of the dummy method that Rick mentioned.

Regards,

Karri

former_member185167
Active Contributor
0 Kudos

Thanks Karri, I'll try that too! I'd love to be rid of those wait steps. Do you use that a lot?

Former Member
0 Kudos

I tried it once, but I used it to refresh an ABAP class object. I assume the same concept works with BOs too.

I finally didn't use the solution, becase it didn't fix my initial problem.

The beauty of this solution (when using ABAP class) might be that you don't even need to create a separate step, because you could use a functional method and then use that in a container operation to get the refreshed object into the workflow container. Anyhow, I am not sure whether this works, but I don't see a reason why it wouldn't.

Regards,

Karri

Former Member
0 Kudos

Hi Kemmpi,

Your answer was helpful.

But i am using abap class in work flow... so that i am not able to create a class method as u mentioned but i couldnt do that ...

so please help me out with this '

regards.

Kevein.

Former Member
0 Kudos

Hi,

Well, in your first post you said that you have a BO...

Now I don't know the details of your problem. I suppose you need to refresh a status or something? And then perhaps you have a branch in your workflow depending on the status?

You could create a functional method (dependin on the system level). Read Jocelyn Dart's blog about functional methods for reference. In this method you could just get the new status from database, and then return it from the method. Then you can use this updated status in your workflow for example in a container operation or branch or whatever similarly to an attribute of a class.

Or maybe not so elegant solution would be just to create a method, which would create the object again (CREATE object) and then return this to the workflow. You didn't tell if you have your own custom class or a standard one? If it is a standard, then this all will be a bit different story since you cannot add your own methods to the class.

Regards,

Karri

Former Member
0 Kudos

hi kemppi,

Let me explain u what i am trying to do...

I am using a customized class in the work flow....... I am now using a fork step(1/2) in work flow...i one of its branch i have a wait for event step & that is a standard event ....so no problem in it... in other branch i have a wait for condition step in that i have given a condition(like &BUS2000116.User Status&=E0004SDCRHEAD)...here the user status gets updated when ever there is change in the t-code - 'CRMD_DNO_MONITOR' ...so i have developed my work flow based on the user status changes using the fork step....my problem now is when ever the status is changed in the t-code it takes some 2-5min to reflect in the BO and then the work flow continues...this makes my work flow to be slower ...so i need a solution to solve this....sorry for making u confused...now r u clear .........

Regards.

Kevin

Former Member
0 Kudos

OK. Now this is a completely different story. You have a "wait for condition" step. Did you know that there is a batch job running every 3 minutes or so that takes care of checking the conditions. So the problem most likely is not in the object and its refresh, but the fact that the conditions are not checked all the time.

Your solutions will not work, and you need to change it somehow, if it is now based on the assumption that the conditions will work in the same way as wait for event -steps. For example you could try to trigger an event from a customer-exit or whatever. But you will most likely have the best idea, since you know understand what is causing this problem.

Regards,

Karri

Former Member
0 Kudos

hi kemppi,

I dont know about the job running every 3 minutes for checking the conditions. I dont have any custom event to trigger its all in standard...and in that u dont have any event triggered for the status change....so now i am totally lost....i dont know what to do.....how could i use the status change in my work flow and send mails according to that status change....i.e., i need ur help to frame out some logic in work flow to proceed further...help me....

regards,

Kevin.

Former Member
0 Kudos

Why is it a problem that the email is getting sent after few minutes and not immediately?

I don't know CHARM, so I cannot help you. If you really need to react to the status change immediately, you need to probably try to find user-exits/badis or whatever or consider doing en enhancement. (And you are sure that there is no event triggered when the status is changed - you have confirmed this with SWEL?)

Regards,

Karri

Former Member
0 Kudos

hi,

yes i am sure that there are no events that are triggered when the status changes,... yes it is a big issue now, the mail getting delayed....the problem is the ticket (in CRMD_DNO_MONITOR) reaches the next user(change manager) before the mail reaches him... so i should send the mail before the ticket reaches him...it should be like the change manager should get the information from mail and then process the ticket....

regards.

Kevin

Former Member
0 Kudos

So, the change manager is checking his inbox all the time? And it might be an issue, if he sees the work item before the email? Even if everything would work as planned, there would be "danger" that the manager does not see the email (Outlook is closed, etc.) but he sees the work item. Aren't they confused then?

You can of course delay the delivery of the work item to the manger. Put the same wait for condition step before the manager's step, and then he will not see the work item before he gets the email.

As I said, check for enhancement options. This is something that cannot really be solved with workflow (at least not with the wait for condition solution). Wait for conditions are not perfect since they they don't work immediately. Of course you can build some advanced custom stuff. For example you can evaluate the condition job that is scheduled and check if you could evaluate the single workflow instance's conditions separately.

Regards,

Karri

Former Member
0 Kudos

hi Karri,

Thanks for the support you gave me...

Let me try something and let u know what i have done........

Regards,

Kevin.

Former Member
0 Kudos

Hi,

You could try to check if you can use change documents. It is possible to trigger events from change documents (=the object gets changed). This is a not-so-well known workflow functionality, but you should get the idea by doing some searches here in SDN & SAP Help. It might be that this is not helpful, but worth to check.

Regards,

Karri

Former Member
0 Kudos

Hi,

i'm facing the same problem, in charm workflow, can u explain me wat u did for this issue,

Regards,

thiru. R

Former Member
0 Kudos

hi Thiru,

I am trying to solve this with the help of function module CRM_STATUS_READ_OW .....May i know what have u done .....have u delegated the BO bus2000116....i tried it but it throws me a error 'Select a valid delegation type' ... so that only i went on with the status changes...if i can delegate i can create custom events and trigger it and my problem will be solved...can u let me know what u have done in charm work flow,....

Thanks & Regards,

Kevin

Former Member
0 Kudos

Hi,

So, you have problem with delegation? Just describe step by step what you are doing and when you get the error, and most probably this poblem can be solved easily. Delegation is a standard workflow/BO functionality, so it should definately work if done correctly.

Regards,

Karri

Former Member
0 Kudos

Hi Karri,

As i told earlier i am using BUS2000116. And if i select delegate it shows object type as 'HOLIDAYCAL' , person responsible as 'SAP' and delegation type as 'SB_TEST3' which is a different BO. So what should i do now....

Thanks & Regards,

Kevin

goelcyrus
Explorer
0 Kudos

Kevi,

What karri said is the way that you have to do, but let me explain little eloborately what to do.

Create a Subtype of your BO and create a new event(custom) .

Find the badi respectively for your process.

Call the workflow thru the wapi

inlcude this customised event into that wapi.

your workflow will start from this point whenever there is a status change.

If u want to trigger the workflow whenever there is a status change , check whether that badi is having Filter attributes, u can define the user statues here in the filter for whatever statuses you want the workflow to be triggered.

when you define filter values the badi will work when reaching the statues what you maintained.

so you design your workflow with a multiple condition checking the current status to decide sending the mail for each respective present status.

the stumbling block is the BO will get delay in updating and that will again delayed in updating the wf container while checking the present status in the condition level.

to avoid this u can use of the solution given in this thread, either a dummy method with requested start .

or with a custom method in the BO to read the status from the crmd_order_read.

all the best.