Workflow Webdynpro

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

Can you call/launch one web dynpro application from another webdynpro

application?
Yes, you can launch one webdynpro application from another webdynpro application.
First, you should get the URL of the web dynpro component that you want to launch and
second, call that URL in an external window.
To get the URL of any web Dynpro component, you use the FM

 CALL METHOD cl_wd_utilities=>construct_wd_url

 EXPORTING application_name = ‘ZDEMO’

 IMPORTING out_absolute_url = str.


Once you get the URL in str, you can call this web dynpro using ‘str’ and
fm: create_external_window.

What are Hook methods? What is Sequence of Execution of Hook


Methods When a View is Loaded

Hook methods are standard web dynpro methods which are called at
different scenarios in the web dynpro lifecycle

What are supply functions in webdynpro

You can assign a supply function to a context node when you create a node. In simple
terms, supply function is used to populate data records in the context node. A supply
function is called when one or more elements of the node are accessed for the first time.

 What is purpose of component controller? Different between view controller


and component controller ?

How to navigate from one view to other in webdynpro ABAP?

How to transfer data form one view to another view?

How to display message in web dynpro ABAP ? Explain ?

What Is The Use Of Ovs In Web Dynpro?

Can we embed one view in another view? How?

Sensitivity: Internal & Restricted


To Create Alv Reports, Which Alv Component Is Required?

Answer : SALV_WD_TABLE

If one view is called 10 times in the lifespan of a webdynpro component , how many times
will the method WDDOINIT be called and how may times will WDDOMODIFYVIEW be
called ?
WDDOINIT will be called only once.
WDDOMODIFYVIEW will be called 10 times.
WDDOMODIFYVIEW has a parameter FIRST_TIME . If this is 'X' , then the view is getting called
first_time.

What are PRE POST and OVERWRITE exit methods in web dynpro?
Whenever a web dynpro component is enhanced , these 3 methods become available for all
methods in Webdynpro. Lets take an example of these methods for WDDOINIT.

PRE exit: This method is called before WDDOINIT is called.


POST exit: This method is called after WDDOINIT is called.
OVERWRITE exit: In this case , WDDOINIT is not called . Instead , OVERWRITE exit method is
called.

What is an Assistance class in webdynpro ABAP? Where do you define an assistance


class? How many assistance classes can a webdynpro component have?
Assistance class helps you achieve two things:
1) Segregation of business specific logic (one of the purpose of MVC).
2) Performance benefit.

We can write the business logic in the methods of the View, Window or even the Component
controller. But it is not a good practice to load all the business logic in the views or windows.
So SAP has provided an option of assistance class where you can write all your business
logic. By this way, you are still in the framework of your webdynpro and also avoid loading
too much logic in the components of webdynpro itself. Assistance class methods are much
better from a performance point of view than calls of Web Dynpro controller methods.

A web dynpro component will have only one assistance class and it is defined at the
component level as per the screenshot below. The assistance class is automatically
instantiated when a component is called. You can access the instance of this class with the
attribute wd_assist, which is created when you create the assistance class in web dynpro.

Some important Web Dynpro attributes that you should know:


Some attribute in webdynpro that are used very frequently and some of those that you must
know are :
Wd_this
Wd_context

Sensitivity: Internal & Restricted


Each controller has the above two mentioned attributes.
To elaborate, if you are using the above two attributes say in a method of a View Controller,
then WD_CONTEXT is the reference to the Context node of the View and WD_THIS is the
reference to the View Controller itself.

Wd_comp_controller is the reference to the Component Controller. View and Window


controller have this attribute defined by default and methods/attributes of the Component
Controller can be accessed by using this attribute.
For example:

Wd_assist: This attribute is created when the assistance class is saved and activated for a
web dynpro component. All the methods of the assistance class can be accesses by using this
attribute.

How do you read parameters passed in the Web Dynpro URL?


First lets understand how a typical webdynpro application looks like:
When you create a web dynpro application , you can see the link URL generated by web
dynpro.
It will be something
like:http://domainname.com:8000/sap/bc/webdynpro/sap/zdemo_webdynpro?sap-
language=EN&sap-client=100.

Whatever comes after the ‘?’ and is followed by ‘&’ is an URL parameter. You can see sap-
language and sap-client as default parameters whenever you launch your web dynpro in
browser. The cool thing is you can add some custom variables
too. http://domainname.com:8000/sap/bc/webdynpro/sap/zdemo_webdynpro?sap-
language=EN&sap-client=100&var1=4500000001&var2=00010.
So var1 and var2 are custom webdynpro URL parameters and you can read them in
the HANDLEDEFAULT method of your main window:

: What is Web Dynpro Component Usage?


Real world business scenarios are quite complex and may involve multiple Web Dynpro
Components.

While dealing with multiple WD components, you may come across a situation where you need to
reuse already developed parts of an existing Web dynpro component.

