Showing posts with label Event. Show all posts
Showing posts with label Event. Show all posts

Friday, 12 February 2016

Basics of ABAP Webdynpro: Getting familiar with Webdynpro jargons part 3

Internal/Context mapping: We can define context node at any of the available controller. However as WD component controller works as a global one, context node defined there is accessible in any other controller. We just have to drag and drop those WD component controller context node to the controller we want them to be used. In that case, if we define any value to this node at WD component level, this value will flow to the other controller where it has been used. And also if we make any changes in that context node in controller where it is mapped, that value will flow to WD component level also.

External/Cross component context mapping: In one of the earlier posts we have seen what component usage is all about. Suppose we are using WDC1 into WDC2 through component usage. Now context mapping between a context node, which is in interface controller of WDC1, and a context node of WDC2 will be known as external mapping. In that case context node data from WDC2 will flow to WDC1.

Hook methods: As soon as you create a WD component, many hook methods will be automatically will be available at WD component level, view level, Window Level. In one of my post, I have very elaborately described about the Hook methods and their order of triggering in normal as well as in special scenarios. To know more ClickHere and Here

Singleton Node: We will understand this with one example. Suppose there is one node which will have sales order header related information. Now this node has another sub/child node which is meant for the item level information. In normal scenario if both of these nodes are normal node, if the parent node has 10 header records, child node will have the item level information of all the 10 sales order.

Now in case the child node is defined as singleton node, this child node will only contain item level information for the sales order which is currently selected. This is huge success in improving the overall application performance.

Supply function: While defining the context node we can give the supply function also. This supply function is meant for providing a value to the context node. Supply function will gets triggered if the data of the context node is being used and its value is either initial or invalid. Context node’s value will be invalid if it’s a singleton node and the lead selection of the parent node has changed. In that case supply function will get triggered and will calculate the new value based on the parent node’s data.

Apart from the ABAP Webdynpro terms I covered in last 3 posts, I have already shared many ABAP Webdynpro related posts in my blogs. While you can go through the blog to find more, here are few links of the important posts.

Deploy ABAPWebdynpro application in SAP Enterprise portal 

Default leadselection in ALV in ABAP webdynpro

Disable empty rowscoming in Webdynpro ALV

Dump (System_name :is not a valid attribute type) in starting the Webdynpro Application 

Radio button as a cell editor for a column in Table UI element - Part 1 

Radio button as acell editor for a column in Table UI element - Part 2 

Different types ofwindow creation in Webdynpro

Cell Variant: A wayto use multiple editor in a single table column in webdynpro ALV 

Floor Plan Manager:FPM application using OIF


Use ofIF_FPM_UI_BUILDING_BLOCK interface in FPM and triggering sequence of itsmethods 


I’ll continue posting more basic concepts and exercises in my further post. Till then Happy Learning :)

Monday, 2 November 2015

Workflow Triggering with a BO event

In last post we have seen about the creation of business object and its component. For your easy access here is the Link.  So after creation of events in BO, we have done the event linkage in SWE2. Event linkage mainly tell us what to do when this events gets triggered. While defining event linkage we can give ‘Check Function Module’ and ‘Receiver Type Function Module’. I’ll cover the uses of these function module in a separate post.

So while doing the event linkage we have given a workflow name as receiver type. It means whenever this event gets triggered, this workflow will come into picture. So this is one part of the job. Second part is while creating the workflow, we have to give that BO event as the start event of workflow. Both of these parts of the jobs need to be done in order to trigger the workflow as a result of BO event.

So in this post we will start with workflow creation to cover that second part. T-code for workflow creation is SWDD. Start with that transaction and click on Create button.
IT will give a blank workflow template. We will create a simple workflow which does the task of sending a mail with some text. So we will insert a new step for mail sending. For that double click on ‘Undefine-double-click’ and a popup will come with the prospective steps. Choose send mail from there.
Give the subject and body of the mail in next step.
Click on okay button it will ask for the name of this task.
Give that task a package and it will return to main workflow screen which now looks like this.
Click on save and it will ask for the name of the workflow.
Give that workflow a package and save and activate it.

Now this workflow is good to go if we simply want to send a mail, but not to forget we have to trigger this workflow as a result of a BO event. So now we have to give the start event of this workflow.

So go to the basic data of the workflow.
There go in Start Events tab and give the business object name and event name which we created in This post.
We can see that as of now Active and Binding column is in gray mode. They need to be in green mode. Active obviously shows if this start event is activated or not and in binding we do the data mapping. Means if we are passing any data from event to workflow these element binding needs to be done in Binding. We don’t have any data which is flowing from event to workflow still that binding column needs to be in green. So for that to achieve click on binding it will take you to below window. From there just click on okay and come back and binding column will be in green.
Same way click on active column (over gray icon), it will ask for the TR, assign it and when you come back active button will be green.
So now we have active and binding both green, so we are good to go. Save it, come back on workflow and activate it and now workflow looks like below.
You yourself can see the difference now in pictorial view of workflow. Workflow will be started not from the conventional point, but from the start event which we have given.

We can now test this workflow and can check in business workplace if we have got the mail. T-code for business workplace is SBWP. Go there and click on inbox. There is no mail as of now.
Now execute the workflow.

Refresh inbox in SBWP.
It means workflow is working.

Happy Learning :)