cancel
Showing results for 
Search instead for 
Did you mean: 

--URGENT help--Event not getting triggerd from custom class

former_member1360394
Participant
0 Kudos

Hello guys,

Event is not triggering the workflow.

Event is created from the custom class as there is no standard BO available.

When I check the event in SWUE, event is getting triggered and trace is coming.

I have checked in SWE2 and the linkage is active.

I have used COND_B as object type and created a custom FM for event container.

Can you kindly let me know if i'm missing anything.

Regards,

Vinod

Accepted Solutions (1)

Accepted Solutions (1)

I042439
Employee
Employee
0 Kudos

Hi Vinod

"I have used COND_B as object type and created a custom FM for event container"

Where is that Custom FM called in the VB21 Save process?And what is the coding of that FM?

regards,

Modak

former_member1360394
Participant
0 Kudos

Hello Modak,

Can you kindly let me know where in VB21 the code should be written as there is no badi or exit is available. Can you kindly check and let me know the code to be written for it. Please I need it as its a urgent requirement.

Regards,

Vinod

I042439
Employee
Employee
0 Kudos

Hi Vinod

First of all....why would the event trigger if you have not plugged it in! This is your main issue!

Now coming to VB21 and finding the right place would take me the same time as it would take you .... I am sorry, but I am no expert of VB21 (or even a beginner, so to speak). It would be a hard job to debug and find a right implicit enhancement and unfortunately, neither do I have the config for VB21 in my available systems and nor the time currently.

One basic question, when you save from VB21, is there any standard event triggered? Any? Which can be used as a start event of your workflow?

You can also look for any change documents if associated with VB21 key to see if you can trigger event from SWEC ( check SAP Workflow transaction SWEC - Trigger workflow on change document  or http://www.saptechnical.com/Tutorials/Workflow/Events/ChangeDocument.htm )

I see that the Sales Deal is of type KNUMA_AG ... this data element has change doc activated. You can find the change doc object for this and use SWEC to trigger your event.

Regards,

Modak

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi Vinod ,

It seems your event is getting triggered , but problem iswhen workflow connects with ABAP engine using RFCs . Check SM50 tcode to see the running RFC status  .

Please mark thread as Answered if your problem has been resolved already .

Thanks ,

Ashish Gaur

former_member212124
Active Participant
0 Kudos

Have you checked on top of the screen in application tool bar.

former_member1360394
Participant
0 Kudos

Hello Guys,

Please answer me immediately as its a urgent requirement.

Regards,

Vinod

former_member212124
Active Participant
0 Kudos

Please check these.

ARC_SD_COND_CHECK        -Archiving Object SD_COND: Additional Checks 

ARC_SD_COND_WRITE         -Archiving Object SD_COND: Archive Additional Data

CACS_COND_VERSIONING   -Condition Technique: Version Management for CACS

SD_BONUS_CREDIT_NOTE   -BAdI for Rebate Credit Memo Requirements (SD)

SD_COND_DETAIL                -Enhancement in Condition Detail Screen

SD_COND_SAVE_A              - Save condition application A, E

former_member1360394
Participant
0 Kudos

Hello Vidyasagar,

I had implemented the SD_COND_SAVE_A badi but still the event was not triggered.

Can you kindly let me know the code to be written in that BADI?

Thank you.

Regards,

Vinod

former_member212124
Active Participant
0 Kudos

Refer following example code:

   

DATA:object_type       TYPE  swr_struct-object_typ,

           object_key        TYPE  swr_struct-object_key,

            event               TYPE  swr_struct-event,

           return_code      TYPE  sy-subrc,

          message_lines   TYPE STANDARD TABLE OF  swr_messag,

        message_struct   TYPE STANDARD TABLE OF  swr_mstruc.

      object_type  = 'BUS2000116'."your business object

      event           = 'CATPR'."you event name

      object_key   = iv_guid."object key here to your custom business object

    

CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'

        EXPORTING

          object_type    = object_type

          object_key     = object_key

          event          = event

          commit_work    = 'X'

        IMPORTING

          return_code    = return_code

        TABLES

          message_lines  = message_lines

          message_struct = message_struct.

former_member1360394
Participant
0 Kudos

Hello Vidyasagar,

Thank you for the code.

Since it is a custom class and event.

Can you kindly let me know the code for this thinking as below:

Class: z_sales_deal

event : created

Regards,

Vinod

former_member212124
Active Participant
0 Kudos

Hi,

Please refer this link.

It will definitely help.

http://scn.sap.com/docs/DOC-25262

thanks,

vidyasagar

paul_bakker2
Active Contributor
0 Kudos

Hi,

  

You can use fm SAP_WAPI_CREATE_EVENT_EXTENDED to raise class-based events.

By the way, you should not keep saying that your requirement is URGENT. I'm sorry, but it is not urgent for people who are volunteering their time to help you.

Also:

"Can you kindly let me know where in VB21 the code should be written as there is no badi or exit is available. Can you kindly check and let me know the code to be written for it"

Would you like fries with that?

We are here to help you overcome workflow issues, so that hopefully you (and we) can learn something. No problem with that. But we are NOT here to do your job for you.

cheers

Paul

former_member1360394
Participant
0 Kudos

Hello Paul,

Thank you for your advice.

Sorry for asking too many questions.

I understand its not urgent for the people helping me out. Sorry for pushing you.

I have written the code given by Vidyasagar using classes.

Now I can see the event getting triggered in the Event trace, but the workflow tasks are not getting triggered after that.

Can you kindly guide me.

Regards,

Vinod

former_member212124
Active Participant
0 Kudos

Hi vinod,

1) Please run 'activity steps' individually and check(if possible).

