Webdynpro ABAP application to locate Employee’s location into google map

Webdynpro ABAP application to locate Employee’s location into google map

Read out this cool Article to know how to create a Webdynpro application to locate the employee into google map.

Author : Raj

Author's Website | Articles from Raj

Raj is an Application Developer focusing on Custom Development - particularly in the areas of ABAP ,WD4A , JAVA , APO , Enterprise services and PI Developer/consultant . He is also certified in ABAP and PI. Facebook

Webdynpro ABAP application to locate Employee’s location into google map.Follow the below 10 easy steps to create this application.

in last you can able to locate your employee on google map.

Step 1:

Go to Se80 create a Webdynpro comp name ZTEST_LOCATE_EMP.

step1

Step 2:

Create a node into your main windo with name EMP. Dictionary strcuture as PA0006.Click on the button “ADD attriubute from structure” and select the perner from it.

step2

Step 3:

Go to layout tab into MAIN view and create an input field with name EMP_ID.

step3

Step 4:

Double click on the EMP_ID.

You can see the value property for it.Bind this to the context attribute you have created.

step4

Step  5:

Create a Button with name LOCATE.

step5

Step 6:

Double click on it, you can see On action propery. Just click on the create button right side of it.

Create a ACTION name LOCATE .no need to give any outbound plug name.

step6

Step 7 :

When you create an action it automatically a Method name ONACTION<your acion name>.

Here it is ONACTIONLOCATE

step7

Step 8.

Put the below code inside your method :

data : v_pernr type pa0006-pernr.
data : v_street type pa0006-STRAS.
data : v_city type pa0006-ORT01.
data : lr_node type ref to if_wd_context_node.
data:  lo_window_manager type ref to if_wd_window_manager.
data:  lo_api_component  type ref to if_wd_component.
data:  lo_window         type ref to if_wd_window.
data:  ld_url type string.
DATA : FINAL_URL TYPE STRING.
lr_node = wd_context->get_child_node( ‘EMP’ ).
lr_node->GET_ATTRIBUTE( exporting NAME = ‘PERNR’
IMPORTING VALUE = V_PERNR ).
select SINGLE STRAS ORT01 from pa0006 into (v_street,v_city) where
PERNR eq v_pernr.
IF SY-SUBRC EQ 0.
CONDENSE V_CITY.
CONDENSE V_STREET.
CONCATENATE
‘http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=’
V_CITY  V_STREET INTO FINAL_URL SEPARATED BY SPACE.
ENDIF.
lo_api_component  = wd_comp_controller->wd_get_api( ).
lo_window_manager = lo_api_component->get_window_manager( ).
*FINAL_URL = ‘www.google.com’.
ld_url = FINAL_URL.
CALL METHOD lo_window_manager->CREATE_EXTERNAL_WINDOW
EXPORTING     URL                = ld_url
RECEIVING    WINDOW         = lo_window.
lo_window->open( ).

Step 9:

Create a Webdynpro application

step9

Step 10:

Execute the application and give the perner which have the address data updated in PA0006. Take pernr 00000003 if you dont get any.

step10

step11

Related Posts



Like this post? Share it!

  • Tweet
  • Facebook
  • Diggit
  • Delicious
  • Diggit
  • Diggit
  • Diggit
  • Diggit
  • Diggit

ADVERTISE HERE


User Comments


  1. Raj
    August 3, 2012

    Hi Raj,
    is it fare wt suggest here??
    Question: how pass data one to another view in a WD Component?
    My Ans: The data which can be shared across all the views that can be placed at Component controller. Because it is global to all other  controllers.
     
    Question: how pass data one to another view in a WD Component with out placing any data in Component controller?
    My Ans: like component controller, WD Component has Custom controller — its is also global to all other controllers. So that the data which can be shared across all the views that can be placed at Component controller in this case.

    Reply


  2. Raj
    August 3, 2012

    Sorry Raj,
    check this answer, previous one i mentioned wrongly
    Question: how pass data one to another view in a WD Component with out placing any data in Component controller?
    My Ans: like component controller, WD Component has Custom controller — its is also global to all other controllers. So that the data which can be shared across all the views that can be placed at Custom controller in this case.

    Reply

Leave a Reply

:wink: :-| :-x :twisted: :) 8-O :( :roll: :-P :oops: :-o :mrgreen: :lol: :idea: :-D :evil: :cry: 8) :arrow: :-? :?: :!:
  Twitter Followers Email Updates