Function Modules in Event Linkage
Dear all,
In the event linkage of workflow, we can find 3 types of function modules. They are receiver function module, check function module and receiver type function module. Can anybody explain what are they used for?
Thanks + Best Regards
Jerome
Hi Jerome,
Explanation for each of the FM's(Receiver Fm, Check FM, Receiver Type FM).
<b>1) Receiver Function Module.</b>
This is the main function module which will actually link the Object Event and Workflow Or Task.
Ex Event : BUS2012.ReleaseStepCreated
Workflow : WS20000075
FM : ZReceiver.
An Entry in SWE2(Event linkage) with above values Does mean "The workflow WS20000075 will start when Event BUS2012.ReleaseStepCreated is triggered with the help of ZReceiver ".
All Receiver Function Module should have standard interface(Same input and table parameters specified by SAP).
<b>2)Check Function Module</b>
This function module is used to prevent the event linkage.
It is called <b>before the Receiver Function</b> Module is being called.
Lets take the above ex:
Ex Event : BUS2012.ReleaseStepCreated
Workflow : WS20000075
In this case if you want to do some checks before actually linking the BUS2012.ReleaseStepCreated and WS20000075 using Receiver Function Module then you can use Check function module to do validation and raise the Exceptions.
If any exceptions are raised in the Check function module then The Receiver Function module will not be called hence no EVent Linkage.
<b>3) Receiver Type Function Module</b>
This is the <b>First function module</b> to be called among three if it is specified in SWE2.
This Function module is used to find the Receiver type Dynamically. ie if you have not specified the reciever type(Workflow or Task) in SWE2 you can determine that at runtime using this Function module.
Reward if its helps. Feel free to ask for clarifications.
Thanks
Praveen
Similar Messages
-
GP: How to keep action sleeping until ABAP function module raises event
Hello experts,
I'd like to develop a gp process which contains a callable objects which keeps the process instance waiting until an abap function module send something like an event.
I don't want to put too much load on the machine and block expensive JCO ressources.
Does anyone have an idea how to solve this?
Thanks very much
StefanHi Mike,
GREAT! Many thanks! Sometimes solutions may be so simple.
For all others who have the same problem a bit more in detail:
In your FM just enter as exception: CX_BO_ACTION_CANCELLED and mark 'Exceptn. Classes'.
Declare your class method with the exception cx_bo_action_cancelled.
In your class method just enter your FM via the 'Pattern'-Button.
The Pattern will show only the Import- and Export-Parameters but not the exception (class).
Regards,
Georg -
How to Debug During Event Linkage( Reciever Function Module )
Hi all,
If anybody knows how to debug a reciever function module in event linkage method then please respond.The scenario is that whenever service order is changed the change event will fire the custom business object which has a supertype BUS2088.Hi Nishanth,
You can debug event linkage using the transaction SWUE.
Here you can raise an event and specify an object key (using an already created service order).
Just flag the trigger receiver FM synchr. checkbox and your break point will be hit.
Hope that helps.
Cheers,
Brad -
Read workitem Container Value in Terminating event Check Function Module
Hi
I have some problems reading work item data / values of a work item container element in a check function module on a terminating event Do any of you know if this is possible, and if so, how its done ?
In My scenario I have created a multiline approval step for my business document, one task pr Line Owner. The Event Approved is defined as a terminating event for this task, and the line owner is passed to the task container.
Now, when I raise the event, with the line owner as an event parameter, I would like to check if the line owner on the raised event, matches the line owner in the task container in question in a check fm. But here I faced the problem, that only event data, and not work item data, are passed to the Check Function module.
Regards,
Morten NielsenHello Morten, hello Arghadip,
in the instance linkage's check function module (entered via transaction SWEINST) you'll have the workitem-id in the system event parameter EVTRECEIVER_ID
With this number you can use the frame work in order to read the work item container.
This is a sample coding, how you access the correct work item container using SAP Enterprise and it's new OO frame work, which checks on the terminating event of BUS2105.Released the correct release code for a work item.
INCLUDE <cntn01>.
INCLUDE <SWFCNTN01>.
INCLUDE RSWEINCL.
*** Read workitem instance and container from event
DATA: wi_id TYPE swwwihead-wi_id.
swc_get_element EVENT_CONTAINER evt_receiver_id wi_id.
IF sy-subrc <> 0.
MESSAGE E015(ZPREL) WITH evt_receiver_id
RAISING wrong_call.
ENDIF.
DATA: lv_wi_handle TYPE REF TO if_swf_run_wim_internal.
DATA: ls_context TYPE sww_wimctx.
DATA: lv_wi_container TYPE REF TO if_swf_cnt_container.
* - set context
ls_context-do_commit = ' '.
ls_context-called_btc = 'X'.
ls_context-exec_user = sy-uname.
ls_context-fbname = 'Z_CHECK_RELEASE_CODE'.
CLEAR lv_wi_handle.
CALL METHOD cl_swf_run_wim_factory=>initialize( ).
CALL METHOD cl_swf_run_wim_factory=>find_by_wiid
EXPORTING
im_wiid = wi_id
im_read_for_update = ' '
* im_enqueue_owner = fb_name
* im_wait_for_enqueue = 'X'
im_context = ls_context
RECEIVING
re_instance = lv_wi_handle.
*** This check is only done for workitem linkage TS90100081
IF lv_wi_handle->m_sww_wihead-wi_rh_task <> 'TS90100081'. "#EC_SYNTEXT
EXIT. "Let event pass, as this is an instance linkage to another workitem
ENDIF.
DATA: releaseCode_wi TYPE t16fc-frgco.
* - read releaseCode from workitem container
lv_wi_container = lv_wi_handle->get_wi_container( ).
* - perform binding event container -> workitem container
swf_get_element lv_wi_container 'RELEASECODE' releaseCode_wi.
DATA: e TYPE REF TO cx_swf_run_wim.
CATCH cx_swf_run_wim INTO e.
RAISE WORKFLOW_RUNTIME_ERROR.
ENDTRY.
*** From here on, the variable releaseCode_WI hold the
*** container element RelaseCode of the work item, that
*** is going to be terminated...
*** Further coding from here as appropriate...
Best regards,
Florin -
Function Module to find Business Event type
Hi Experts,
Do we have any Function Module to get Business Event Type(BET) if Person(P) is the input.Go to SE37 and give application component PE and search for you requirement
RH_CHECK_EVENT_ASSIGNMENT
RH_CHECK_EVENT_LOCATION
RH_GET_EVENT_DEMAND
RH_GET_FIX_EVENTS
RH_GET_FOLLOW_UP_EVENTS
RH_GET_ATTENDEE_ACTIVITIES
RH_GET_ATTENDEE_WORKITEMS
RH_GET_CANCELLATION_DATA
RH_GET_EVENTS_FOR_MOVE
RH_GET_EVENT_CAPACITY
RH_GET_EVENT_DATA
RH_GET_EVENT_OCCUPATION
RH_GET_EVENTTYPE_SCHEDULE
RH_GET_EVENT_SCHEDULE -
Process Chain Review Question: function module/ABAP program/Event
Hi,
1. Can you tell me a bit more about function modules such as RSPC_CHAIN_ACTIVATE_REMOTE
2. What are function modules in general terms. i.e. What is their role?
3. How do I see all function module available?
4. When is function module used instead of ABAP program?
5. How do they help in the support and monitoring of Process Chains?
6. I am getting confused over the following under process chains job, event, function module and ABAP Program
Thanks2. What are function modules in general terms. i.e. What is their role?
Function module return a value ( most of the time), they return some value either a single value of rane of value or even a table. Example: FM to return fiscal period gieven the fiscal vaeiant and system date.
3. How do I see all function module available?
Go to Se37 and this is function builder. You will find FM starting with RS* more useful. You cna also create your own in Se37.
4. When is function module used instead of ABAP program?
In addtion to answer I gave in 3 above, program is used to check some logic and update some tables or give screen output.
You may note FM is also a program.
5. How do they help in the support and monitoring of Process Chains?
As I said, for monitoring chains, use Sm37 and logs in RSPC.
6. I am getting confused over the following under process chains job, event, function module and ABAP Program
I am not clear what are you looking for.
You cna schedule a FM or a program to run in a chain. Is that what you mean?
Ravi Thothadri -
Message cannot send if P.C was started by function module, ok for event
Hi Expert,
I face a very strange situation
As you know, we could create message for each process chain steps
I have one process chain which contains message if it is start and when it is finished
The start condtion for this process chain was after event
But the strange situation is
1. If this process chain was start by function module: RSPC_API_CHAIN_START
The message in process chain cannot be sent
2. If we trigger event for this process chain, the p.c could be execuced correctly
Could you kindly let me know the possible reason for this issue?
Thanks and best regards
Alex yangRoot cause is the function module we use will run the process chain in dialog module (no batch job). So system cannot send the mail.
If run it in background, we could get the mail -
Event log for events from function module BP_EVENT_RAISE
Hello experts,
where can I look at the event log which where raised with the
function modul BP_EVENT_RAISE.
Thanks.
Regards, Lars.this function module does not write a log by itself. and actually i would not know what should be in that log. usually you set up an event to trigger a follow-up process, so there's either the event was successfully triggered and your follow-up process has been started ... or it hasn't, which means: something went wrong ...
Edited by: Mylene Euridice Dorias on Apr 16, 2008 10:42 AM
i was just sap-netting with your problem and i found note [919458|https://websmp230.sap-ag.de/sap(bD1kZSZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=919458&nlang=EN&smpsrv=https%3a%2f%2fwebsmp205%2esap-ag%2ede] where they use program BTC_EVENT_RAISE instead of BP_EVENT_RAISE. the note says this program writes at least a line in the job-log so it might fulfill your requirements ... -
Function modules to generate the event required
Hi guys,
I have created a workflow but its start event is not getting triggered though condition data is correct.
I want to debug and see when the Business object's event is called.
Can you please tell me name of the Function modules to generate the event. This way i'll put a breakpoint on those and check the flow ?
Regards,
ShailiThanks Surjith
I'll check this FM.
Also I want you advice on the real issue i'm facing.
I have created a workflow giving some condition with start event as CHANGED of BUS1006. Now the work of populating the field in condition is done automatically by a BADI i've created.
The issue is that the workflow is not triggerd during automatic population of teh field but is triggered when i explicitly populate the field.
The reason might be that CHANGED event of the business object used is triggered before the SAVE BADI has populated teh field. So CHANGED event 's condition is not satisfied before the BADI has finished updating.
Is there a way tackle this. Can I somehow push back the trigger of workflow...I'm new to workflows so please don't mind if this sounds foolish
Regards,
Shaili -
Function module to populate itab with event's name
Is there any function module which would populate internal table with all the events name of the submitted program.Actually I used F4_PROG_EVENT but it is generating a alv popup with event's name but not storing anything in the internal table.
Hi,
Check FM: REUSE_ALV_LIST_DISPLAY
Export
It_events : internal table with a list of all possible events of ALV and their corresponding routine names. -
Dunning FPVA/FPVB : Need UserExit Event Function Module
Hi Guys,
I need to develop an enhancement in dunning activity. In which custom function module will be triggered in a dunning activity to check if among the dunned items.
This custom function module must have table T_DFKKOP filled with open items from the contract account been dunned.
I found one event i.e. 311. But I am not sure of its use and when it wil be called.
any response will surely help.
Edited by: Nikhil Jathar on Dec 1, 2008 10:47 PMSPRO->SAP Customizing Implementation Guide->Financial Accounting (New)->Contract Accounts Receivable and Payable->Business Transactions->Dunning->Configure Dunning Activities.
Create your Z function module and attach over there with the following parameters.
""Local Interface:
*" IMPORTING
*" VALUE(I_TFK047L) LIKE TFK047L STRUCTURE TFK047L
*" TABLES
*" T_FKKMAZE STRUCTURE FKKMAZE
*" T_FKKMAKT STRUCTURE FKKMAKT
*" T_FKKOP STRUCTURE FKKOP
*" T_FKKOPK STRUCTURE FKKOPK
*" T_FIMSG STRUCTURE FIMSG
*" CHANGING
*" VALUE(C_FKKMAKO) LIKE FKKMAKO STRUCTURE FKKMAKO
*" VALUE(C_FKKKO) LIKE FKKKO STRUCTURE FKKKO
I guess your requirement will solve in this user-exit. if it is not soleved then tell me , What u want to do in the user-exit is the main question ? bcz there are so many user-exits are there for your question.
Please Allot Points if it helps
Regards,
Shiva Kumar -
Webdynpro Function module linkage
Hi all,
We have a requirement where in we are required to display the employee bonus details in portal.The standard configuration does not meet this requirement ,hence we have configured the portal by adding a new column to display employee bonus.The custom Function module which we had created is working perfectly in R3.Can somebody detail the steps involved in linking the FM with portal.
Note :- The FM which we have created is normal FM and not Remote FM.
Thanks and Regards,
KiranHi,
Duplicate post.
Pls check the same in the ABAP General.
Pls read the rules.
Webdynpro FM call
Regards
Lekha -
Receiver Type Function Module in SWE2 use of export parameter.
i am trying to understand the underlying concept in following things:(neednot to say i have searched alot and read sap documentation already).
In event type linkage table say i have an entry for BOR -> AFVC_PM.
As per sap Documentation says all these FM will trigger in following way.
1 Check Function Module (to place any validations/checks)
2 Receiver Type Function Module ()
3 Receiver Function Module.
Thats fine.
This is what documentation says about Receiver Type FM(2nd FM) not Receiver FM(3rd FM).
This FM has 1 export paramter
Export parameters
RECTYPE type SWETYPECOU-RECTYPE Receiver type( Result of the evaluation by the receiver type function module.)
if i am understanding this right, in this FM receiver type will be decided .
i have placed BREAK-POINT in this FM and passing value WS90000024 (Workflow with simple mail step) in export parameter RECTYPE.
after everything executed successfully why i can't see that mail in my inbox.
Please correct me if i had misunderstood the concept .ok,indeed i was missing this thing.
i got the mails in inbox.
but why i can't see this value WS90000024 of this workflow ()which is going to be triggered ) in parameter RECTYPE.(its empty).
it is empty after the receiver type function module execution is complete.
below is workflow template, -
How to trigger Alert with Event Linkage?
Hi,
Can any one tell me the process how to trigger alerts with event linkage? I am successul in triggering by calling function module SALRT_CREATE_API.
my scenario is...
when a purchase order is cancelled, i have to trigger an alert to the concerned department head throgh Alert Inbox and external mail also.
Plese guide me..
Regards,
Dhanunjaya ReddyHi,
now i am getting alerts from Event Linkage.
Here i take the scenario Sales order change.
BOR object : BUS2032
Event : Changed
Receiver type : <my alert>
Receiver call : Function Module
Receiver Functiona Module : SALRT_CREATE_VIA_EVENT
Linkage is activated.
when a sales order is changed receiver function module triggering the alert which is defined in Receiver type. That i am getting in my alert inbox. Upto this.. it is cleared.
Now the scenario is.. about Alert Container
in alert container i take element is BOR Object type BUS2032.
the questions are..
1. Is it correct to defined BOR object here to get data when Sales order has been changed.
2. What are the properties i have to take in Properties tab?
3. How to use alert container parameters in short and long text?
Here my clear intention is when a sales order is changed.. i have to get the data related to that sales order and it has to show in Alert. -
In HCM form & process Workflow event linkage changed to inactive status.
Hi,
In HCM form & process event linkage is activated in HRASR_DT and workflow object .
Now once we complete the process from EP portal ,reference number is generated and enteries are created in table T5ASRPROCESSES .
In SWEL,event is triggered and linked with the same workflow.
Now the problem is,thesre is no workitem in SWIA with this workflow numbmer and the event linkage also changed to inactive status ( both in proces and workflow )after we complete the process from EP.
Thanks
ManojHi
When you are delaing workflows with HCM Process and form the behaviour is slightly different from the normal.. In order to check why the event linkage is inactive the possibilities are
1. Either there are some chnages done in the workflow and it is not activated from the transaction HRASR_DT.
2. The other possibility is that you might have directly actovated the workflow from SWDD transaction and if you have done in this way then it is a wrong way of generating and activating the workflow
Follow the below steps to find the error
1. Execute HRASR_DT txn and try to activate the workflow from here. If you try to activate the workflow from this transaction the check function module which is linked to the workflow will be knowing that for which specific process which workflow has to be triggered..
so in HCM process and forms frame workf it is always suggestable that try to create the workflow from HRASR_DT transaction using forward navigation and activate the respective event linkages.
The other point you need to check is make sure that all the respective program exit classesare included in the basic data of the workflow other wise even if you miss the program exit classes in the basic data the workflow will not be able to start its process/execution.
Regards
Pavan
Maybe you are looking for
-
Port overrun error while reading data in queue
I am trying to read data from various wireless sensors(5-6 in number) which are communicating with my PC using rs232 port. the size of data from each sensor that i am getting is 39 bytes. I want to extract some bytes of these data for which i am usi
-
I have an ipod touch that is not recognized by itunes or my computer.
I have re-installed itunes and that hasn't worked. I know it's not the chord because i've plugged in another ipod and that one works. But when I plug in the ipod touch I get nothing--no charging; and it does not show up in device manager
-
How to cusotmize the attribute of being mandatory for master data and order
Hi,everyone how to make the un-mandatory field on the verdor master data mandatory? Also, How to set to define my own mandatory fields on purchase order? I also need to remove the mandatory setting which is pre-set by the system on many docutmen
-
Where do I see a list of my incoming calls online
Where can I see a list of my incoming calls on the Verizon website?
-
Tax classification clarity needed
Dear Experts In customer master data in billing tab we will give ex 1 full excise with 12.5% and 2 full excise 3% cst now if i create ne tax classification , then what all the setting i need to make , how it flows can any body help me i