for example if an activity is involved with an FM then, run that FM individually and check its working.

2) And check binding 'event container' to 'workflow container' (check all mandatoy values are passed).

3) check binding of all steps( where binding is involved).

thanks,

vidyasagar

paul_bakker2
Active Contributor
0 Kudos

Hi,

There is no problem with asking lots of questions. Ask away!

So now the event is being raised, which is great.

Let's go back to the beginning of the discussion- what do you see in SWEL when the event is raised.

A green light or a red light?

If it's red, what is the error message?

cheers

Paul

former_member1360394
Participant
0 Kudos

Hello Paul,

Thank you Paul.

Its a green light and no error message in it.

@Vidyasagar,

I checked the settings and binding and all are fine.

Regards,

Vinod

paul_bakker2
Active Contributor
0 Kudos

If it's a green light then you should be able to click through to the workflow and view the log.

What happens when you do that?

former_member1360394
Participant
0 Kudos

Hello Paul,

The following message is displayed in the log:

"Receiver started correctly".

Nothing else is displayed. 😞

Regards,

Vinod

Former Member
0 Kudos

Hi Vinod,

Make your workflow as generl task, if it is not working please share your workflow template.

Regards,

Jeena George

former_member1360394
Participant
0 Kudos

Hello Jeena,

I have made it as general task but still not working.

To share a workflow template is difficult.

First task of the workflow is getting some values and sending it in a mail.

Regards,

Vinod

paul_bakker2
Active Contributor
0 Kudos

Hi,

At the top of that screen where it says 'Receiver started Correctly', is there a 'View Work Item' button? If so, click it.

If not, check ST22 for a dump (around the same time as when the event was created). If the first step of a workflow fails, then often no log is created.

cheers

Paul

paul_bakker2
Active Contributor
0 Kudos

FYI - workflows that are started by events do not need to be set to 'General Task'.

cheers

Paul


former_member1360394
Participant
0 Kudos

Hello Paul,

Sorry for the delay in reply as I was not feeling well.

I see there is no View work item button and also there is no dump. 😞

Not able to get why it is not triggering it?

Please guide me.

Regards,

Vinod

I042439
Employee
Employee
0 Kudos

Hi Vinod

At the end of that screen - do we see "System Overloaded, repeat immediately by batch"

Regards,

Modak

paul_bakker2
Active Contributor
0 Kudos

So it has a green light, no 'display workitem' button ,and no error messages that you can see?

Time for a screenshot, Vinod!

cheers

Paul

former_member1360394
Participant
0 Kudos

Hello Paul,

Kindly find the screen-shot attached.

Regards,

Vinod

I042439
Employee
Employee
0 Kudos

Hi Vinod

