Skip to Content
-1

question on workflow custom events

Aug 08, 2017 at 11:32 AM

146

avatar image

hi,

we have a custom event for MIR4 ( Invoice doc approval ) workflow actually the issue is for one country the invoice amount is coming correct and for other country its coming incorrect. I checked the header part of the work flow and its actually coming as the input parameter in binding on the event container.

from the event container its coming to workflow container. can you please suggest where can I check the event is called and where the event containerrs are filled.

thanks

rg

10 |10000 characters needed characters left characters exceeded

What do you mean by

" for one country the invoice amount is coming correct and for other country its coming incorrect "

I mean could this be for different currencies? may be the container is not passing the currency key with the amount??

I don't know about this workflow but have seen similar issue in Reports where if you ignore the currency key, the amount got displayed different from original.

0
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Egor Malov Aug 08, 2017 at 01:03 PM
0

Hi Ramya,

you can use Event trace https://help.sap.com/viewer/a602ff71a47c441bb3000504ec938fea/7.31.20/en-US/4f27d1cac5f75887e10000000a42189b.html to find out, where particular events come from. Transactions SWELS and SWEL.

If you do it in production, make sure to turn it off after your experiments - event trace should not be on all the time for performance reasons.

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi Egor,

thanks for ur reply . I cannot check the event trace in production as there is no trace activated.

I want to know how the custom event containers are filled for MIR4 when the Invoice documents are craeted and where excatly are the event containers filled.

thanks,

rg

0

Ramya,

I agree with Mike - some detective work is needed) some ideas:

  • if trace is impossible in production, maybe you can get it working in development system? from event trace you can see, what program created the event. this might help
  • from workflow log you can define when the event in question was created. You could analyse users activity in application logs for this short period of time (transaction SLG1). If you find out, what user action causes the event, it can help in finding the event-firing piece of code
  • there are few ways to create events programmatically ( FM SWE_EVENT_CREATE is most likely). you can scan your Z code (if it is under suspicion) for uses of this FM (transaction CODE_SCANNER). Also structure SWCONT is likely to be used to pass container values when firing an event.
0
Mike Pokraka Aug 08, 2017 at 03:48 PM
0

There is no link, this is by design. A trace also won't provide any information on how the event was raised.

You will have to do good old fashioned detective work:

It is unlikely to be any of the standard SAP event mechanisms as those wouldn't give you a wrong invoice amount. So code is the most likely. You already know it's coming from an invoice, so look for any custom code (BAdIs, userexits) associated with invoices. In the majority of cases this should give you an answer quite easily. Failing that, debug.

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi Mike,

thanks for your reply, yes even I am thinking the same process , will keep a break point at function module SWE_EVENT_CREATE and create the invoice again in one of the quality system and check how the event containers are filled . Is my approach correct?

thanks,

rg

0

I would just look into BAdIs first, takes a few minutes of scanning through code and has a good chance of success without having to run a single test.

0
Pavan Bhamidipati Aug 09, 2017 at 10:11 AM
0

Hi Ramya,

In general at times I try to take a RFC trace by using ST05 transaction. Usually if any workflow is started by using events then it could be either by using SWE_EVENT_CREATE or SAP_WAPI_START_WORKFLOW. so both these function modules are RFC's so I would first try to check the trace if these function modules are somewhere called while executing the transaction.

However, there is also a chance to trigger workflow by using change documents or by using Business classes which are workflow event compatible.

Thanks, Pavan

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Pavan,

thanks for your reply, so I would keep break points at function modules SWE_EVENT_CREATE and SAP_WAPI_START_WORKFLOW also by activating tarce in quality system and ask the functional consultant to create the invoice again so that the break point stops at the required place and we can check where exactly the event containers are filled.

thnaks,

rg

0