cancel
Showing results for 
Search instead for 
Did you mean: 

Passing Parameters from One WD component to another WD Component ?

former_member184155
Participant
0 Kudos

Hello Experts,

I have two separate Web Dynpro ABAP Components out which one is for approving a particular task.When the User has completed or saved a Task in the first Web Dynpro component a mail is triggered to the approver  which has the link for the for the second Web Dynpro Component(The two WD components are not integrated into the NW portal ). Can i pass the Task id of the first WD Component as a Parameter in the link for the second WD Component & as the user click the link the task should get approved.

I understand when designing separate WD component the URL is for that Web Dynpro component i have not seen passing any parameter to the next Web Dynpro component.

Kindly suggest.

Thanks & Regards

Priyesh Shah

Accepted Solutions (0)

Answers (4)

Answers (4)

gill367
Active Contributor
0 Kudos

You can just add the parameter in the link url that you have created and it can be read in the init method of the window controller in the second component.

Regards,

Sarbjeet Singh

former_member184155
Participant
0 Kudos

What should be it's format ? can you provide a example.

former_member184155
Participant
0 Kudos

I created the URL & passed the parameters in it but i am unable to access those parameters in the WDDOINIT Method of Window controller of the second component. ?

ramakrishnappa
Active Contributor
0 Kudos

Hi Priyesh,

You can access the url parameters in event handler method HANDLEDEFAULT of inbound plug DEFAULT of WINDOW as below

  DATA lt_parameters TYPE tihttpnvp.




  FIELD-SYMBOLS: <ls_parameters> LIKE LINE OF lt_parameters.



  wdevent->get_data(

    EXPORTING

      name  = '_ALL_URL_PARAMETERS'

    IMPORTING

      value = lt_parameters

  ).

LOOP AT lt_parameters ASSIGNING <ls_parameters>.

    CASE <ls_parameters>-name.

      WHEN ''.

        " collect parameters
      WHEN OTHERS.

    ENDCASE.

  ENDLOOP.

Hope this helps you.

Regards,

Rama

former_member184578
Active Contributor
0 Kudos

Hi,

Have you checked the document which I had provided in my earlier reply? http://scn.sap.com/docs/DOC-45729

Regards,

Kiran

gill367
Active Contributor
0 Kudos

Just declare that parameter in the event handler HANDLEDEFAULT of type string and make it optional.

like if you are passing parameter from url like this.

http://..... sap/bc/testapp?LV_SRNO=1234

then in the handle default declare a parameter LV_SRNO of type string associated type "String".

this parameter can be then used to access the value.

Regards,

Sarbjeet SIngh

former_member184155
Participant
0 Kudos

Yours & Sabarjeet singh anwser were somewhat correct answer. Theyy lead me to the right direction.

Message was edited by: Priyesh Shah

former_member184155
Participant
0 Kudos

Yours & Ramakrishnappa Gangappa Answer where somewhat correct but still the problem is a long way to go.

gill367
Active Contributor
0 Kudos

Why wat happened.

May be the full solution of your workflow approval is not yet ready but parameter passing was the problem you raised here. Is something not working with regards to that.

Regards,

Sarbjeet Singh

ramakrishnappa
Active Contributor
0 Kudos

Hi Priyesh,

Are you still having problem with parameter passing via url?

Regards,

Rama

former_member184578
Active Contributor
0 Kudos

Hi,

Concatenate the parameter to the 2nd WDA application and read them. Check this document : http://scn.sap.com/docs/DOC-45729

Hope this helps u.,

Regards,

Kiran

Former Member
0 Kudos

Hello Priyesh,

For this purpose you can do two things.

1. you can set your data while working on 1st comp. at some attribute in Assistance class and in second comp. you can read it.

2. You can use the component usage of 1st component into 2nd component, so by this the node which is marked as interface node in 1st component will be visible to 2nd component.

former_member184155
Participant
0 Kudos

Hi,

1. by Setting data means setting it as a global parameter ?

2. How should i approach you second point ?

Former Member
0 Kudos

1. Yes using Global attribute on Assistance class.

2. Create a node as interface node on 1st component controller and go to the 2nd component and there will be a tab "Used Component" give the name of 1st component and then go to component controller of 2nd comp. and then property and create component usage of same.. now node which is interface node will be visible there.

former_member206479
Participant
0 Kudos

Hi Priyesh,

To read the URL parameters you can write the code in component controller init method by calling following method

  wd_this->param1 =

    wdr_task=>client_window->if_wdr_client_info_object~get_parameter( name = 'urlparam1' ).

like this you can access n number of url parameters(here param1 is attribute in controller).

Regards,

Venkat.

former_member215344
Contributor
0 Kudos

Hi Priyesh,

Check this link:

http://wiki.scn.sap.com/wiki/pages/viewpage.action?pageId=103481411

Thanks,

Ajay Bose

former_member184155
Participant
0 Kudos

Hi Ajay,

My scenario is different, in here the person who is creating the Task & whoever is approving both are different person in same company.

i am asking whether the task id can be passed as a parameter in the second WD Component link ?

Thanks & Regards

Priyesh Shah.

former_member215344
Contributor
0 Kudos

Hi Priyesh,

What do you mean by task id ? Is it the work item id you are referring to ?

Well if you have the task id in your method, you can pass it while building the URL as shown in the link. In the example they have passed EBELN, the same way you can pass any field. In the receiver component you can get the parameter by specifying the parameter name then.

Thanks,

Ajay Bose