Debug BOR Events

2
Added by saurabh Asthana, last edited by Alon Mizrahi on Nov 03, 2011 Welcome, Nilesh Logout Getting Started Newsletters Store Solutions Services & Support About SCN Downloads Industries Training & Education Partnership Developer Center Lines of Business University Alliances Events & Webinars Innovation DEBUGGING OF EVENTS INTRODUCTION OF EVENTS: § Events indicate the occurrence of a status change of a Business objects. § Events always belong to an object and are therefore described as definition Components in the object type § Events can have parameters and exceptions like methods § These events have listeners (outside the BO). E.g., workflow § We can create our own events also. Procedure to create Events: a) Position the cursor on the entry Events. And then press create b) Now enter the following texts for the event to be created C) Give Event, Name, Short description Irrespective of whether you use uppercase and lowercase in the event name, the Name is always entered in uppercase letters in the event receiver linkage table by the system. The event has now been created and is available in the Business Object Repository. You can now use this event in the other definition tools in SAP Business Workflow. Position the cursor on the new event and choose Edit Change release status Object component to implement. The object type must first be generated so that it can be instantiated and tested. About Receiver FM: § If we have a requirement like insertion of an entry in a table when material is changed in a sales order or we want some functionality generally in such cases we look for BADIs and exist, these are called after the save events are triggered and we place our logic there. But we can also have a separate approach in which we link the event to a function module through Page 1 of 2 SAP Community Network Wiki - Business Process Expert - DEBUGGING OF EVENTS 26-2-2013 http://wiki.sdn.sap.com/wiki/display/BPX/DEBUGGING+OF+EVENTS

description

Debug BOR Events

Transcript of Debug BOR Events

Page 1: Debug BOR Events

Added by saurabh Asthana, last edited by Alon Mizrahi on Nov 03, 2011

Welcome, Nilesh•

Logout•

Getting Started•

Newsletters•

Store•

Solutions•

Services & Support•

About SCN•

Downloads•

Industries•

Training & Education•

Partnership•

Developer Center•

Lines of Business•

University Alliances•

Events & Webinars•

Innovation•

DEBUGGING OF EVENTS

INTRODUCTION OF EVENTS:

§ Events indicate the occurrence of a status change of a Business objects.

§ Events always belong to an object and are therefore described as definition

Components in the object type

§ Events can have parameters and exceptions like methods

§ These events have listeners (outside the BO). E.g., workflow

§ We can create our own events also.

Procedure to create Events:

a) Position the cursor on the entry Events. And then press create

b) Now enter the following texts for the event to be created

C) Give Event, Name, Short description

Irrespective of whether you use uppercase and lowercase in the event name, the•

Name is always entered in uppercase letters in the event receiver linkage table by

the system.

The event has now been created and is available in the Business Object Repository.•

You can now use this event in the other definition tools in SAP Business Workflow.•

Position the cursor on the new event and choose Edit → Change release status →

Object component → to implement.

The object type must first be generated so that it can be instantiated and tested.•

About Receiver FM:

§ If we have a requirement like insertion of an entry in a table when material is changed in a sales order or we want some functionality to happen when a purchase order or sales order is

generally in such cases we look for BADIs and exist, these are called after the save events are triggered and we place our logic there.

But we can also have a separate approach in which we link the event to a function module through

Page 1 of 2SAP Community Network Wiki - Business Process Expert - DEBUGGING OF EVENTS

26-2-2013http://wiki.sdn.sap.com/wiki/display/BPX/DEBUGGING+OF+EVENTS

Page 2: Debug BOR Events

Transaction SWETYPV and the logic are written in the FM to satisfy the requirement.

§ Now if we want to Debug that code, just by putting the break point there, we cannot reach their directly

So for this purpose below mentioned method should be followed, this procedure is very useful and can be utilized wherever we want to debug the events.

v First go to transaction swetypv then new entries.

Here on changed event we have written our logic in (This function module

is created by copying standard receiver FM SWW_WI_CREATE_VIA_EVENT) and put the break-point there and this ZRECEIVERFM is linked with the event by using

Here object type Bus2032 is taken which is for sales order, as here we are taking the case where

In a sales order while changing the quantity, the change event is triggered and then

We are linking this event to ZRECEIVERFM where we put our logic.

v Now we go to our transaction code VA02(change sales order)

How to Debug the event:

v Now we will change the quantity of item, for eg. from 916 to 917 , then press enter and start debugger(/h) .

v It will come to the screen there go in setting --> update debugging.

Note: Before switching on the debugger check that the default debugger should be classic debugger

(check in se38-> utilities-> debugging-->ABAP debugger)

v Now press execute, then it will come to following screen, there go in setting --> Breakpoint at

--> Method. A pop-up will appear, in that give the class name as CL_SWF_EVT_STRATEGY_BOR_FB

and in Method give process.

now press execute.

Now from here press F5, then after coming to CASE me->process_mode, here change the mode manually as D (for debugging) as shown below.

Then execute, then we come to the our own created ZRECEIVERFM, where break point is set and Logic is written.

So now we can analyze and debug the logic.

Labels

Follow SCN•

Contact Us•

SAP Help Portal•

Privacy•

Terms of Use•

Legal Disclosure•

Copyright•

debugging of events

Page 2 of 2SAP Community Network Wiki - Business Process Expert - DEBUGGING OF EVENTS

26-2-2013http://wiki.sdn.sap.com/wiki/display/BPX/DEBUGGING+OF+EVENTS