cancel
Showing results for 
Search instead for 
Did you mean: 

passing data from url

Former Member
0 Kudos

hi,

i am having an alv grid in one wd application. in that alv grid, there is a column having data in form of links.

when i click on that link it takes me to a view of another wd application.

how do i pass the data of the hyperlink clicked in the alv and capture it in the next application.

plz reply soon.

thanks & regards,

Ritwik.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member515618
Active Participant
0 Kudos

Hi Ritwik,

In every WDA application there is a parameter tab. Here we can create parameters which can be filled from the url.

Create a parameter there say 'Link'.

When user clicks on the link in the parent application, in the event triggered subsequently, get the url that needs to be called say url1.

To URL concatenate the following.

url1 + '&DynamicParameter=LINK%3d' + 'LINK' INTO url1.

Condence this link and then call the aplication.

When this link is called, the dynamic parameter is automatically read into the filed LINK in the 2nd application. Which can be accessed there by setting into some context.

Hope this helps.

Regards,

Sravan Varagani

Former Member
0 Kudos

hi, Sravan

How to create the parameter for web dynpro application?

How to read the content of parameters to context

in the 2nd application?

Can you tell me the detaile?

Thanks you very much!

former_member515618
Active Participant
0 Kudos

Hi Ken,

In your web dynpro component, Double click on the application and got to the application tab.

here create a parameters.

Give any name in the parameters column, Say ID, the type of it and the description of the field. In values tab you can also set constant values if any.

1. If application is called in from R/3

When your application is called, it launches the URL which gets created in the URL field of the properties tab.

Concatenate the URL with the parameters at the end.

Say if http://xyz.org:8000/sap/bc/webdynpro/yvsk/zweb_dynpro?sap-client=260&sap-language=EN

Is the url that gets generated, then at the end concatenate the parametes as to build url as

http://xyz.org:8000/sap/bc/webdynpro/yvsk/zweb_dynpro?sap-client=260&sap-language=EN&ID=7822

When your web application gets called, it first goes into the HANDLEDEFAULT method in the main window. In this method create an import parameter ID of type defined in the parameters.

The value passed in the URL is received in the ID import field. Which you can use there after.

If the application is called from portal.

Get the IView URL and at the end concatenate URL and '&DynamicParameter=ID%3d and 7822 to get URL&DynamicParameter=ID%3d7822.

Hope this helps.

Regards,

Sravan Varagani

Former Member
0 Kudos

Hi, Sravan

Thank you for your help, this very useful!

Former Member
0 Kudos

hi,

i have created a parameter NUM1 in my WD Application. and i have given its value as 1.

i have an URL say 'http://test'.

how do i concatinate this parameter to the url so that the default value is reflected in the url.

plz reply.

thanks & regards,

Ritwik.

former_member515618
Active Participant
0 Kudos

Hi Ritwik,

This way of concatenating the parameters and calling the web application can be used to launch web application from an external source. e.g portal. or calling from R/3.

Assume that the application is linked in portal and we are trying to launch it from R/3 program.


  clear: g_url, g_url1, g_url2.

  data cl_front_end   type ref to CL_GUI_FRONTEND_SERVICES.
  data l_user_domain  type string.
  data l_userid       type char100.
  data ls_aduser      type /rio/zst_aduser.
  data l_sso          type c.

constants: c_mode_param(50) type c value
                            '&DynamicParameter=MODE%3d'.

  CALL FUNCTION 'GUI_GET_DESKTOP_INFO'
    EXPORTING
      type   = '5'
    CHANGING
      return = l_userid.

  condense l_userid.
  create object cl_front_end.

  CALL METHOD cl_gui_frontend_services=>environment_get_variable
    EXPORTING
      variable = 'USERDOMAIN'
    CHANGING
      value    = l_user_domain
    EXCEPTIONS
      others   = 4.

  if sy-subrc <> 0.
* Error message
  endif.

  CALL METHOD CL_GUI_CFW=>FLUSH.

  translate l_userid TO UPPER CASE.
  translate l_user_domain TO UPPER CASE.

  select single * into ls_aduser
    from /rio/zst_aduser
    where sapuser = sy-uname.

  clear l_sso.
  if ( ls_aduser-mc_aduser = l_userid ) and
     ( ls_aduser-mc_domain = l_user_domain ).
    l_sso = 'X'.
  else.
    l_sso = space.
  endif.


  data: l_pcd_location type XSS_SER_STRING,
        l_navtype      type XSS_SER_STRING.