read the last line - The Running Application consciously caused an abort

Again, check ST22 around the time 20.08.2014 - 12:11:35 UTC

Also check if there are any RFC errors in SM58 / SMQA

Check SWU3 -> execute "Configure RFC Dest" and see what you get.

regards,
Modak

paul_bakker2
Active Contributor
0 Kudos

Hi,

Thanks for the screenshot. You honestly didn't notice the word 'abort' at the bottom of the screen....?

cheers

Paul

former_member1360394
Participant
0 Kudos

Hello Paul and Modak,

Oops I didn't see that sentence..  There is no dump also.. Kindly let me know what should be done in this scenario...

paul_bakker2
Active Contributor
0 Kudos

Vinod,

I've never seen this message before...

But there may be a SAP Note to fix this. How do I know? I googled it!

cheers

Paul

former_member185167
Active Contributor
0 Kudos

Hello,

Any update on this? Please mark thread as Answered if your problem has been resolved.

regards

Rick Bakker

former_member212124
Active Participant
0 Kudos

Hi Vinod,

1) Have you linked the event to your workflow properly in basic data?

2) Did you activate the linkage of event in basic data?

3) Did you activate your workflow properly?

4) Have you checked the configurations(SWU3)?

Please confirm all above things are done properly and then try.

This will work.

thanks,

vidyasagar

former_member1360394
Participant
0 Kudos

Hello Vidyasagar,

Everything is fine but still its not working.. 😞

Regards,

Vinod

anjan_paul
Active Contributor
0 Kudos

Hi,

  Share your trace screenshot

former_member212124
Active Participant
0 Kudos

Oh your event is not getting triggred!!

then as it is custom class you have to trigger event using SAP_WAPI_CREATE_EVENT  FM.

So write a program to trigger an event by calling the above FM in it.

If you are willing to trigger event in Standard transaction or something like that then, check for a BADI or Customer Exit which can be used in that transaction.

thanks,

vidyasagar

former_member1360394
Participant
0 Kudos

Hello Vidyasagar,

Thank you for the reply.

But there is no exit or badi written for VB21.

Can you kindly check and let me know where and sample of the code to be written for the event creation.

It would be great help.

There is a BADI SD_COND_SAVE_A which is triggered during the save of VB21.

I had implemented this BADI and had called the event, but still it didnt work.

Regards,

Vinod

former_member212124
Active Participant
0 Kudos

Can you share your code

paul_bakker2
Active Contributor
0 Kudos

So it's URGENT? I'll type quickly then

When you simulate the event through SWUE, does the workflow trigger?

When you run your normal transaction, did you check SWEL to see if the event is raised? If yes,

does it have a green light?

If it fails, does your event have any mandatory parameters?

cheers

Paul

former_member1360394
Participant
0 Kudos

Hello Paul,

Thank you for typing quickly.. 🙂

when I simulate in SWUE, the workflow is triggered and also the trace is there.

It has green light. Mandatory parameter is there but i'm passing through the FM attached to the object type COND_B. This workflow should be triggered when VB21 is saved.

Am I missing anything here Paul?

Regards,

Vinod

paul_bakker2
Active Contributor
0 Kudos

What does the trace say when it doesn't work?

former_member1360394
Participant
0 Kudos

Paul,

When it is used with VB21, the event is not triggered and there is no trace. 😞

Regards,

Vinod

paul_bakker2
Active Contributor
0 Kudos

Ah, but you said:

"Event is not triggering the workflow."

That's not the problem at all. The event is not being created.

This is a custom development.. so why not just put a breakpoint where you call SAP_WAPI_CREATE_EVENT?

cheers

Paul

former_member1360394
Participant
0 Kudos

Hello Paul,

Where this SAP_WAPI_CREATE_EVENT needs to be written?

I have written a FM to fill in the event container.

Please guide me.

Regards,

Vinod

anjan_paul
Active Contributor
0 Kudos


Hi,

  Where you wrote FM to trigger event container. Is that FM trigger durin VB21.

  check and Share your screenshot.

former_member1360394
Participant
0 Kudos

Hello Anjan,

This FM is written at the place where the object type is used.

I have abap class to that object type and there the event container FM is written.

Regards,

Vinod