cancel
Showing results for 
Search instead for 
Did you mean: 

Wage type record delete workflow

Former Member
0 Kudos

Hi All,

I'm new here with an issue. The issue is :

I use the business object RECURRPAY --> DELETED event in the workflow and it's causing an error stating:

"Workflow XXXX set to status ERROR".

*Please repair the suspended workflow

....Press 'Execute' to display the workflow that has errors.*

Here I am trying to delete an wagetype from PA30 and to trigger my workflow using this event, I also need to pass values from the deleting record to my task. is this causing issue?

Can any one through some light on my issue please.

thanks in advance.

Susan

Edited by: Susan George on May 16, 2008 5:57 AM

Edited by: Susan George on May 16, 2008 6:01 AM

Accepted Solutions (1)

Accepted Solutions (1)

martin_nooteboom
Active Contributor
0 Kudos

Hi Susan,

You will need to pass the values of the deleted record to new fields. The problem is that because the record is deleted the BOR RECURRPAY has no longer an instance. So you will need to use a different BOR (BUS1065 for instance) and make sure you get the values of the deleted record in your container. You will need to pass them from the event to the workflow. So you need these as import parameters in the workflow.

Do you use a FM in SWEHR3 to raise the event? Because if you do, you will have the old record in the FM and can pass the values to the workflow.

Regards,

Martin

Former Member
0 Kudos

Hello Martin,

Thank you very much for your reply.

1) From the W/F event I already pass BUS1065 to the W/F. But using this BOR how will we able to get the deleted wagetype record values..?

2). In SWEHR3 if we raise a DEL event for RECURRPAY by the FM HR_EVENT_RULES_PA0014, will I be getting the Deleted record values in W/F.

Thanks,

SG.

martin_nooteboom
Active Contributor
0 Kudos

Hi Susan,

I think you will need to use SWEHR3 to raise the event. You set it up for DEL of RECURRPAY, but you need to raise an event for BUS1065 in the FM. You should create extra import parameters for the old data of IT0014 and pass them through the event container. You could use SAP_WAPI_CREATE_EVENT to raise the event.

I never did this, but this is the only way I see how you could get the old data in your workflow. Otherwise it will not be available.

Regards,

Martin

Former Member
0 Kudos

Hello Martin,

I feel I am some where near to the shore...:)

Now I am able to create my own rule FM similar to HR_EVENT_RULES_PA0014 and trigger for DEL.

Here for this FM, I have only one default export parameter as EVENT to pass that to workflow. If I change this event to CREATED/CHANGED, my W/F is triggering with those events.

Also here in this FM, I am getting the old record in BEFORE_IMAGE. Will i be able to pass the values from before_image to my workflow and process, without creating a new event using SAP_WAPI_CREATE_EVENT. If not can you please help me creating event with my old values using SAP_WAPI_CREATE_EVENT.

thanks in advance,

SG

martin_nooteboom
Active Contributor
0 Kudos

Hi Susan,

I think you will need to create an event for a different BOR. Because the instance for RECURRPAY doesn't exist anymore. That's why you would need to use SAP_WAPI_CREATE_EVENT. With this FM you are also able to fill your event container which would enable you to pass the old values of the infotype. So in your workflow you will need to define container elements as import so you could bind the values from the event container. Also you will need to create parameters for your event so you create the binding in the event.

Regards,

Martin

Former Member
0 Kudos

Hi Martin,

Again creating a new event with the FM seems to be feasible as I cannot pass the deleting BUS RECURRPAY object details to the new item.

Another alternative i tried is to trigger an email with the deleted values(this is my objective) from the rule itself, call a new custom FM.

But the problem here is, if I execute this new FM directly the email is triggering using SO_NEW_DOCUMENT_ATT_SEND_API1, but when I delete the record and process throught PA30 it is not.

Both the cases the FM SO_NEW_DOCUMENT_ATT_SEND_API1 is returning 0 as. Second case, the mail is not created in SOST. This seems to be suprising for me.

Will you be able to through some light here for me please.

Thanks,

SG.

martin_nooteboom
Active Contributor
0 Kudos

Hi Susan,

How do you call the FM? Do you set the parameter commit_work? If all the parameters are the same in test as when you call it in the check FM the result should be the same.

But I am still curious what problem you encounter when you try to raise an event for BUS1065 with SAP_WAPI_CREATE_EVENT in the FM in SWEHR3. I couldn't test it, but I think it should work.

Regards,

Martin

Former Member
0 Kudos

Hi Martin,

I do have the commit_work set as 'X'. This same code works perfectly in my custom program where as not in SWEHR3.

In my W/F i have three import parameters as,

1) initiator--> which can be set from SWEHR3

2) BUS BUS1065--> Confused how to set all the values from SWEHR3.

3) BUS RECURRPAY--> Though I have the values from Before_image, just confused how to set all the values from SWEHR3 to the SAP_WAPI_CREATE_EVENT function module and trigger my W/F. Feel totaly lost.... Any hope

Thanks,

SG.

martin_nooteboom
Active Contributor
0 Kudos

Hi Susan,

You don't need to set all the values of BUS1065, you only need to give the key when you use SAP_WAPI_CREATE_EVENT. Then there is an input container where you could set other event parameters. Point is you need to create extra import parameters for your event which you set using the container of SAP_WAPI_CREATE_EVENT. Then you create the container elements in your workflow mark them as import and bind them to the event container elements. This way you can pass the old values of the infotype to your workflow.

Regards,

Martin

Former Member
0 Kudos

Thanks Martin,

Your guidence really worked out..

Warm Regards,

SG

Answers (0)