* get the http destination for the prospect portal
  CALL FUNCTION 'RFC_READ_HTTP_DESTINATION'
    EXPORTING
      DESTINATION             = '<PROSPECT_PORTAL_DESTINATION>'
      AUTHORITY_CHECK         = ' '
    IMPORTING
      SERVICENR               = servicenr
      SERVER                  = portal_server
    EXCEPTIONS
      AUTHORITY_NOT_AVAILABLE = 1      "PATH_PREFIX = pcd_location
      DESTINATION_NOT_EXIST   = 2
      INFORMATION_FAILURE     = 3
      INTERNAL_FAILURE        = 4
      NO_HTTP_DESTINATION     = 5
      OTHERS                  = 6.
  IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ELSE.
    " get the url of the pcd page for the common transaction iview
    clear l_pcd_location.
    clear l_navtype.
    select single b~text
       into l_pcd_location
       from t7xssserstring as b
       inner join t7xssserres as a
       on a~respcdpage = b~guid
       where a~ressource = P_TABLE_KEY.

    if ( l_sso = 'X' ).
      move '/ntlm/portal?NavigationTarget=' to l_navtype.
    else.
      move '/irj/portal?NavigationTarget=' to l_navtype.
    endif.

    concatenate 'http://' portal_server ':' servicenr l_navtype l_pcd_location into g_url1.

  ENDIF.


* If you want to pass some parameters to the Application then concatenate them aswell as follwos.

        concatenate g_url1 c_param_mode 'E' INTO g_url1.

  "call the browser using the URL obtained
  CALL FUNCTION 'CALL_BROWSER'
    EXPORTING
      URL                    = g_url1
      NEW_WINDOW             = c_x
    EXCEPTIONS
      FRONTEND_NOT_SUPPORTED = 1
      FRONTEND_ERROR         = 2
      PROG_NOT_FOUND         = 3
      NO_BATCH               = 4
      UNSPECIFIED_ERROR      = 5
      OTHERS                 = 6.
  IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

If the same is launched from one wda application in portal and calling another application associated in portal.


*---------------------------------------------------------------------*
* Reference to context nodes (lo_)
*--------------------------------------------------------------------*
  DATA:
*   Messages
    lo_message_manager          TYPE REF TO if_wd_message_manager,
*   Portal manager
    lo_port_manager             TYPE REF TO if_wd_portal_integration,
*   Current controller
    lo_current_controller       TYPE REF TO if_wd_controller,
*   API Component controller
    lo_api_componentcontroller  TYPE REF TO if_wd_component,
*   Component controller
    lo_componentcontroller      TYPE REF TO ig_componentcontroller,
 
*--------------------------------------------------------------------*
* Local tables (lt_)
*--------------------------------------------------------------------*
*   Launch parameteres
    lt_launcher_parameter_list  TYPE wdy_key_value_table,
*   Business parameters
    lt_bus_parameter_list       TYPE wdy_key_value_table,
*--------------------------------------------------------------------*
* Local structure (ls_)
*--------------------------------------------------------------------*
    ls_keyvalue_pair            TYPE wdy_key_value,
*--------------------------------------------------------------------*
* local variables (l_)
*--------------------------------------------------------------------*
*   Risk id
    l_risk_id                   TYPE j_objnr,
*   PCD Location
    l_pcd_location              TYPE string.
 
 
*----------------------Begin of main processing----------------------*
 
  lo_current_controller ?= wd_this->wd_get_api( ).
 
* Get message manager
  CALL METHOD lo_current_controller->get_message_manager
    RECEIVING
      message_manager = lo_message_manager.
 
  lo_componentcontroller = wd_this.
  lo_api_componentcontroller = lo_componentcontroller->wd_get_api( ).
  lo_port_manager = lo_api_componentcontroller->get_portal_manager( ).
 
* Generally the paths for the IView is stored in below table.
* Get the url of the pcd page for the common transaction iview
  SELECT SINGLE b~text INTO l_pcd_location
                       FROM t7xssserstring AS b
                 INNER JOIN t7xssserres AS a
                         ON a~respcdpage = b~guid
                      WHERE a~ressource = 'RESOURCE_KEY'.
  IF sy-subrc  0.
*   Error!! Invalid configuration
    CALL METHOD lo_message_manager->report_t100_message
      EXPORTING
        msgid = 
        msgno =
        msgty = 
  ELSE.
* Build launch parameters
If you have build any parameters for the application then pass them here.
 
    CLEAR: ls_keyvalue_pair.
    ls_keyvalue_pair-key = *'MODE'.*
    ls_keyvalue_pair-value = +'E'.+  "Edit
    APPEND ls_keyvalue_pair TO lt_bus_parameter_list.
 
    CLEAR: ls_keyvalue_pair.
    ls_keyvalue_pair-key = *'ID'.*
    ls_keyvalue_pair-value = id. "Unique key
    APPEND ls_keyvalue_pair TO lt_bus_parameter_list.
 
    CLEAR: ls_keyvalue_pair.
    ls_keyvalue_pair-key = 'NavMode'.
    ls_keyvalue_pair-value = '3'.
    APPEND ls_keyvalue_pair TO lt_launcher_parameter_list.
 
* Navigate risk assessment web interface.
 
    CALL METHOD lo_port_manager->navigate_absolute
      EXPORTING
        navigation_target   = l_pcd_location
        navigation_mode     = '1'
        use_sap_launcher    = true
        business_parameters = lt_bus_parameter_list
        launcher_parameters = lt_launcher_parameter_list.
 
  ENDIF. "If PCD path is found

Hope this helps.

Regards,

Sravan varagani