Professional Documents
Culture Documents
Applies to:
SAP WAS ABAP 7.0 (Netweaver 2004s) and ESS/MSS Enhancement Pack 2(required only if youre
enhancing the Travel Expenses Create Expense Report component exactly as in this case). For more
information, visit the Web Dynpro ABAP homepage.
Summ ary
The aim of this article is to share the techniques used to enhance a standard WebDynpro ABAP Component
with a new dropdown element using SAP's new enhancement concept, the Enhancement Framework. This
new enhancement concept will gradually replace the previous concepts.
The uses of the following Enhancement Framework techniques are covered in this article.
Ho w to Add a Dropdown to a V iew in a S tandard W e bDyn pro for A B AP Comp one nt us ing the Ne w E nhancem e nt F ramew ork
Table o f C ontents
Introduction ......................................................................................................................................................... 3
Procedure ........................................................................................................................................................... 3
1. Create an Enhancement Implementation ................................................................................................... 3
2. Create a new Node on Component Controller Context .............................................................................. 4
3. Create a new Method on Component Controller as the Supply Function of the new Node ....................... 4
4. Create new Node on the View Context by binding it from the Controller Context ...................................... 5
5. Create the Dropdown and Caption Elements on View ............................................................................... 5
Create a Dropdown Element ........................................................................................................................................ 6
Create Caption Element...................................................... ......................................................................................... 6
Ho w to Add a Dropdown to a V iew in a S tandard W e bDyn pro for A B AP Comp one nt us ing the Ne w E nhancem e nt F ramew ork
Introduc tion
The screenshots below are taken before and after the enhancement. A new caption element and a new
dropdown element are added as part of the procedure described in this article.
Note: The screenshots above are from the REVIEW_VIEW of the FITE_VC_REVIEW WebDynpro component. This
component is the component for Create Expense Report WebDynpro ABAP application in the Travel Expenses
module, delivered as part of EhP 2.
Proc edure
1. Cre ate an E nhancem ent Implementation
The enhance button looks like at the screenshot to the left.
At every screen, be it either Component, View, Window, or
etc. there is an Enhance button to create or assign an
Enhancement Implementation and enhance that particular
development component.
Create one Enhancement Implementation to contain all the
enhancements for this procedure. Assign enhancements to this same implementation at each component.
Ho w to Add a Dropdown to a V iew in a S tandard W e bDyn pro for A B AP Comp one nt us ing the Ne w E nhancem e nt F ramew ork
METHOD zzenh_approvers_source .
* data declaration
DATA lt_zzenh_approvers TYPE wd_this->elements_zzenh_approvers.
DATA ls_zzenh_approvers LIKE LINE OF lt_zzenh_approvers.
* @TODO compute values
* e.g. call a data providing FuBa
lt_zzenh_approvers = ztrv_util=>get_1st_approvers( i_pernr = wd_assist>gs_common_rfc_input-employee_number ).
* bind all the elements
node->bind_table(
new_items
= lt_zzenh_approvers
set_initial_elements = abap_true ).
ENDMETHOD.
Ho w to Add a Dropdown to a V iew in a S tandard W e bDyn pro for A B AP Comp one nt us ing the Ne w E nhancem e nt F ramew ork
4. Cre ate n ew Node o n the View C ontext by b inding it from the Co ntroller C ontext
Make sure you pressed the Enhance button to create an Enhancement Implementation or assign to one
created before you start enhancements on the View Controller Context.
Drag the new node from the controller context and drop onto the view context.
5. Cre ate the Dropdow n and C aption E lements on View
Make sure you pressed the Enhance button to create an Enhancement Implementation or assign to one
created before you start enhancements on the View Layout.
Right-click on the layout node
to create a new Element.
Ho w to Add a Dropdown to a V iew in a S tandard W e bDyn pro for A B AP Comp one nt us ing the Ne w E nhancem e nt F ramew ork
Ho w to Add a Dropdown to a V iew in a S tandard W e bDyn pro for A B AP Comp one nt us ing the Ne w E nhancem e nt F ramew ork
Click on the Create Post-Exit button to create the post-exit. The post-exit method automatically reads the
importing parameter of the original method. All the other parameters of the original method (exporting,
changing, and returning parameters) are provided as changing parameters.
Ho w to Add a Dropdown to a V iew in a S tandard W e bDyn pro for A B AP Comp one nt us ing the Ne w E nhancem e nt F ramew ork
iv_visible
= abap_true ).
ELSE.
only save is selected
*
enable/disable dropdown here
*
cl_fitv_wd_util=>ui_set_visible(
io_view
= view
iv_id
= 'ZZENH_APPROVER_CAPTION'
iv_visible
= abap_false ).
cl_fitv_wd_util=>ui_set_visible(
io_view
= view
iv_id
= 'ZZENH_APPROVER_DD'
iv_visible
= abap_false ).
ENDIF.
endmethod.
Ho w to Add a Dropdown to a V iew in a S tandard W e bDyn pro for A B AP Comp one nt us ing the Ne w E nhancem e nt F ramew ork
static_attributes = ls_zzenh_approvers ).
l_selectedapprover = ls_zzenh_approvers-key.
ENDMETHOD.