RoadMap UI Tutorial webdynpro for ABAP
RoadMap UI Tutorial webdynpro for ABAP
for ABAP
August 28, 2017
STEP1
ROADMAP
Step3.
STEP type STRING: while running the application it will give the step on
which user is working.
Also Create two more attributes named :
NEXT_ENABLED type WDY_BOOLEAN and PREV_ENABLED type
WDY_BOOLEAN .
Step4 :
IT will look like as the below screen shot once after you mapped it.
Step5:
Right click on the RM_TEST (created ROADMAP) and insert Roadmap Step.
Inserted step START’s attributes are:
Description: start
Name: 1
Same way insert two more steps: MIDDLE and END:
(in real time application, these steps can be “Select items” ,”select payment
options”, “credit card details” and in last “Confirmation”)
Step 6:
So that when ever user select a step from the screen it’s ID will be assigned
to the STEP variable of ROADMAP node.
Step7:
We got the name of the step which user has selected from the screen but we
need some logic so that we can display the proper view for it.
Double click on the RM_TEST and in Click the button create which is there
in front of OnSelect property.
Step 8 :
Just below the ROADMAP we also need proper view according to user click.
As an example when user select “Credit card details”- step. it should display
the view which has the relevant information.
For this tutorial we will create 3 views START MIDDLE and END.
To connect MAIN view with other three views START ,MIDDLE and END. we
need navigation plugs from main.
Click on the MAIN view go to its Outbound plug and create three plugs.
TO_END
TO_MIDDLE
TO_START.
Step11:
Named: IN
Do the same thing for MIDDLE and END view
Step12 :
Now go to windows and embed the view which you have created.
Now main view needs to be connected with the START, MIDDLE and END
view.
To do this right click on the TO_END plug and click on the “create
navigation link”
Let’s also put two buttons so that user can go back or continue to the next
step.
On click of the back button ROADMAP should navigate to the previous step.
To achieve this:
(Double click on BUTTON_BACK and click on the create ICON for PROPERY
“ONACTION”)
Same way create Action named: NEXT for the BUTTON_NEXT
When you create actions it will internally create respective methods for it.
You can see the below screen shot with your created methods
ONACTIONNEXT and ONACTIONPREVIOUS.
Step16:
l_ref_componentcontroller = wd_this->get_componentcontroller_ctr( ).
l_ref_componentcontroller->set_step( step ).
Same way in ONACTIONPREVIOUS method of MAIN view (which is called
by clicking the BACK button)
l_ref_componentcontroller = wd_this->get_componentcontroller_ctr( ).
l_ref_componentcontroller->set_PREVIOUS( ).
Same way in ONCATIONNEXT Method of the MAIN view put the below
code:
l_ref_componentcontroller = wd_this->get_componentcontroller_ctr( ).
l_ref_componentcontroller->set_next( ).
Step18:
Add the below code into this method (this code is used to highlight the
current STEP so that user can know on which step he /she is currently on. In
last it will fire an event which is created in component controller .It is
indication of changing the view)
if road_data-step eq ‘START’.
road_data-PREV_ENABLED = abap_false.
else.
road_data-PREV_ENABLED = abap_true.
endif.
if road_data-step eq ‘END’.
road_data-next_ENABLED = abap_false.
else.
road_data-next_ENABLED = abap_true.
endif.
road_node->set_static_attributes( road_data ).
* navigation
wd_this->fire_navigate_evt( step ).
Same way open the method SET_PREVIOUS in component controller and
add the below code in it.
And put the below code in it.(for SET_PREVIOUS and for SET_NEXT no need
for any input parameters)
Step19:
CASE target.
WHEN ‘START’.
wd_this->fire_to_start_plg( ).
WHEN ‘MIDDLE’.
wd_this->fire_to_middle_plg( ).
WHEN ‘END’.
wd_this->fire_to_end_plg( ).
ENDCASE.
Step 20:
I know you are desperate to see the output (*=*) :Don’t worry This is the last
step
Right click on the Component ZT_ROADMAP and create webdynpro
application.