Sensitivity: Internal & Restricted


The Web Dynpro framework provides you with a technique called ‘Component Usage’, with the help
of which you can reuse the events, methods, and context of one WD component into another WD
component.

Standard examples of Component Usage: Select Options , ALV , OVS.

You declare component usage both at the Component and at the view levels:

Briefly explain how will you use implement Select Options in Web
Dynpro?

1) Declare Component Usage for Standard WD component WDR_SELECT_OPTIONS both at


component and view level.

2) Place a VIEWCONTAINER on your main view and embed the view


‘WND_SELECTION_SCREEN’ of component WDR_SELECT_OPTIONS in it.

3) Use the methods CREATE_RANGE_TABLE and ADD_SELECTION_FIELD for your


fields on Selection screen.

4) Use method GET_RANGE_TABLE_OF_SEL_FIELD to read user input before you do a


SELECT.

How do you generate POP UP in WD?


This can be easily done using the Wizard:
The CREATE_WINDOW method is used in this case.

How do you close a window in Web Dynpro?


There is a special outbound plug called ‘Exit Plug’ that can be used for this purpose.
wd_this->fire_to_exit_plg( url = url close_window = close_window ).

Question: What is the difference between Drop down by key and drop down by index ?

Question: How do you display error / success / warning messages in Web Dynpro ?

Question: How do you access methods of component controller in a view ?

Sensitivity: Internal & Restricted


Workflow interview questions
What are the different types of WF Agents?

1. Possible Agents
2. 2. Responsible Agents
3. Actual Agents
4. Excluded Agents:

To change attribute values from methods of a BO


SWC_GET_CONTAINER
SWC_SET_CONTAINER

Q7) Different deadline conditions


Requested Start: When this date is met, only then the work item will start
execution, or available for taking action (dialogue).
Latest Start: When a date mentioned here is met, it can send an email, or can
be modeled to do something active.
Requested End: Same as Latest Start
Latest End: Same as Latest Start

Q10) What are the workflows created by you? Worked upon by you?
Function Module that creates the workflow
SAP_WAPI_START_WORKFLOW:
SAP_WAPI_CREATE_EVENT
SAP_WAPI_WORKITEM_RECIPIENTS
SAP_WAPI_GET_WORKITEM_DETAIL

Sensitivity: Internal & Restricted


Q15) How can we debug a workflow?
1. If it is a dialogue task, you can set a breakpoint in the method called by the
task
2. If it is a method that you want to debug, use SWO1, and create an instance
of the object and debug the methods
3. If it is a background task, and you are in development client, you can do the
following. Create an infinite loop in the method you want to debug. Go to
SM50 (processes overview) and select the relevant item, and select debug
from the option.

Q20) What are the different statuses of a work item?


1. Waiting
2. Ready
3. Reserved
4. In process
5. Executed (‘confirm the end of processing’ in task definition)
6. Completed
7. Logically deleted
8. Error

Q36) Workflow is not starting. What might be possible reasons and


corresponding solution?
If started by an event:
1. Run SWU_OBUF and check transaction SWU3 for problems.
2. Check that the linkage between the event and the workflow exists in
transaction SWE2 and is activated.
3. Check transaction SWEL to see if the event was created/gets created (may
need transaction SWELS to turn SWEL on).

Sensitivity: Internal & Restricted


4. Test if creating the event manually in SWUE triggers the workflow.
5. Check if there is a start condition that isn’t being satisfied.
6. Check if the event is in a queue (if event queueing is turned on, see
transaction SWEQADM)
7. Check WF-BATCH in transaction SU01, see if all is well (e.g. password not
expired)
If started directly (e.g. with function module SAP_WAPI_START_WORKFLOW;
not recommended if it can be avoided):
1. Run SWU_OBUF and check SWU3 for problems
2. Check if the workflow has been set to General Task

What is the integration point with ESS Portal?


Tcode SWFVISU

Is it possible to capture the username who approves or rejects my PO?A.


Yes you can. You can retrieve Actual agent name after workitem execution.
It’s name is _WI_Actual_Agent. Move it via task parameter binding.

Why ‘Process Control’ is used? What are its features?

How to check if event is triggered or not ?

Way to store Multiple records in a container element in sap workflow?

What is the tcode to create custom Business Object?

Sensitivity: Internal & Restricted


Mention tcode for event linkages?

How can I set the foreground/dialogue tasks to "general tasks"?

Defining Condition Step in a WorkflowHow do you define a condition step?


In an expression, I am checking the WF container element value. For TRUE
value, I want to continue to the next step, and for FALSE I want to exit
workflow, as this "next step" is the last step in a WF. However, when I come
back to WF Builder, I can see that both results bring me to the "next step".
What I am missing here to correctly configure the TRUE and FALSE values?A.
You need to add a process control step to complete the workflow in false
branch

Sensitivity: Internal & Restricted

You might also like