cancel
Showing results for 
Search instead for 
Did you mean: 

SWO1 basics "BUS1065"

Former Member
0 Kudos

Hi All,

I had a standard BO. BUS1065. I copied it, implemented and released. I copied it as ZBUS10651. I added an event trigger_workflow to it. I made the parameters attached to it same as that to the other standard methods of this BO.

My question is I want employee name and emp. no. in the container element to be passed from BO to the container in the workflow. I am using FM to trigger the workflow

CALL FUNCTION 'SWE_EVENT_CREATE'

EXPORTING

objtype = 'ZBUS10651'

objkey = objkey

event = 'TRIGGER_WORKFLOw' .............

So the fm does trigger the workflow, as a key i passed the emp. no. so what happens next .... does this also make the code in the BO execute. As I have not used any of the methods of the BO in the workflow I think container values would not get set.

What next am i supposed to do next. Implement some of the methods in the workflow? or do we link an event to an method? Or what next to get the employee name and emplyee number in the container elements

&_WI_RESULT.NUMBER&

&_WI_RESULT.NAME&

Am I using a wrong BO.?

I am kind of lost here.

Thanks,

Anu.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi

1st Q ans : I think if you have created ZBUS10651 and the event linkage of WF in u201Cstate event u201Dtab where the binding is btw event and WF . binding should be

&_EVT_OBJECT& -> & ZBUS10651&

&_EVT_CREATOR& -> &_WF_INITIATOR&

Atleast.

Just make sure ZBUS10651 container s export and import property is ticked.

And then for that bo you can get number and name in container . as all date is there in the instance of bo.

2nd Q ans :By u201Cwhen u double klik on the object name in SWO1u201D do u mean that you are executing the BO in Swo1.then Attributes are blank as you need to instantiate it , by clicking to u201Cinstanceu201D.then pass Perner. You will get values in Attibute. Then you can also execute the methods.

Before you instantiate the BO , what ever method you are seeing , they are independent , like u201CCreateu2019 .

3rd Q ans: The methods highlighted in Red means we should not use those ,they are obsolute.

hope this will help you

thanks ]

Kakoli

Former Member
0 Kudos

Hi all,

The answers above did work. Actually the bindings:-

&_EVT_OBJECT& -> & ZBUS10651&

&_EVT_CREATOR& -> &_WF_INITIATOR&

were not hapeening automatically, when I did that it worked fine. I was able to get name emp. no. and other datas.

1. However, I need to know a little more about the BO's. (for eg:- BUS1065) . In a normal ABAP OOPs program when an event is created it check the event container/ Handler for the possible methods and it executes the methods in the handler on a trigger to an event.

2. So is it something similar happening here in the triggereing of events of B.O for eg:-BUS1065 . Does the event trigger any method in the BO. Does a BO have any default method, or a handler method or on trigger of an event of BO. all the methods gets executed by default?

3.Also please confirm/ correct my understanding:- Only the elements used in the attributes of B.O's in SWO1 can be used as container elements and thus can be passed to the workflow. And also as per my understanding the values of attributes/ container elements are set by the statement .SWC_SET_ELEMENT CONTAINER ........ . If my understanding is correct so far then in this perticular B.O BUS10651, I can see a statement as "SWC_SET_ELEMENT CONTAINER 'Return' RETURN. " .... What is return here. Its not defined in the attributes. so what is it trying to set .....?

Thanks in advance.

Rgds,

Anu.

Former Member
0 Kudos

You have to execute method separately in a task. The posting is too big. Can you pls what is the issue myou are facing.

Thanks

Arghadip

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

When you activate the triggering event for your workflow, the binding would have automatically been done for you. This will be something like,

&_EVT_OBJECT& ---> &somevariable& ('somevariable' will be of type ZBUS10651)

Check this out in the Event->Workflow binding in PFTC. Open your workflow template and go to tab 'Triggering Events'. It will be available here.

You can use this 'somevariable' BO instance and its attributes for all your subsequent steps.

Former Member
0 Kudos

I need some information on the DEFAULT tab which appears when u double klik on the object name in SWO1

(Object name for eg:-BUS1065). It has two parameters,

method

and

attribute

method is by default set to display and attribute it blank. Does this mean whenever an event from this BO is triggered, a default method called disply will be executed. If yes then what does attribute mean?

Thanks,

Anu.

Former Member
0 Kudos

Hi All,

I got a third question related to the above queries. When u open a BO in SWO1. You can see some of the methods are highlighted in red. What does that mean?

Rgds,

Anu.

Former Member
0 Kudos

HI,

The highlighted methods/attributes are usually the ones that are taken over from the supertype of that particular object.

Suppose that you have a business object that is in your workflow as an attachment. Then if you click on the attachment from the workitem, the 'Default' method that is defined is called. Generally, its Display(you wanna display an attachment when you click on it..). Not too sure about the default attribute.

Regards,

Adarsh

Former Member
0 Kudos

Hello,

1. When you trigger the workflow using the function module, make sure that all the key fields properly. If the execution goes fine an instance of the object will be created with the passed data. You can obtain the same into the workflow template with proper binding from the event container to the workflow container. Hope you are already aware of the binding. Just to refresh, the below two entries are to be present.

&_EVT_OBJECT& -> <workflow container of the same type as the BO>

&_EVT_CREATOR& -> &_WF_INITIATOR&.

Once these are filled up, the values in the variables &_WI_RESULT.NUMBER&,&_WI_RESULT.NAME& if these are the attritbutes of the BO.

2. The default method is called for example in the scenario when you link it to a user decision. When you create an custom user decision, create a element in the task of the BO type and pass the data from the workflow container element to the user decision step. You can view the BO as an attachment in the display of user decision step in business workplace. On clicking that, the default method would be executed.

Default attribute would be used when you use the whole workflow container in the workitem description. The value of the attribute is filled up in the description.

3. The methods in red color are the methods present in the BOs supertype. They are not obsolete. You will find a red circle with STOP written in it to display that a component of the BO is obsolete.

Hope this will help.

Thanks,

Samson

Former Member
0 Kudos

Hi All,

Thanks for the replies so far, they have been a great help. Am new to workflow, just atarted working on a trial workflow and have been coming accross a lot of difficulties in creating a new one. Somehow the lines written by Samson below were a little difficult to understand. The ones given below. If someone can explain.

*You can view the BO as an attachment in the display of user decision step in business workplace. On clicking that, the default method would be executed.+*_

*Default attribute would be used when you use the whole workflow container in the workitem description. The value of the attribute is filled up in the description._*_

Thanks,

Anu.

Former Member
0 Kudos

Thanks to all,

Anupma Chandra.